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. Development
  3. Physically small Gateway (to fit inside Raspberry Pi case)

Physically small Gateway (to fit inside Raspberry Pi case)

Scheduled Pinned Locked Moved Development
9 Posts 3 Posters 2.8k Views 4 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.
  • T Offline
    T Offline
    ToniA
    wrote on last edited by
    #1

    I would like to have the gateway within the Raspberry Pi case, instead of connecting for example Arduino Nano through the USB, and connecting the NRF24 using DuPont wires. But how do I do this? None of the examples I have tried so far have worked correctly with the latest Domoticz beta. And yes, as a starting point, the Serial Gateway on Arduino Nano as of Git tag 1.5.3 works perfectly.

    What I have tried so far are

    • SenseBender Micro as the Serial Gateway
      • One the first glance this seems fine, but it will not transmit anything
      • Forum posts about the subject
        • http://forum.mysensors.org/topic/2923/sensebender-micro-as-gateway-on-raspberry-pi/2
        • http://forum.mysensors.org/topic/1632/sensebender-micro-as-serial-gateway/2
      • Is this caused by the 1 MHz clock speed?
    • NRF24 connected directly to the Raspberry Pi's GPIO pins
      • https://www.openhardware.io/view/17/Raspberry-Pi2-GPIO-interface-for-NRF24L01
      • https://github.com/mysensors/Raspberry
      • The MySensors Raspberry Gateway software seems to be on MySensors 1.4 level
      • I have great difficulties in the sensor presentation on Domoticz, i.e. my sensors (V_IR_RECEIVE, V_TEXT, V_LIGHT) do not reliably appear as devices on Domoticz. When looking at the properties of the 'MySensors' system device, the sensors are there, however???

    Any help would be greatly appreciated... I'd really want to have a small gateway within the Raspberry case.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      ToniA
      wrote on last edited by
      #2

      Or, is it about the 115200 baud rate on a 3.3V ATmega328?

      http://forum.mysensors.org/topic/1483/trouble-with-115200-baud-on-3-3v-8mhz-arduino-like-serial-gateway-solution-change-baudrate/2

      1 Reply Last reply
      0
      • T Offline
        T Offline
        ToniA
        wrote on last edited by
        #3

        OK, found it. It's about the baud rate, 115200 does not work for a Serial Gateway running on a SenseBender. The real baud rate is too much off when the baud rate is generated from the ATmega 328's internal 8 MHz oscillator.

        Unfortunately the 115200 baud rate is hard-coded into Domoticz. I just changed the hardcoded value to 38400 in hardware/MySensorsSerial.cpp, and also rebuilt the 1.5.3 version of the SerialGateway with 38400 as the baud rate.

        Works fine now :) But I think I'll need to make a change & pull request to Domoticz.

        1 Reply Last reply
        1
        • T Offline
          T Offline
          ToniA
          wrote on last edited by
          #4

          One more thing. Gizmocuz (Domoticz author) was concerned about performance. Would you think it's fine to run the serial gateway on 8 MHz clock speed?

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

            My first computer wasn't as fast as 8Mhz. It could still do a lot of things. All a gateway does is to receive and transmit tiny messages every now and then. Would be interesting to know what the basis for corncern is though.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              ToniA
              wrote on last edited by
              #6

              OK, I think I'm good to go. I'll try to make a change & pull request into Domoticz (additional checkbox on 'MySensors USB gateway' device) to tell it's a '3.3V 8MHz ATmega328'. In that case the baud rate would be 38400, instead of 115200.

              Maybe the MySensors code could also detect (is there a #define for it?) the clock speed/board model/operating voltage, and set the serial speed to 38400 for 8MHz on 8MHz boards.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                gloob
                wrote on last edited by gloob
                #7

                This sounds really good. I will now also try to reuse my sensebender as a Gateway on the raspberry with a lower baudrate.

                I'm using FHEM and it is possible to set the baudrate in the configuration.

                The strange thing is, that the receiving Messages from nodes and sending the Content to the Controller was working. Only sending values from the Controller to the nodes was not working.
                I think the raspberry is more tolerate in receiving Messages with a Little bit different Baudrate, than the ATmega.

                T 1 Reply Last reply
                0
                • G gloob

                  This sounds really good. I will now also try to reuse my sensebender as a Gateway on the raspberry with a lower baudrate.

                  I'm using FHEM and it is possible to set the baudrate in the configuration.

                  The strange thing is, that the receiving Messages from nodes and sending the Content to the Controller was working. Only sending values from the Controller to the nodes was not working.
                  I think the raspberry is more tolerate in receiving Messages with a Little bit different Baudrate, than the ATmega.

                  T Offline
                  T Offline
                  ToniA
                  wrote on last edited by
                  #8

                  @gloob said:

                  The strange thing is, that the receiving Messages from nodes and sending the Content to the Controller was working. Only sending values from the Controller to the nodes was not working.

                  Yep, I had exactly the same problem. Looks good on the surface, but no commands were sent out.

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    ToniA
                    wrote on last edited by ToniA
                    #9

                    I made a pull request. The sketch GatewaySerial.ino now sets the serial speed to 38400 if the Arduino is running on 8MHz clock speed.

                    https://github.com/mysensors/Arduino/pull/391

                    EDIT: My pull request was accepted into the Domoticz master branch :)

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


                    11

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 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