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. My rPi gateway suddenly stopped working, no idea what else to try...

My rPi gateway suddenly stopped working, no idea what else to try...

Scheduled Pinned Locked Moved Troubleshooting
20 Posts 5 Posters 143 Views 5 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.
  • F frapell

    @skywatch I found a way to enable flags to get more debug info both for the RFM69 as for the Transport HAL in order to try and get more info on what the software see when it is broken, and the thing has been working fine for 2 days straight now... Go figure... So I am wondering (Attaching the custom PCB design below):

    63d0e746-51bf-41fa-ab4b-1b774f39c3f9-image.png

    Some questions:

    1. I have highlighted the via for the antenna, could it be too long and it was maybe picking up some interference? I am thinking on moving the RFM69 module to be up there, as close as possible to the SMA connector as possible...

    2. What do you think about the via thickness? should I make it wider? it is 0.4mm right now

    3. Is it ok that the 4 corners for the SMA connector are connected to GND? I believe it is ok, right?

    skywatchS Offline
    skywatchS Offline
    skywatch
    wrote on last edited by
    #11

    @frapell If you can, get some small coax cable for wifi use and use that instead of the track on the PCB- Make sure it is grounded at the sending end - As for the power, I strongly suggest making a 5v to 3.3V regulator as the pi 3.3v can be quite 'noisey' - a buck regulater will help reduve this a lot. Don't forget capacitors on the input and output of the neg board. I did this for my pi set up too as it has the advantage of the radio getting power from the psu and not cia the pi. A linear regulator like the AMS1117 will do the trick.

    1 Reply Last reply
    0
    • E ejlane

      Just a warning upfront - I'm an engineer, but not an RF engineer, so I do see some things, but I'm almost guaranteed to miss others.

      As far as your highlighted line, it is a trace, but not a via. A via connects the trace on one plane of copper with a trace on another plane.

      That trace should really be as short and direct as possible. Wrapping around the back of the module and along other signal lines is not a good idea. I see that the closest line to it is 3.3V power, so that acts basically as ground for small signal, but any power spike is bound to couple into the antenna line as well, at least some. If possible, it would be best to have ground on both sides of the antenna trace on that side of the board, as well as the whole surface on the other side of the board from it. Might also want to guard it by having vias connect the ground planes on either side of it to make kind of a 3d cage around it.

      Additionally, you should try for 50 ohm trace impedance on the antenna line. However, there is no one-size-fits-all answer for the width of this line. It depends on the exact board parameters, and even to a small amount on the frequency of the signal. There are trace width impedance calculators that you can use to get this answer. https://resources.pcb.cadence.com/blog/2019-just-how-wide-should-a-pcb-50-ohm-trace-width-be

      Almost guaranteed that it's correct to ground those 4 outer pins of the antenna connector. View the datasheet of the specific connector you are using to be 100% sure.

      F Offline
      F Offline
      frapell
      wrote on last edited by
      #12

      @ejlane Well, I am a software developer myself (Not engineer, and certainly not RF engineer) And by looking at my design it is clear that I can barely consider myself an electronic hobbyist :sweat_smile:

      Thanks a lot for your suggestions, This is a very basic one-sided PCB I designed in order to avoid having wires, which I thought was worse... I will redesign the whole thing and will post back (If you have more suggestions, I will be more than pleased to know)

      @skywatch I am trying to make this as simple as possible, and to be able to fit inside a rPi case, so I will try to get the trace as short as possible between the module and the SMA for now, and see how it goes. As per your AMS1117 suggestion, I am assuming you mean instead of getting 3.3v pin from the GPIO, use the 5V one and go through an AMS1117 to get 3.3v, right? Also, about the capacitor, may I ask what exactly is the "neg board" ?

      skywatchS 1 Reply Last reply
      0
      • F frapell

        @ejlane Well, I am a software developer myself (Not engineer, and certainly not RF engineer) And by looking at my design it is clear that I can barely consider myself an electronic hobbyist :sweat_smile:

        Thanks a lot for your suggestions, This is a very basic one-sided PCB I designed in order to avoid having wires, which I thought was worse... I will redesign the whole thing and will post back (If you have more suggestions, I will be more than pleased to know)

        @skywatch I am trying to make this as simple as possible, and to be able to fit inside a rPi case, so I will try to get the trace as short as possible between the module and the SMA for now, and see how it goes. As per your AMS1117 suggestion, I am assuming you mean instead of getting 3.3v pin from the GPIO, use the 5V one and go through an AMS1117 to get 3.3v, right? Also, about the capacitor, may I ask what exactly is the "neg board" ?

        skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #13

        @frapell neg board should have been reg board (as in the regulator to go from 5 to 3.3V - When I did this a lot of issues I had went away. Take the 5V supply from the power supply input to the raspberry pi board. This means any current surge will be provided by the power supply and not from the pi itselff. I hope that makes sense.

        F 1 Reply Last reply
        0
        • skywatchS skywatch

          @frapell neg board should have been reg board (as in the regulator to go from 5 to 3.3V - When I did this a lot of issues I had went away. Take the 5V supply from the power supply input to the raspberry pi board. This means any current surge will be provided by the power supply and not from the pi itselff. I hope that makes sense.

          F Offline
          F Offline
          frapell
          wrote on last edited by
          #14

          @skywatch Ahhh, makes sense now :) thanks!

          @ejlane I got the specifications from the PCB manufacturer (Attaching below), and the copper thickness is 35 microns...
          I managed to get the module with the antenna pin right next to the connector, so the trace length would be just 4mm, for what I was able to find, my case for a single sided PCB would be a "Coplanar wave guide" and plugging all of those values in a calculator I found in KiCAD, it seems that I am fine with a 1 mm wide trace, with a 0.25mm gap with the GND around it.

          Hope I got it right! Thank you for your suggestions!

          157a2ebe-df2f-48f2-aec1-faae8cad1b13-image.png

          1 Reply Last reply
          1
          • E Offline
            E Offline
            ejlane
            wrote on last edited by
            #15

            I think your numbers look good. Nice job getting the trace much shorter - that should help a bunch.

            E 1 Reply Last reply
            2
            • E ejlane

              I think your numbers look good. Nice job getting the trace much shorter - that should help a bunch.

              E Offline
              E Offline
              ejlane
              wrote on last edited by
              #16

              Oh, and Skywatch's tips are also good. Solid power is very important. I would put a few different capacitors as close to the power pin of the radio module as possible. 100n, and then a selection from: 1u, 4.7u, and 10u. I would likely go with 2 of those microfarad capacitors, and maybe all three. I like to err on the side of overkill where power capacitors are involved.

              1 Reply Last reply
              1
              • F Offline
                F Offline
                frapell
                wrote on last edited by
                #17

                @ejlane @Yveaux @skywatch So, I have found exactly what was going on, and had nothing to do with the hardware... Basically, one of my nodes was jamming the radio channel :face_with_rolling_eyes:

                How I discovered the issue:
                There are 2 more flags, besides MY_DEBUG which are MY_DEBUG_VERBOSE_RFM69 and MY_DEBUG_VERBOSE_TRANSPORT_HAL which I couldn't find a way to add, so I did it by editing the configure script and where it says

                if [[ ${debug} == "enable" ]]; then
                    CPPFLAGS="-DMY_DEBUG $CPPFLAGS"
                fi
                

                I changed it for

                if [[ ${debug} == "enable" ]]; then
                    CPPFLAGS="-DMY_DEBUG -DMY_DEBUG_VERBOSE_RFM69 -DMY_DEBUG_VERBOSE_TRANSPORT_HAL $CPPFLAGS"
                fi
                

                Then re-ran the script and recompiled the mysgw binary. The important flag in my case was MY_DEBUG_VERBOSE_RFM69.

                When mysgw was running, and everything was working fine, I was seeing lines with DEBUG RFM69:CSMA:RSSI=-102 popping in once or twice (with different values for RSSI) and everything continued normally. Then, when the whole thing was wedged and nothing worked, I noticed that message pretty much going on forever

                Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-53
                Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-53
                

                And on and on and on.... forever... Clearly there was a loop somewhere for whatever reason printing this message. As it turns out, there's a function that the RFM69 driver calls before sending a message https://github.com/mysensors/MySensors/blob/2e00bf6a10f76d6aaa1999e12313237bc3edabd3/hal/transport/RFM69/driver/new/RFM69_new.cpp#L369-L375 that pretty much checks if there is noise in the RF channel, before actually sending anything...
                I was doing some modifications to one node I have, where I replaced the arduino with another one, which I thought was a 3.3v one, burned it as so, but it was a 5v. For whatever reason (maybe the different clock speed? dunno...) when doing that, the node will send garbage through the radio... I have no idea how it manages to init the radio... doesn't really matter, the thing was sending something in the same channel constantly...

                And that is why the gateway was receiving data from other nodes, but was never able to send back... this other node was preventing it because it would never shut up... I have now replaced the arduino with a 3.3v one, checked in the serial monitor after burning :wink: and re-installed, and everything is back to normal and working...

                Thank you all for your help and suggestions, I will nevertheless build the new PCB with the suggested changes and replace the ones I am currently using.

                mfalkviddM 1 Reply Last reply
                1
                • F frapell

                  @ejlane @Yveaux @skywatch So, I have found exactly what was going on, and had nothing to do with the hardware... Basically, one of my nodes was jamming the radio channel :face_with_rolling_eyes:

                  How I discovered the issue:
                  There are 2 more flags, besides MY_DEBUG which are MY_DEBUG_VERBOSE_RFM69 and MY_DEBUG_VERBOSE_TRANSPORT_HAL which I couldn't find a way to add, so I did it by editing the configure script and where it says

                  if [[ ${debug} == "enable" ]]; then
                      CPPFLAGS="-DMY_DEBUG $CPPFLAGS"
                  fi
                  

                  I changed it for

                  if [[ ${debug} == "enable" ]]; then
                      CPPFLAGS="-DMY_DEBUG -DMY_DEBUG_VERBOSE_RFM69 -DMY_DEBUG_VERBOSE_TRANSPORT_HAL $CPPFLAGS"
                  fi
                  

                  Then re-ran the script and recompiled the mysgw binary. The important flag in my case was MY_DEBUG_VERBOSE_RFM69.

                  When mysgw was running, and everything was working fine, I was seeing lines with DEBUG RFM69:CSMA:RSSI=-102 popping in once or twice (with different values for RSSI) and everything continued normally. Then, when the whole thing was wedged and nothing worked, I noticed that message pretty much going on forever

                  Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                  Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                  Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-53
                  Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                  Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-52
                  Sep 09 18:37:11 DEBUG RFM69:CSMA:RSSI=-53
                  

                  And on and on and on.... forever... Clearly there was a loop somewhere for whatever reason printing this message. As it turns out, there's a function that the RFM69 driver calls before sending a message https://github.com/mysensors/MySensors/blob/2e00bf6a10f76d6aaa1999e12313237bc3edabd3/hal/transport/RFM69/driver/new/RFM69_new.cpp#L369-L375 that pretty much checks if there is noise in the RF channel, before actually sending anything...
                  I was doing some modifications to one node I have, where I replaced the arduino with another one, which I thought was a 3.3v one, burned it as so, but it was a 5v. For whatever reason (maybe the different clock speed? dunno...) when doing that, the node will send garbage through the radio... I have no idea how it manages to init the radio... doesn't really matter, the thing was sending something in the same channel constantly...

                  And that is why the gateway was receiving data from other nodes, but was never able to send back... this other node was preventing it because it would never shut up... I have now replaced the arduino with a 3.3v one, checked in the serial monitor after burning :wink: and re-installed, and everything is back to normal and working...

                  Thank you all for your help and suggestions, I will nevertheless build the new PCB with the suggested changes and replace the ones I am currently using.

                  mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by mfalkvidd
                  #18

                  Great work everyone! I have been following this thread and it makes me very happy to see how you work together.

                  For the debug flags, check out the ”Advanced” section at https://www.mysensors.org/build/raspberry#advanced

                  F 1 Reply Last reply
                  1
                  • mfalkviddM mfalkvidd

                    Great work everyone! I have been following this thread and it makes me very happy to see how you work together.

                    For the debug flags, check out the ”Advanced” section at https://www.mysensors.org/build/raspberry#advanced

                    F Offline
                    F Offline
                    frapell
                    wrote on last edited by
                    #19

                    @mfalkvidd Totally missed that! sweet !

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      ejlane
                      wrote on last edited by ejlane
                      #20

                      mfalkvidd gave you a great link, but if you ever need to see any possible choices, you can run

                      ./configure --help
                      

                      and it will show you. The extra flags section is one thing (of many) that it says.

                      Actually, this is very timely for me, as I'm trying to troubleshoot my own radio issues, so I'll use those extra two flags that you mentioned and see what they say.

                      Thank you!

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


                      15

                      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