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. Uno+ethernet shield = radio init fail [solved]

Uno+ethernet shield = radio init fail [solved]

Scheduled Pinned Locked Moved Troubleshooting
23 Posts 8 Posters 17.1k Views 1 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.
  • TD22057T Offline
    TD22057T Offline
    TD22057
    Hardware Contributor
    wrote on last edited by TD22057
    #1

    Using IDE 1.6.5, MySensors 1.5, building on Windows 7 (64 bit). Started w/ an Uno and built the serial gateway (with a capacitor on the radio power lines). That worked fine (debug messages report success in the IDE serial window). Then I added an Arduino W5100 ethernet shield (plugging it into the uno). I changed the wires to match the WizNet instructions, uncommented SOFTSPI, and I get this message in the serial window:

    0;0;3;0;9;radio init fail

    I double checked all the wires (and I'm using the same patch cords I used for the serial gateway). I also added an external power supply to the uno barrel connection to see if that would help. But I'm still getting radio init failed. If I plug in a network cable, I can ping the arduino successfully so it seems like the ethernet shield is working.

    Any ideas what I should try next? Given that the radio and wires work fine in serial mode, I'm thinking my wiring is wrong but I've tripled checked it and don't see anything. Any help would be greatly appreciated...

    Here's the links to the hardware I bought:
    http://www.aliexpress.com/item/Free-shipping-UNO-R3-MEGA328P-for-Arduino-Compatible-with-USB-cable-and-9V-battery-clip-snap/1960648380.html
    http://www.aliexpress.com/item/UNO-Shield-Ethernet-Shield-W5100-R3-UNO-Mega-2560-1280-328-UNR-R3-only-W5100-Development/674888225.html

    1 Reply Last reply
    0
    • ch3b7C Offline
      ch3b7C Offline
      ch3b7
      wrote on last edited by
      #2

      I have the same problem!! I think is a problem with the new library!! With the 1.4.2 works good!!

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

        Did you uncomment SOFTSPI in MyConfig.h which is the correct place now?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mhson
          wrote on last edited by
          #4

          I have the same setup and tried yesterday to get things working with a constant "0;0;3;0;9;radio init fail" error.

          This morning I switched to 1.4.2 and I can confirm that with no other changes I now get "0;0;3;0;14;Gateway startup complete."

          Just to clarify, in 1.5 I did define SOFTSPI in MyConfig.h and in 1.4.2 I did it in RF24_config.h.

          Regards Martin

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

            Strange. Nothing obvious pops up in my head which could affect this. Only a small modification to the RF24_config.h was done (to fetch the settings from MyConfig.h).

            Guess you've checked that RADIO_CE_PIN and RADIO_SPI_SS_PIN in sketch is correct?

            Could need some help to resolve this issue from people using the same hardware.

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

              Oh.. someone already created an issue on github!

              This is probably the issue you're seeing.

              MySensors/Arduino#146

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

                Could someone try the updated ethernet-sketch?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mhson
                  wrote on last edited by
                  #8

                  Good work!

                  I have to admit, this is my first dive into this project so my knowledge is VERY limited. But my gateway says: "0;0;3;0;9;gateway started, id=0, parent=0, distance=0" so I guess its happy now!

                  Thank you!

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

                    Excellent! Updated code works for me as well. Thanks for the quick response everyone (and I've learned to go check github for issues as well).

                    Is there any reason the SOFTSPI flag can't be moved into the sketch as well? I'm assuming as long as it's defined before the include that gets to RF24, it will be OK. That way all the mods for different configs are in the sketch and it would eliminate having to remember to edit/compile/undo before building sensors. Any opinions?

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

                      @TD22057

                      Because defines declared in the sketch isn't visible in the cpp files. The Arduino build system isn't exactly the best on the planet.

                      TD22057T 1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        diggs
                        wrote on last edited by
                        #11

                        Hi all, I am about to try this as well as I have the same setup with the etehrnet shiled, but I don't really understand the wiring instructions. As the Ethernet shield is fixed on the board what does it mean by connecting MISO/SO to pin 12 and MOSI/SI to pin 11 etc?

                        Apologies if this is a silly question

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

                          @diggs The instructions are for a general ethernet board - those are the pins it's using. If you use the ethernet shield, the connections are made in the shield, you just need to connect the radio up. If you're not using a shield, you have to make those connections yourself.

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            diggs
                            wrote on last edited by
                            #13

                            @TD22057 Thanks for the reply. That would mean then the IRQ is not used with this setup then,

                            1 Reply Last reply
                            0
                            • B Offline
                              B Offline
                              brakc
                              wrote on last edited by
                              #14

                              Hello,

                              I get same message in the serial : 0;0;3;0;9;radio init fail

                              • IDE 1.6.4 on Yosemit

                              • MEGA2560

                              • Ethernet Shield W5100 (like this : https://www.arduino.cc/en/Guide/ArduinoEthernetShield)

                              • NRF24L01+ (1436AH)

                              • MySensors Arduino Library v1.5

                              • I uncommented #define SOFTSPI in MyConfig.h

                              // Enable SOFTSPI for NRF24L01 when using the W5100 Ethernet module
                              #define SOFTSPI
                              #ifdef SOFTSPI
                              	// Define the soft SPI pins used for NRF radio
                              	const uint8_t SOFT_SPI_MISO_PIN = 50;
                                  const uint8_t SOFT_SPI_MOSI_PIN = 51;
                                  const uint8_t SOFT_SPI_SCK_PIN = 52;
                              #endif
                              
                              • EthernetGateway.ino
                              #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
                              #define INCLUSION_MODE_PIN  3 // Digital pin used for inclusion mode button
                              
                              #define RADIO_CE_PIN        5  // radio chip enable
                              #define RADIO_SPI_SS_PIN    6  // radio SPI serial select
                              
                              #define RADIO_ERROR_LED_PIN 7  // Error led pin
                              #define RADIO_RX_LED_PIN    8  // Receive led pin
                              #define RADIO_TX_LED_PIN    9  // the PCB, on board LED
                              
                              // NRFRF24L01 radio driver (set low transmit power by default) 
                              MyTransportNRF24 transport(RADIO_CE_PIN, RADIO_SPI_SS_PIN, RF24_PA_LEVEL_GW);  
                              

                              CE & CSN pin are différents configuration in MyConfig.h & EthernetGateway.ino. Can I change this?

                              Other idea please?

                              ;-)

                              1 Reply Last reply
                              0
                              • Michael HritzM Offline
                                Michael HritzM Offline
                                Michael Hritz
                                wrote on last edited by
                                #15

                                I'm getting the same error with the serial gateway.using Arduino Nano, My Sensor 1.5 Arduino ide 1.6.5. I tried two different radio modules and an external 3.3 v supply no combination worked.

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

                                  this is probably an obvious question, but I'd rather insult your intelligence than silently let you make the same mistake I made for a while :-). On your hard drive, and I'm not sure how the second copy gets made (I didn't copy the library twice, or if I did, I was drunk when I did it :-)) , there are two copies of the libraries (and thus the config.h file). there is one in c:\program files(x86)\Arduino\libraries and one in your "My Documents"\Arduino\libraries (or wherever your "my docs" is).... it's the one in your "my docs" that counts. Make sure you are editing the right 'myconfig.h' file when you enable SOFT_SPI.

                                  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
                                  • TD22057T Offline
                                    TD22057T Offline
                                    TD22057
                                    Hardware Contributor
                                    wrote on last edited by
                                    #17

                                    This might be another obvious question, but I'll ask anyway: I see a lot of people saying they're using 1.5 but that version had the bug in it that I originally saw. Did you update directly from the git repository to get the fix? I'm not sure whether or not it's fixed if you download the 1.5 master.zip file.

                                    1 Reply Last reply
                                    0
                                    • Michael HritzM Offline
                                      Michael HritzM Offline
                                      Michael Hritz
                                      wrote on last edited by
                                      #18

                                      The libraries don't exist under My Documents in my case. I've traced the error back to the code that is causing it, but I don't know what to do about it. In the rf24.h file there is a section that attempts to determine if the rf24 is P variant. It is returning false on the method call rf24.isPvariant. The results of the Serial.println statements I put in the MyTransportNRF24.cpp code are below:

                                      Before rf24.begin in MyTransportNRF24
                                      after rf24.begin in MyTransportNRF24
                                      !rf24.isPVariant() in MyTransportNRF24

                                      0;0;3;0;9;radio init fail

                                      Here are the lines in the v1.5 rf24.h that I think are causing the problem.

                                      Lines 347-351
                                      RF24::RF24(uint8_t _cepin, uint8_t _cspin):
                                      ce_pin(_cepin), csn_pin(_cspin), p_variant(false),
                                      payload_size(32), dynamic_payloads_enabled(false), addr_width(5)//,pipe0_reading_address(0)
                                      {
                                      }

                                      Lines 480-488
                                      // Determine if this is a p or non-p RF24 module and then
                                      // reset our data rate back to default value. This works
                                      // because a non-P variant won't allow the data rate to
                                      // be set to 250Kbps.
                                      if( setDataRate( RF24_250KBPS ) )
                                      {
                                      p_variant = true ;
                                      }

                                      I'll try and copy over the v1.4 version of these files and see if they work.

                                      1 Reply Last reply
                                      0
                                      • Michael HritzM Offline
                                        Michael HritzM Offline
                                        Michael Hritz
                                        wrote on last edited by
                                        #19

                                        Well, I've completely started from scratch. Latest Arduino IDE, v1.4.2 of MySensors library. Had to copy several *.h files from version 1.5 to C:\Users\mike\Documents\Arduino\libraries\MySensors to get past all the include statements in the compiler. Now the compiler is throwing a lot of error messages (you can peruse them below). This system looked pretty good on their web site, maybe it was too good to be true. I'm trying to get the Gateway.ino sketch to compile. I downloaded it from github. I'll just sit this out and see what the Cognoscenti come up with.

                                        In file included from C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:12:0:
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.h:39:28: error: 'DEFAULT_CE_PIN' was not declared in this scope
                                        MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, int8_t _inclusion_pin=-1, int8_t _rx=-1, int8_t _tx=-1, int8_t _er=-1);
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.h:39:59: error: 'DEFAULT_CS_PIN' was not declared in this scope
                                        MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, int8_t _inclusion_pin=-1, int8_t _rx=-1, int8_t _tx=-1, int8_t _er=-1);
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp: In constructor 'MyGateway::MyGateway(uint8_t, uint8_t, uint8_t, int8_t, int8_t, int8_t, int8_t)':
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:30:163: error: no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)'
                                        MyGateway::MyGateway(uint8_t _cepin, uint8_t _cspin, uint8_t _inclusion_time, int8_t _inclusion_pin, int8_t _rx, int8_t _tx, int8_t _er) : MySensor(_cepin, _cspin) {
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:30:163: note: candidates are:
                                        In file included from C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.h:15:0,
                                        from C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:12:
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MySensor.h:153:2: note: MySensor::MySensor(MyTransport&, MyHw&)
                                        MySensor(MyTransport &radio =new MyTransportNRF24(), MyHw &hw=new MyHwDriver()
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MySensor.h:153:2: note: no known conversion for argument 1 from 'uint8_t {aka unsigned char}' to 'MyTransport&'
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MySensor.h:144:7: note: MySensor::MySensor(const MySensor&)
                                        class MySensor
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MySensor.h:144:7: note: candidate expects 1 argument, 2 provided
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp: In member function 'void MyGateway::begin(rf24_pa_dbm_e, uint8_t, rf24_datarate_e, void (
                                        )(char
                                        ))':
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:44:20: error: 'setupRepeaterMode' was not declared in this scope
                                        setupRepeaterMode();
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:87:39: error: 'setupRadio' was not declared in this scope
                                        setupRadio(paLevel, channel, dataRate);
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:88:36: error: 'BASE_RADIO_ID' was not declared in this scope
                                        RF24::openReadingPipe(WRITE_PIPE, BASE_RADIO_ID);
                                        ^
                                        C:\Users\mike\Documents\Arduino\libraries\MySensors\MyGateway.cpp:90:23: error: cannot call member function 'void RF24::startListening()' without object
                                        RF24::startListening();
                                        ^
                                        Error compiling.

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

                                          @Michael-Hritz I don't think you're going to be able to copy headers from 1.5 into 1.x and ever get that to work - that's why they are different versions.

                                          Did you sync via github instead of downloading the 1.5 zip? Then edit the IDE sketchbook location preferences to point at the downloaded files and compile. I just tried that with the ethernet sketch and it built with only a couple of warnings.

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


                                          18

                                          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