Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Announcements
  3. ๐Ÿ’ฌ Building a Raspberry Pi Gateway

๐Ÿ’ฌ Building a Raspberry Pi Gateway

Scheduled Pinned Locked Moved Announcements
1.1k Posts 173 Posters 422.6k Views 131 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • gohanG Offline
    gohanG Offline
    gohan
    Mod
    wrote on last edited by
    #479

    what raspberry version is that? What library version did you download?

    Z 1 Reply Last reply
    0
    • Luc3asL Offline
      Luc3asL Offline
      Luc3as
      wrote on last edited by
      #480

      do you have SPI enabled through raspi-config ?

      Z 1 Reply Last reply
      1
      • gohanG gohan

        what raspberry version is that? What library version did you download?

        Z Offline
        Z Offline
        zavracky
        wrote on last edited by
        #481

        @gohan Thanks for the response. I downloaded the MySensors Library 2.1.1. Sorting through it I can see that SPI.h is included.

        I installed a complete system in FL (I'm retired and a snowbird). Included are a Bunch of Arduino sensors, a Foscam Camera and Wemo switches. So I used a lot of material from MySensors to get the Arduino sensors up and running (great stuff: thanks to all those folks who created it). I then created a Raspberry Wireless (RF24) Gateway and installed Mosquitto to communicate with HomeAssistant. Took a while to configure HA, and I'm still learning.

        I do not recall having a problem with the SPI library when assembling all this stuff. Upon return to Boston, I have made a number of improvements talking to the Raspberry in FL through TeamViewer (a great app). However, along the way, I corrupted the system in FL. It now limps. So, I started recreating the stuff in FL on a new SD card, encountering the SPI problem.

        Since sending out my request for help, I found a backup version of my FL system on an SD card. Looking at it, the system seems to be whole and boots with no issues. mysgw works fine on it. So, I've added all my new stuff to this SD card and have tested it to make sure its working. Things are looking good and so, my immediate problem is solved (circumvented).

        I still want to know what I am doing wrong with the gateway. I've learned a little bit of Python along the way. There, one installs a library. I know effectively nothing about C++. So, I've done nothing to install the library, only followed the instructions on the MySensors Raspberry Pi Gateway page.

        BTW, this stuff is great.

        Paul

        1 Reply Last reply
        0
        • Luc3asL Luc3as

          do you have SPI enabled through raspi-config ?

          Z Offline
          Z Offline
          zavracky
          wrote on last edited by
          #482

          @Luc3as Thanks for your response. No, in fact it was not enabled. Please read my reply to gohan. As you see, I've cheated my way out of this problem. In the process, I've lost track of the SD card on which I encountered this problem. Nonetheless, I will circle back to test your suggestion.

          1 Reply Last reply
          0
          • gohanG Offline
            gohanG Offline
            gohan
            Mod
            wrote on last edited by gohan
            #483

            Try to enable the SPI first. Then you could also try different linux distributions and see which one you like better ( I personally like dietpi more than the others ). You may also want to try to use Mysensors library from development branch that is now 2.2.0.
            I now have a dietpi + mysensors 2.2.0 + nrf24 and all running fine

            1 Reply Last reply
            0
            • M marceloaqno

              @Roberto-Mo-Ca If you are using the nrf24 PA/LNA version you need to use a 5V->3.3V regulator otherwise you can connect to the 3.3v pin.

              S Offline
              S Offline
              subutux
              wrote on last edited by
              #484

              @marceloaqno said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

              @Roberto-Mo-Ca If you are using the nrf24 PA/LNA version you need to use a 5V->3.3V regulator otherwise you can connect to the 3.3v pin.

              But why do we need to convert down from 5v to 3.3v? The pi does supply 3.3 on some pins.. Is this because the PA/LNA uses more mA?

              1 Reply Last reply
              0
              • gohanG Offline
                gohanG Offline
                gohan
                Mod
                wrote on last edited by
                #485

                yes, the 3.3v can't supply enough current. I am using some small adapters that have the AMS1117 and some capacitors that allow for a quick swap of radio modules when you need test them

                S 1 Reply Last reply
                0
                • gohanG gohan

                  yes, the 3.3v can't supply enough current. I am using some small adapters that have the AMS1117 and some capacitors that allow for a quick swap of radio modules when you need test them

                  S Offline
                  S Offline
                  subutux
                  wrote on last edited by
                  #486

                  @gohan said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                  yes, the 3.3v can't supply enough current. I am using some small adapters that have the AMS1117 and some capacitors that allow for a quick swap of radio modules when you need test them

                  Ok. Maybe this should be mentioned in the documentation page.

                  mfalkviddM gohanG 2 Replies Last reply
                  0
                  • S subutux

                    @gohan said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                    yes, the 3.3v can't supply enough current. I am using some small adapters that have the AMS1117 and some capacitors that allow for a quick swap of radio modules when you need test them

                    Ok. Maybe this should be mentioned in the documentation page.

                    mfalkviddM Offline
                    mfalkviddM Offline
                    mfalkvidd
                    Mod
                    wrote on last edited by
                    #487

                    @subutux could you explain where you would expect to find that note?

                    1 Reply Last reply
                    0
                    • mfalkviddM Offline
                      mfalkviddM Offline
                      mfalkvidd
                      Mod
                      wrote on last edited by
                      #488

                      (obviously not here)
                      0_1496838882911_image.png

                      1 Reply Last reply
                      0
                      • S subutux

                        @gohan said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                        yes, the 3.3v can't supply enough current. I am using some small adapters that have the AMS1117 and some capacitors that allow for a quick swap of radio modules when you need test them

                        Ok. Maybe this should be mentioned in the documentation page.

                        gohanG Offline
                        gohanG Offline
                        gohan
                        Mod
                        wrote on last edited by
                        #489

                        @subutux it is mentioned as stated above that you need it, it is just skipping all the info that are in datasheets and are not stricly necessary to make the gateway

                        S 1 Reply Last reply
                        0
                        • gohanG gohan

                          @subutux it is mentioned as stated above that you need it, it is just skipping all the info that are in datasheets and are not stricly necessary to make the gateway

                          S Offline
                          S Offline
                          subutux
                          wrote on last edited by
                          #490

                          @gohan said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                          @subutux it is mentioned as stated above that you need it, it is just skipping all the info that are in datasheets and are not stricly necessary to make the gateway

                          Well, I for one would like to know why we need to step-down from 5v to 3.3v. Just a simple statement that the LNA version requires more power that only the 5v can deliver on the pi.
                          @mfalkvidd Yeah I would mention it there. It mentions to use a regulator but not why.. I've read that line & was like, why? That's when I've started a search in the forums here.

                          mfalkviddM 1 Reply Last reply
                          0
                          • S subutux

                            @gohan said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                            @subutux it is mentioned as stated above that you need it, it is just skipping all the info that are in datasheets and are not stricly necessary to make the gateway

                            Well, I for one would like to know why we need to step-down from 5v to 3.3v. Just a simple statement that the LNA version requires more power that only the 5v can deliver on the pi.
                            @mfalkvidd Yeah I would mention it there. It mentions to use a regulator but not why.. I've read that line & was like, why? That's when I've started a search in the forums here.

                            mfalkviddM Offline
                            mfalkviddM Offline
                            mfalkvidd
                            Mod
                            wrote on last edited by
                            #491

                            @subutux I've updated the text. Do you think it is ok?

                            S 1 Reply Last reply
                            1
                            • mfalkviddM mfalkvidd

                              @subutux I've updated the text. Do you think it is ok?

                              S Offline
                              S Offline
                              subutux
                              wrote on last edited by
                              #492

                              @mfalkvidd said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                              @subutux I've updated the text. Do you think it is ok?

                              yup! thanks!

                              1 Reply Last reply
                              1
                              • Q Offline
                                Q Offline
                                qkzk
                                wrote on last edited by
                                #493

                                Hi,
                                I'm having trouble setting up mysensor with this configuration.
                                Controler : Home assistant on a debian server. ip : 192.168.0.50
                                Gateway : rpi3, connected to the server trought ethernet. ip : 192.168.0.21
                                Sensor : simple door switch from the example scripts.

                                On both sensor and gateway the transport is a nrf24l01+ module. I bought 4 of them and they all worked in simpler projects (on both arduino and rpi).

                                The main problem is I can't get the rf24l01+ to work with mysensor. I checked the wiring multiple times a changed the module. Nothing changes.
                                I also tried to change the configuration settings but it has no effect :

                                I configured as :
                                ./configure --my-transport=nrf24 --my-gateway=ethernet --my-controller-ip-address=192.168.0.50 --my-port=5003

                                Here is what I got every time i launch mysgw :

                                /MySensors $ sudo ./bin/mysgw -d
                                mysgw: Starting gateway...
                                mysgw: Protocol version - 2.1.1
                                mysgw: MCO:BGN:INIT GW,CP=RNNG---,VER=2.1.1
                                mysgw: TSM:INIT
                                mysgw: TSF:WUR:MS=0
                                mysgw: !TSM:INIT:TSP FAIL
                                mysgw: TSM:FAIL:CNT=1
                                mysgw: TSM:FAIL:PDT
                                mysgw: TSM:FAIL:RE-INIT

                                I used the wiring described in the script but without a voltage regulator. so I also checked the voltage received by the nrf24l01+ and it's a steady 3.3v.

                                What's wrong here ? Any help would be greatly appreciated.

                                --

                                On another topic, home assistant doesn't seem to provide support for mysensor 2.1 protocol. Should I downgrade to 2.0 ?
                                Obviously the controler can't connect to the gateway presently since the gateway isn't launching properly.
                                Home assistant is constantly whining about it :

                                Here is what I get from home automation console :

                                Error (Thread-13) [mysensors.gateway_tcp] Failed to connect to socket at ('192.168.0.21', 5003).

                                and here is my configuration.yaml extract :

                                mysensors:
                                gateways:
                                - device: '192.168.0.21'
                                optimistic: false
                                persistence: true
                                retain: true
                                version: 2.0,

                                1 Reply Last reply
                                0
                                • Q Offline
                                  Q Offline
                                  qkzk
                                  wrote on last edited by
                                  #494

                                  I just checked the wiring again and tested it with a voltage shifter I used for a grove RGB LCD and I got the same results

                                  1 Reply Last reply
                                  0
                                  • gohanG Offline
                                    gohanG Offline
                                    gohan
                                    Mod
                                    wrote on last edited by
                                    #495

                                    @qkzk said in ๐Ÿ’ฌ Building a Raspberry Pi Gateway:

                                    --my-controller-ip-address=192.168.0.50

                                    I think you can ignore that parameter. Did you try making a USB gateway or ethernet gateway with an arduino? Why the voltage shifter? Did you add a capacitor on the 3.3v supply of the nrf24? You could also try with the 2.2.0 version from development branch that has some fixes

                                    1 Reply Last reply
                                    0
                                    • Q Offline
                                      Q Offline
                                      qkzk
                                      wrote on last edited by
                                      #496

                                      I tried the voltage shifter since I read : (*): If you are using the nrf24 PA/LNA version you need to use a 5V->3.3V regulator because the Raspberry Pi 3.3V can't supply enough power.
                                      Since I don't know the version...

                                      I had no success with an arduino USB gateway but I'll try again.

                                      I thought the controller-ip-adress=192.168.0.50 parameter was usefull otherwise the gateway would have to look guess where the controler is. I may have got everything wrong about who is initiating the dialogue. From what I read in home automation logs it's the controller who is looking for the gateway...

                                      I'll try the 2.2.0 version.

                                      1 Reply Last reply
                                      0
                                      • Q Offline
                                        Q Offline
                                        qkzk
                                        wrote on last edited by
                                        #497

                                        I managed to connect everything but not the way I would have prefered.
                                        Controler : Home assistant on debian server
                                        Gateway : arduino Uno connected to debian server trough usb serial
                                        Sensor : binary sensor (reed switch) on arduino mini.

                                        I'm still trying to figure what's wrong with what I posted earlier.

                                        1 Reply Last reply
                                        0
                                        • Q Offline
                                          Q Offline
                                          qkzk
                                          wrote on last edited by
                                          #498

                                          WOW ! It works :) thanks @gohan :)
                                          I removed the voltage shifter, added an 1ยตF capacitor and downloaded developpement libraries.
                                          Also, I cleaned the configuration parameters : ./configure --my-transport=nrf24 --my-gateway=ethernet
                                          It finally works as expected (sensor, gw on rpi3, controler on debian server) and I can ditch the uno (well, I'll find him another use).
                                          Thanks again for the wonderfull work, it's been fun :)

                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          17

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular