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. Raspberry Pi Zero W gateway + NRF24L01+ Radio + MQTT - Radio failing

Raspberry Pi Zero W gateway + NRF24L01+ Radio + MQTT - Radio failing

Scheduled Pinned Locked Moved Troubleshooting
8 Posts 4 Posters 340 Views 4 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.
  • M Offline
    M Offline
    mioim
    wrote on last edited by
    #1

    Hi guys

    I am setting up a RasPi Zero W gateway running an eclipse-mosquitto docker image and radio via a NRF24L01+ module but MySensors' debug logs keeps showing fails:

    DEBUG TSM:FAIL:RE-INIT
    DEBUG TSM:INIT
    DEBUG !TSM:INIT:TSP FAIL
    DEBUG TSM:FAIL:CNT=1
    DEBUG TSM:FAIL:DIS
    DEBUG TSF:TDI:TSL
    

    The MQTT broker seems to work fine, I am able to send and receive messages from another device.

    The NRF24 is connected to the RasPi via pins 17, 19-24 as described in https://www.mysensors.org/build/raspberry#improving-throughput-for-nrf24. A capacitor is connected between VCC and GND.

    This is the configuration I am using:

    pi@raspberrypi:~/MySensors $ sudo ./configure --my-transport=rf24 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
    

    It returns no errors. 'sudo make' also shows no errors. I'm running it with 'sudo ./bin/mysgw'

    I have tried with three NRF24 modules but same results.

    Any idea of what I am missing?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mioim
      wrote on last edited by
      #2

      Found a wiring diagram in the sellers website slightly different to the one above, but still failing. (diagram)

      :white_frowning_face:

      1 Reply Last reply
      0
      • NeverDieN Offline
        NeverDieN Offline
        NeverDie
        Hero Member
        wrote on last edited by NeverDie
        #3

        You may have to logic probe it. Short of that, maybe check the schematic for the pi-zero-W to see whether anything else (perhaps the wi-fi?) might be using the same SPI chip select pin? Also, not all hardware plays nice with SPI (the famous Arduino ethernet example), so sometimes sharing SPI doesn't work because of the way one of the SPI devices was poorly implemented.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          waspie
          wrote on last edited by
          #4

          try another radio? My gateway is a Pi Zero W and works fine so there's no reason it shouldn't work for you.

          1 Reply Last reply
          2
          • MGHaffM Offline
            MGHaffM Offline
            MGHaff
            wrote on last edited by
            #5

            In your configuration try leaving the "--my-controller-ip-address=127.0.0.1" out of configuration. Another thing to try is to power the radio connected to the pi by a separate 3.3v power supply. also when i built my first controller/gateway i spent 2 days trying to figure out why it didn't work when in the end it was a bad jumper wire. Unhook everything and double check your wiring. Hope something helps! :)

            1 Reply Last reply
            1
            • M Offline
              M Offline
              mioim
              wrote on last edited by
              #6

              Thank you, guys. I have ordered another 3 rf24 from another shop, let's see how they perform. I will also verify all the connections.

              The radio modules may be the issue, as I have done a emitter/receiver test with them on a UNO and a RF-NANO (a NANO and a NRF24L01+ in the same module) and never worked out, but when using the same sketches on 2 RF-NANOs they worked fine.

              As a plan B I am trying to use one of these RF-NANO as the gateway, connecting a W5500 ethernet module. I still have to try this (I have just received the W5500 today) but I already have a question: The diagram and sketch for the W5100 ethernet gateway shows that the NRF24L01+ uses pins 5, 6, A0, A1 and A2, as the 'usual' pins 10, 11, 12 and 13 are used by the W5100. In the RF-NANO, the radio is already connected to pins 9 to 13.

              Do you know how I can reallocate all pins in the sketch to match my setting?

              NeverDieN 1 Reply Last reply
              0
              • M mioim

                Thank you, guys. I have ordered another 3 rf24 from another shop, let's see how they perform. I will also verify all the connections.

                The radio modules may be the issue, as I have done a emitter/receiver test with them on a UNO and a RF-NANO (a NANO and a NRF24L01+ in the same module) and never worked out, but when using the same sketches on 2 RF-NANOs they worked fine.

                As a plan B I am trying to use one of these RF-NANO as the gateway, connecting a W5500 ethernet module. I still have to try this (I have just received the W5500 today) but I already have a question: The diagram and sketch for the W5100 ethernet gateway shows that the NRF24L01+ uses pins 5, 6, A0, A1 and A2, as the 'usual' pins 10, 11, 12 and 13 are used by the W5100. In the RF-NANO, the radio is already connected to pins 9 to 13.

                Do you know how I can reallocate all pins in the sketch to match my setting?

                NeverDieN Offline
                NeverDieN Offline
                NeverDie
                Hero Member
                wrote on last edited by
                #7

                @mioim Only the chip select pin needs to be different.

                M 1 Reply Last reply
                0
                • NeverDieN NeverDie

                  @mioim Only the chip select pin needs to be different.

                  M Offline
                  M Offline
                  mioim
                  wrote on last edited by
                  #8

                  For plan A (Raspi gateway) I am still waiting for the new radio modules. I'm not scrapping this plan yet...

                  Regarding plan B (ethernet gateway), I am still confused regarding which pins to use and how to make it in the sketch:

                  0_1573035936647_9b5536d2-b03a-4006-a9d0-76be91d841a5-image.png

                  On the left are the pins used in the Ethernet Gateway page, with a nano, a W5100 and the NRF24L01+ radio. Also, the MY_RF24 and MY_SOFT_SPI commands in the original sketch.

                  On the right, the RF-NANO, W5500 and the NRF24L01+ radio I am trying to use. The pins of the radio are fixed, as both are in the same module:

                  0_1573037434755_93afe9f7-f4e6-4071-8ba6-c4d1d93a9bd3-image.png

                  Is the following correct?

                  • (#1) the MY_RF24_CS_PIN is now pin 9 while MY_RF24_CE_PIN is the default one of the nano (pin 10, SS?) so it can be ommited (?).

                  • (#2) the W5500 pins are the ones that have to be moved now. MISO, MOSI and SCK are going to pins 16, 15 and 14 with MY_SOFT_SPI (I am assuming the W5500 supports software SPI, I read yesterday that not all modules do)

                  • (#3) where and how goes the SS pin of the W5500??? MY_SOFT_SPI_CE_PIN exists? Is this what you mean with your comment, @neverdie?

                  All this is really exciting, but I still have a lot to learn. Apologies again for the 'dumb' questions...

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


                  13

                  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