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. Troubleshooting
  3. Unable to use the SerialGateway code

Unable to use the SerialGateway code

Scheduled Pinned Locked Moved Troubleshooting
12 Posts 5 Posters 5.7k Views 3 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.
  • hariH Offline
    hariH Offline
    hari
    Plugin Developer
    wrote on last edited by
    #1

    I had a good share of pain with the NRF24 modules and the SerialGateway code. I can happily load the ping test onto two pro mini 3,3V and they talk to each other just fine. When loading the SerialGateway code onto the 3,3V pro mini, it does not react on serial commands (e.g. 0;0;4;4; or 0;0;4;6;1). So I grabbed a 5V, loaded the gateway code on it, and voila, it responds to serial commands. But no RF comms, and when loading the ping example on the 5V pro mini, I get no replies. The NRF24 was powered from a TOE8852 lab power supply set to 3,3V in this case. That unit has very low ripple (this was also used for the successful ping test between the two 3,3V pro minis). Anyway, maybe something is b0rked with that combo, so I got an Arduino Mega. I tried to feed the radio off the 3,3V connector on the mega (with and without 4,7u cap). Same result, the gateway code works fine, but no RF. 3rd attempt with a shiny new Mega 2560.. but.. you guess it.. no luck. I've verified the 3,3V supply right on the NRF24 with a multimeter. I've swapped radios back and forth (got a lot of 10). SOoo.. a few questions:

    1. am I doing something stupid here without realising it?
    2. what is the recommended arduino to run the serial gateway code?
    3. why is the gateway code not working on a 328 pro mini 3,3V?

    I'd appreciate any hints before I fetch the analyser and the scope for further debugging..

    regards,
    Hari

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by hek
      #2

      I have only verified the SerialGateway on the Nano board. But I see no reason why it wouldn't work on the Pro Mini 3.3.

      What are you expecting the serial command 0;0,4;4 to do? Send a command to sensor 0? That is the gateway itself and not a valid radioId.

      1 Reply Last reply
      0
      • hariH Offline
        hariH Offline
        hari
        Plugin Developer
        wrote on last edited by
        #3

        I've tried two different pro mini 3,3v boards, and the SerialGateway does not respond to serial commands on them. I expect 0;0;4;4; to reply the firmware version of the serial gateway. And it works fine on non-3,3V-pro-mini. The vera lua script is doing the same on startup:

        -- Request version info from Arduino gateway
        sendCommandWithMessageType("0;0","INTERNAL",tonumber(tInternalTypes["VERSION"][1]),"Get Version")
        
        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by hek
          #4

          Trying to pick up a chat session with you. look in the lower corner of the screen (or the chat bubble at the top right of the forum).

          1 Reply Last reply
          0
          • marceltrapmanM Offline
            marceltrapmanM Offline
            marceltrapman
            Mod
            wrote on last edited by
            #5

            Could this be "related" to my issue?
            I can't seem to get it working with an Uno board.
            I will do some more testing today.

            Fulltime Servoy Developer
            Parttime Moderator MySensors board

            I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
            I have a FABtotum to print cases.

            1 Reply Last reply
            0
            • hariH Offline
              hariH Offline
              hari
              Plugin Developer
              wrote on last edited by
              #6

              Things seem to work with the mega 2560 after realising that it has completely different SPI pins:

              pin D8-----------CE (chip enable in)
              SS pin D53----------CSN (chip select in)
              SCK pin D52----------SCK (SPI clock in)
              MOSI pin D51----------SDI (SPI Data in)
              MISO pin D50----------SDO (SPI data out)

              In the sketch I use this:
              Gateway gw(8, 53, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);

              Dunno why the pro mini 5V is not working, but as I'm able to talk to a sensor already I probably won't dig further into that..

              2;0;1;0;26.1

              hekH petewillP 2 Replies Last reply
              1
              • hariH hari

                Things seem to work with the mega 2560 after realising that it has completely different SPI pins:

                pin D8-----------CE (chip enable in)
                SS pin D53----------CSN (chip select in)
                SCK pin D52----------SCK (SPI clock in)
                MOSI pin D51----------SDI (SPI Data in)
                MISO pin D50----------SDO (SPI data out)

                In the sketch I use this:
                Gateway gw(8, 53, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);

                Dunno why the pro mini 5V is not working, but as I'm able to talk to a sensor already I probably won't dig further into that..

                2;0;1;0;26.1

                hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #7

                @hari

                Good to see you've had some progress.

                1 Reply Last reply
                0
                • hariH hari

                  Things seem to work with the mega 2560 after realising that it has completely different SPI pins:

                  pin D8-----------CE (chip enable in)
                  SS pin D53----------CSN (chip select in)
                  SCK pin D52----------SCK (SPI clock in)
                  MOSI pin D51----------SDI (SPI Data in)
                  MISO pin D50----------SDO (SPI data out)

                  In the sketch I use this:
                  Gateway gw(8, 53, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);

                  Dunno why the pro mini 5V is not working, but as I'm able to talk to a sensor already I probably won't dig further into that..

                  2;0;1;0;26.1

                  petewillP Offline
                  petewillP Offline
                  petewill
                  Admin
                  wrote on last edited by
                  #8

                  @hari

                  I'm also trying to use a Mega as a node (not gateway) do you have any suggestions for that? I tried connecting the pins as you suggested above but it didn't work. I am still going to do some research but I thought I'd reach out to see if you (or anyone else) has already done this so I don't have to recreate the wheel.

                  Thanks,

                  Pete

                  My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                  marceltrapmanM 1 Reply Last reply
                  0
                  • petewillP petewill

                    @hari

                    I'm also trying to use a Mega as a node (not gateway) do you have any suggestions for that? I tried connecting the pins as you suggested above but it didn't work. I am still going to do some research but I thought I'd reach out to see if you (or anyone else) has already done this so I don't have to recreate the wheel.

                    Thanks,

                    Pete

                    marceltrapmanM Offline
                    marceltrapmanM Offline
                    marceltrapman
                    Mod
                    wrote on last edited by
                    #9

                    @petewill My problem with the uno's is that they are not (at) all sufficiently powered on the 3.3v pin. Very odd but if I were you I would test that first Pete...

                    Fulltime Servoy Developer
                    Parttime Moderator MySensors board

                    I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                    I have a FABtotum to print cases.

                    petewillP 1 Reply Last reply
                    0
                    • marceltrapmanM marceltrapman

                      @petewill My problem with the uno's is that they are not (at) all sufficiently powered on the 3.3v pin. Very odd but if I were you I would test that first Pete...

                      petewillP Offline
                      petewillP Offline
                      petewill
                      Admin
                      wrote on last edited by
                      #10

                      @marceltrapman Interesting. I'll test that tonight when I get home. Thanks!

                      My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                      1 Reply Last reply
                      0
                      • petewillP Offline
                        petewillP Offline
                        petewill
                        Admin
                        wrote on last edited by
                        #11

                        Got it to work! Not sure exactly what the problem was because it sort of started working by accident. I think it was either a bad connection between the radio and the Mega or else it had to do with the initial start up of the Mega or radio taking too long. Not sure if that's even possible but what seemed to fix it is starting the serial monitor (in the Arduino IDE). That seemed to reset the code but not the power. As soon as I did that the messages changed from saying a "relay not found" to this:

                        Started sensor.
                        Relay=0, distance=1
                        No radio id found in EEPROM fetching one from sensor net gateway
                        Relaying message back to gateway.
                        Tx: fr=255,to=0,la=255,ne=0,ci=255,mt=4,ty=5,cr=136: 
                        Ack: received OK
                        Message available on pipe 1
                        Sent ack msg to 0
                        Rx: fr=0,to=255,la=0,ci=255,mt=4,t=5,cr=199(ok): 12
                        Message addressed for this node.
                        Radio id received: 12
                        Radio id stored in EEPROM was: 12
                        Relaying message back to gateway.
                        Tx: fr=12,to=0,la=12,ne=0,ci=255,mt=0,ty=17,cr=30: 1.3b3 (960efcd)
                        Ack: received OK
                        Relaying message back to gateway.
                        Tx: fr=12,to=0,la=12,ne=0,ci=255,mt=4,ty=7,cr=218: 0
                        Ack: received OK
                        Relaying message back to gateway.
                        Tx: fr=12,to=0,la=12,ne=0,ci=3,mt=0,ty=1,cr=194: 1.3b3 (960efcd)
                        Ack: received OK
                        Relaying message back to gateway.
                        Tx: fr=12,to=0,la=12,ne=0,ci=3,mt=1,ty=16,cr=63: 1
                        Ack: received OK
                        

                        Once I got these messages I just started the Inclusion on the Vera side of things and closed/opened the serial monitor again and it found my sensors!

                        My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          tortoisedoc
                          wrote on last edited by tortoisedoc
                          #12

                          @hek : it happens that I have currently the same setup (3.3v mini pro as serial gw via FTDI); and am suffering from exactly the same symptoms (no reaction when I push commands to the GW). Reception, however, is ok. I plan to add a capacitor for the ripple; but given incoming reception is ok, I doubt it will make a difference?
                          Needless to say that uploading the sketch works fine, and that upon writing the TX led flimmers.

                          EDIT : nevermind, solved.

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