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. Ethernet Gateway - Radio Init Fail

Ethernet Gateway - Radio Init Fail

Scheduled Pinned Locked Moved Troubleshooting
12 Posts 3 Posters 4.7k Views 2 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.
  • stevebusS stevebus

    HI,

    I'm just putting together my first mysensors project. I'm starting with the gateway first and trying to put together an Ethernet gateway. Here are the specifics and troubleshooting I've done.

    Platform -> Arduino Uno R3
    Ethernet Shield -> full sized Ethernet shield based on ENC28J60 chip
    Radio -> NRF24L01+PA+LNA (but have also tried just the plain NRF24L01+ smaller version with same results)

    • CSN to pin 6
    • CE to pin 5
    • MOSI to pin 11
    • SCK to pin 13
    • MISO to pin 12

    Operating System - Windows 10 (fresh install last Thursday)
    Arduino IDE: 1.6.5 (freshly installed today)
    MySensors libraries -> 1.5 (freshly pulled today from master branch)
    Radio powered from 3.3V output on Arduino
    100uF "can" capacitor across VCC and GND on radio (because it's the only size I had... same results with or without it)
    everything powered by USB cable from my computer (so I can troubleshoot via serial monitor)
    I have TX, RX, and ERROR LEDs connected between 5V rail from Arduino and 220Ohm resistor to ground

    Steps I've done
    I've updated EthernetGateway.ino to account for the ENC28J60 chip instead of Wiznet per the comments (i.e. UIPEthernet, etc)
    I've uncommented WITH_LEDS_BLINKING in MyConfig.h
    compiled and uploaded to Uno

    in the serial monitor, I get "0;0;3;0;9;radio init fail"

    I put in some Serial.println's to find out where it is failing, and it is failing in the call to rf24.isPVariant() in MyTransportNFR24.cpp

    if (!rf24.isPVariant()) {
    return false;
    }

    the call to isPVariant is returning false, and the code just bails at that point (falls out to a while(1)). looks like the p_variant variable is set as a result of the call to SetDataRate in rf24.cpp... So it looks like the code is failing to set the data rate (and maybe other config params) on the radio for some reason. I tried it with both the antennae and non-antennae versions of the radio with the same results.

    That's where my troubleshooting capabilities start to run out :disappointed:

    Any further ideas?

    stevebusS Offline
    stevebusS Offline
    stevebus
    wrote on last edited by
    #2

    @stevebus Meant to add a couple more details

    • this is all on a breadboard at the moment. prototyping before soldering it all via PCB
    • LEDs are connected to pins 7, 8, and 9
    • I get the same results in the serial monitor if I unplug VCC and GND for the radio!!.. Is this the first place in the code that we try to talk to the radio?? (not having a step debugger stinks :-) )

    Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

    Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

    SparkmanS 1 Reply Last reply
    0
    • stevebusS stevebus

      @stevebus Meant to add a couple more details

      • this is all on a breadboard at the moment. prototyping before soldering it all via PCB
      • LEDs are connected to pins 7, 8, and 9
      • I get the same results in the serial monitor if I unplug VCC and GND for the radio!!.. Is this the first place in the code that we try to talk to the radio?? (not having a step debugger stinks :-) )
      SparkmanS Offline
      SparkmanS Offline
      Sparkman
      Hero Member
      wrote on last edited by Sparkman
      #3

      @stevebus The Ethernet shield does not play nice on the SPI bus, so it's having problems talking to the radio. You need to move the radio to different pins and enable SoftSPI. Search the board for details on that. As a quick test, set up a serial gateway first with the radio on the pins you are currently using and if that works, you know the radio is good.

      Cheers
      Al

      1 Reply Last reply
      0
      • stevebusS Offline
        stevebusS Offline
        stevebus
        wrote on last edited by
        #4

        Thanks for the response...

        From the gateway wiring guidance page, I thought the SPI issue was only with the Wiznet based Ethernet shield. Is that not the case?

        I'll give the SoftSPI route a try. Thx for the quick response.

        Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

        Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

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

          The ENC module usually works without SOFTSPI.. But it is really tight to get it in on the ATMega328.

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

            You might have picked up a none+ variant of the NRF24 module which doesn't support the 250kbs transfer speed.

            You might get around this by increasing speed to 1mbps in MyConfig.h and remove the sanity check in MySensors library.

            1 Reply Last reply
            0
            • hekH hek

              The ENC module usually works without SOFTSPI.. But it is really tight to get it in on the ATMega328.

              SparkmanS Offline
              SparkmanS Offline
              Sparkman
              Hero Member
              wrote on last edited by
              #7

              @hek said:

              The ENC module usually works without SOFTSPI.. But it is really tight to get it in on the ATMega328.

              Thanks for the clarification!

              Cheers
              Al

              1 Reply Last reply
              0
              • stevebusS Offline
                stevebusS Offline
                stevebus
                wrote on last edited by
                #8

                thanks for the clarification and help, guys.. You guys rock with the quick responses! (and Mysensors in general is friggin' awesome!)

                I moved the wires and enabled SoftSPI and got further than I was. I managed to get to the hallowed "gateway started" message, but got gobbledygook for the st param.. this is what got printed..

                0;0;3;0;9;gateway started, id=0, parent=0, distance=0
                c=327,t=310,pt=288,l=273,sg=631,st=»:qmjëlVúšÚö�iÿïs0¼�÷ïÜžºKmýÏO»rgædöûå=_ošóÕëÖÌ›§2ŒT†—<÷¿Îºô}~Bõò>,{÷5/

                does that look right? or an issue? what does a 'working' gateway look like (without yet having any sensors or connecting to Vera)? Should I be able to ping it? (I can't) Should I be able to telnet to port 5003? (I can't)

                Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

                Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

                1 Reply Last reply
                0
                • stevebusS Offline
                  stevebusS Offline
                  stevebus
                  wrote on last edited by
                  #9

                  disregard the note above about not being able to ping or telnet to the gateway... that was user error :-)...

                  the question still remains about the gobbledygook in the st param of the 'gateway started' message. is that legit?

                  Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

                  Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

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

                    "gateway started" is a good message :)

                    But gobbelgoo is not good.

                    1 Reply Last reply
                    0
                    • stevebusS Offline
                      stevebusS Offline
                      stevebus
                      wrote on last edited by
                      #11

                      Ok... update... I had some debug code in there from when I was trying to find out where the initialization was failing, and I think I introduced a bug... I removed my code and re-ran and got this:

                      0;0;3;0;9;gateway started, id=0, parent=0, distance=0

                      that looks good :-)...

                      thanks for the help guys!

                      Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

                      Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

                      SparkmanS 1 Reply Last reply
                      0
                      • stevebusS stevebus

                        Ok... update... I had some debug code in there from when I was trying to find out where the initialization was failing, and I think I introduced a bug... I removed my code and re-ran and got this:

                        0;0;3;0;9;gateway started, id=0, parent=0, distance=0

                        that looks good :-)...

                        thanks for the help guys!

                        SparkmanS Offline
                        SparkmanS Offline
                        Sparkman
                        Hero Member
                        wrote on last edited by
                        #12

                        @stevebus Glad to hear you got it working!

                        Cheers
                        Al

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


                        21

                        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