Skip to content
  • 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. My Project
  3. Domoticz as controller **and** a gateway for MySensor nodes running on a Raspberry Pi 2
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Domoticz as controller **and** a gateway for MySensor nodes running on a Raspberry Pi 2

Scheduled Pinned Locked Moved My Project
47 Posts 14 Posters 27.3k Views 16 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.
  • AnticimexA Offline
    AnticimexA Offline
    Anticimex
    Contest Winner
    wrote on last edited by
    #7

    This is interesting stuff! Do you know if the raspberrypi port supports rf69 as well?

    Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

    1 Reply Last reply
    0
    • GertSandersG Offline
      GertSandersG Offline
      GertSanders
      Hardware Contributor
      wrote on last edited by
      #8

      @Anticimex: no idea. I have not used the RF69 so far. Still a lot to learn from the "classic" nrf24l01+ :-).

      But if the same pins are used in the same location, then I believe it depends on the software. The SerialGateway software for Raspberry. Maybe one of the original designers of that gateway can tell you if they support RF69. Would be nice !

      1 Reply Last reply
      0
      • GertSandersG Offline
        GertSandersG Offline
        GertSanders
        Hardware Contributor
        wrote on last edited by
        #9

        Here is an image of the voltage regulator I use:

        AMS1117.jpg

        SOT223 package, more then powerful enough for a single SMA-type NRF24.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MikeF
          wrote on last edited by
          #10

          @GertSanders Thanks for the extra info - that was very helpful.

          1 Reply Last reply
          0
          • GertSandersG Offline
            GertSandersG Offline
            GertSanders
            Hardware Contributor
            wrote on last edited by
            #11

            some more imagesthumb_IMG_7286_1024.jpg IMG_7288.jpg IMG_7289.jpg
            IMG_7290.jpg
            IMG_7291.jpg

            IMG_7292.jpg IMG_7298.jpg IMG_7295.jpg

            1 Reply Last reply
            1
            • M Offline
              M Offline
              MikeF
              wrote on last edited by
              #12

              Hi @GertSanders, I've received the PCB, built the adaptor and the software as per the MySensors Raspberry Port GitHub. I've created a symlink to /dev/ttyMySensorsGateway (/dev/ttyUSB40), which Domoticz, and I see the following in the Domoticz log:

              2015-09-29 17:48:40.503 MySensors: Using serial port: /dev/ttyUSB40
              2015-09-29 17:48:40.503 MySensors: Gateway Ready...

              However, I can't see any of the devices on my node - any ideas?

              1 Reply Last reply
              0
              • GertSandersG Offline
                GertSandersG Offline
                GertSanders
                Hardware Contributor
                wrote on last edited by
                #13

                In my case I had to restart the nodes, because they did not get the ID from Domoticz. But it takes a few minutes. The gateway is polled every 30 seconds or so. Apart from that, I do not know what could be the problem. Did you allow discovery/addition of new sensors in Domoticz ?

                The board should sit between pin 17/18 and 23/24 of the GPIO. There is not much on the board that could malfunction, except maybe the power regulator. Does it give 3V3 ?
                Did you solder the jumper right?
                If you solder close to the regulator, the board expects connection to 5V (as in my pictures). If you connected the 3V3 side, then it takes power directly from the GPIO. With the large NRF24 that could be insufficient.

                If all fails, then test without the board: connect the radio directly to the GPIO. That is all I can think of without seeing your setup.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  MikeF
                  wrote on last edited by
                  #14

                  Thanks, Gert. I've checked all my soldering (continuity from header to header), the jumper is soldered for 5V, and I'm getting 3V3 across the supply pins of the radio. Board is sitting between 17/18 & 23/24.
                  I'm still only getting the above 2 lines in the log, i.e., no devices.
                  I'll try connecting the radio direct to the GPIO later today.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MikeF
                    wrote on last edited by
                    #15

                    Cracked it! I'm using an RPi 2, and cat /proc/cpuinfo gives a01041 as hardware version. According to GitHub readme, CE needs to go to pin 15, not 22.

                    Now working with radio connected directly, but will now need to connect a jumper wire from the adaptor board.

                    1 Reply Last reply
                    0
                    • GertSandersG Offline
                      GertSandersG Offline
                      GertSanders
                      Hardware Contributor
                      wrote on last edited by
                      #16

                      Strange, I'm also working on the RPi 2. I will check what I have in my RF24 library, because I'm sure that you can change pin assignment in software instead of needing to resort to extra jumper wire.
                      When home I will check this tonight. I really need to write out a procedure for this, or we will forget in the future how it should be set up.

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        MikeF
                        wrote on last edited by
                        #17

                        Hello @GertSanders, for the time being I've got the gateway working with CE connected to pin 15, having carried out some 'surgery' to the board!

                        I've found this code in PiGatewaySerial.cpp (line 198 onwards):

                        /* create MySensors Gateway object */
                        #ifdef __PI_BPLUS
                        gw = new MyGateway(RPI_BPLUS_GPIO_J8_15, RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ, 1);
                        #else
                        gw = new MyGateway(RPI_V2_GPIO_P1_22, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_8MHZ, 1);
                        #endif

                        Is this the 'offending' code?

                        1 Reply Last reply
                        1
                        • GertSandersG Offline
                          GertSandersG Offline
                          GertSanders
                          Hardware Contributor
                          wrote on last edited by
                          #18

                          Yes, as the rpi2 is not recognised properly the code compiles for rpib+.

                          I changed the code so that both rpi b+ as rpi2 have the same: use pin 22

                          1 Reply Last reply
                          0
                          • GertSandersG Offline
                            GertSandersG Offline
                            GertSanders
                            Hardware Contributor
                            wrote on last edited by
                            #19

                            @MikeF said:

                            gw = new MyGateway(RPI_V2_GPIO_P1_22, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_8MHZ, 1);

                            You will need the code as here above, then no need for surgery

                            1 Reply Last reply
                            1
                            • GertSandersG Offline
                              GertSandersG Offline
                              GertSanders
                              Hardware Contributor
                              wrote on last edited by
                              #20

                              Had some time to log into my Raspberry 2 today, and indeed I adapted the code I used for the PiGatewaySerial because a RPI2 is not recognised properly.

                              So here is what I used as source-file:

                              Screen Shot 2015-10-03 at 11.51.49.png

                              I'm not sure where the correction should be made so that the RPI2 is recognised properly (instead of being recognised a s a raspi B+)

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                MikeF
                                wrote on last edited by
                                #21

                                All now working OK - many thanks!

                                1 Reply Last reply
                                0
                                • GertSandersG Offline
                                  GertSandersG Offline
                                  GertSanders
                                  Hardware Contributor
                                  wrote on last edited by
                                  #22

                                  I will need to document this. In the original post I followed to compile the gateway for rpi, this was also mentioned.
                                  I would prefer that the code is corrected in the right place, because I feel the RPI2 should be recognised properly.
                                  Anyway, happy to know there is a +1 user with a raspberry 2 and direct connected NRF24.

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    MikeF
                                    wrote on last edited by
                                    #23

                                    That's the code change I made (makes the 'if' redundant).

                                    I've also changed the tty name (to /dev/ttyUSB40 - which is what I've declared to Domoticz) in this file and in Makefile.

                                    BTW: Very impressed with OSH Park - got the PCBs here in UK (from US) 13 days after ordering!

                                    1 Reply Last reply
                                    0
                                    • GertSandersG Offline
                                      GertSandersG Offline
                                      GertSanders
                                      Hardware Contributor
                                      wrote on last edited by GertSanders
                                      #24

                                      This was the fourth board I ordered from OSHPark. For boards with ENIG finish, they are cheap. And the quality is indeed excellent. I have ordered a fifth design from them (should be ready end next week) and at the same time I sent my files to DirtyPCB. We will see what that gives quality wise. On this forum someone mentioned Shenzen2u and they are eaven cheaper then DirtyPCB. So my next design will also be ordered from those guys.
                                      Now it's time to enjoy a local brew :-)

                                      1 Reply Last reply
                                      0
                                      • TD22057T Offline
                                        TD22057T Offline
                                        TD22057
                                        Hardware Contributor
                                        wrote on last edited by
                                        #25

                                        @GertSanders Check out http://pcbshopper.com/, there are places slightly cheaper than DirtyPCB and places that will do runs of 5 boards instead of 10 for the same price per board. http://www.elecrow.com/ looks really good (5 boards for $15 delivered) but I haven't ordered from them yet so I can't comment on quality (other reviews of them say it's fine though).

                                        1 Reply Last reply
                                        0
                                        • GertSandersG Offline
                                          GertSandersG Offline
                                          GertSanders
                                          Hardware Contributor
                                          wrote on last edited by
                                          #26

                                          I would rather pay 8.90 USD for 10 boards, then 15 USD for 5 boards delivered. http://www.shenzhen2u.com does the thing for me.

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


                                          14

                                          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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular