MQTT Gateway to Sensor communication problem



  • I have an Arduino UNO with W5100 Ethernet Shield and NRF24L01+ configured as a MQTT Gateway and I can communicate with the MQTT Broker. However, I cannot communicate (via the radio) with a humidity sensor.

    Debugging is turned on in MyConfig.h
    I have tried multiple NRF24L01+
    I have tried powering the gateway NRF24L01+ from another arduino uno (just using it as a power supply and connecting the grounds of the 2 boards).
    I suspect I have a mismatch between the wiring and the software, but I am new to this and nothing I have found by searching the forums as led me to a solution.
    Please help.


    For the MQTT Gateway,
    The NRF24L01+ is wired through the Ethernet shield to the UNO as follows:
    GND to GND
    VCC to 3V3
    CE to 5
    CSN to 6
    MOSI to A1
    MISO to A2
    SCK to A0
    IRQ not connected


    The defines in MQTTGateway.ino are as follows:
    #define RADIO_CE_PIN 5 // radio chip enable
    #define RADIO_SPI_SS_PIN 6 // radio SPI serial select
    #define RADIO_ERROR_LED_PIN A2 // Error led pin
    #define RADIO_RX_LED_PIN A1 // Receive led pin
    #define RADIO_TX_LED_PIN A0 // the PCB, on board LED */


    The relevant parts in RF24_config.h as follows:
    #define SOFTSPI // Requires library from https://github.com/greiman/DigitalIO
    const uint8_t SOFT_SPI_MISO_PIN = 16;
    const uint8_t SOFT_SPI_MOSI_PIN = 15;
    const uint8_t SOFT_SPI_SCK_PIN = 14;


    When I start the gateway, I get the following output:

    Started!
    0;0;3;0;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
    0;0;3;0;9;version mismatch
    0;0;3;0;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
    0;0;3;0;9;version mismatch
    0;0;3;0;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
    0;0;3;0;9;version mismatch


    When I start a humidity sensor which is wired (triple checked) and programmed per the instructions, I get the following serial output:

    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    sensor started, id 255
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    T: 20.00
    req node id
    send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
    H: 34.00




  • @Brian787
    If I were you I would check if you have the nrf24l01+version. I got some nrf24l01 radio's via Alice (although Alice sells them as nrf24l01+) and experience the same problem. Look at the square chip on the radio module. It should have the +sign on it!

    My problem with the gateway is solved once I exchanged the non-plus version with a plus version.



  • What version are you using. The current MQTT gateway code states:

    #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*/

    This works for me (sorry for the large font size, came from cut-and-paste from the Arduino code and I have found no way of changing it.)


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 8
  • 5
  • 6

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts