help newbie: MEGA2560 + Ethernet Shield = always fails



  • I am truing to build an MQTT gateway with Arduino Mega2560 and Ethernet Shield (based on W5100 chip, like http://arduino.cc/en/Main/ArduinoEthernetShield). I am trying to follow instructions from the manual and this forum? But nothing works. I keep getting the dreaded "0;0;3;0;9;check wires" message.
    Arduino, nrf24l01 and Ethernet Shield modules work separately OK.

    Please help and share a working wiring for Mega + Ethernet shield as well as any necessary edits to the configs.
    Thank you!



  • I am a bit of a noob still on this forum , but I had the same yesterday with a nano, checked the wires a dosen times , und when I put another nano on the breadbord it was working fine . Someone pointed out to clear the eprom. That worked for me. Maybe for you as well.

    Good luck ,
    Cor


  • Hero Member

    Did you wire the radio correctly. The mega needs the PINS 50, 51, 52 to be connected to the radio
    see wiring in:
    http://forum.mysensors.org/topic/949/sensor-for-vallox-digitse-rs485-ventilation-system-with-integration-into-fhem/3



  • Heinz and Corvl, thank you for the suggestions. I am still struggling though.
    I connected wires as recommended by Heinz
    In the Gateway code I have:
    #define RADIO_CE_PIN 3 // radio chip enable
    #define RADIO_SPI_SS_PIN 4 // radio SPI serial select

    In RF_24config I have:
    #define SOFTSPI //uncommented
    const uint8_t SOFT_SPI_MISO_PIN = 50; //was 16
    const uint8_t SOFT_SPI_MOSI_PIN = 51; //was 15
    const uint8_t SOFT_SPI_SCK_PIN = 52; //was 14

    DigitalIO library installed. Tried replacing Arduino Mega board and radio module. Tried external power source.
    Yet I still get the dreaded “0;0;3;0;9;check wires” message.

    Could someone please share a piece of working gateway code together with wiring instructions for Ethernet gateway with Mega 2560 + W5100 Ethernet Shield + nrf2401?



  • I'm working with a Mega 2560 and ethernet shield. I needed to change the pins in the RF24_config.h file to get it to work.

    This is from my RF24_config.h

     #elif defined SOFTSPI
    	  // change these pins to your liking
          //
          const uint8_t SOFT_SPI_MISO_PIN = A2; 
          const uint8_t SOFT_SPI_MOSI_PIN = A1; 
          const uint8_t SOFT_SPI_SCK_PIN = A0;  
          const uint8_t SPI_MODE = 0;
          #define _SPI spi
    

    And this is my gateway code


  • Hero Member

    Hi ruslan, sorry for delay.
    I am not sure but I think I did not change anything in RF_Config.h but found out that the radio needs to be connected to those pins 50, 51, 52. Have a look at the mega pinout sheet. It tells you that 50=miso, 51=mosi, 52=sck. So I connected the radio to those pins and it worked. That configuration runs on a sensor without ethernet shield. I believe that it has nothing to do with the shield but more with that special mega pinout.
    Could you simply remove the shield, attach the radio and download a sensor sketch to make sure that the mega and the radio work together. After that step attach the shield and try again with a gateway sketch.


Log in to reply
 

Suggested Topics

  • 87
  • 3
  • 5
  • 1
  • 6
  • 8

53
Online

11.4k
Users

11.1k
Topics

112.6k
Posts