How to handle a LTE Connectivity loss



  • Dear Pycom-Community,

    yesterday I had an issue with my GPy. I send every 3 minutes Data via LTE-M. At some point, the GPy couldn't send data anymore, while it still told me, that my GPy is attached to the network and that a data connection is still there. Every time, before I send data, I check the connectivity:

    print("Is LTE attached:")
    print(lte.isattached())
    print("Is LTE connected:")
    print(lte.isconnected())
    

    I've checked the site of the company, who provided the IoT SIM-Card and I could see, that my GPy was only attached to the network, but that there actually was no data connection.

    I guess a LTE connectivity loss happened, mentioned here: https://docs.pycom.io/tutorials/networks/lte/

    In the section under LTE connectivity loss, you can read the following:
    If the connectivity is lost this will in general not be reflected when you check lte.isconnected().

    Probably that happened for me. I contacted the SIM-Card provider though and they want to check, if something happened at their side. I will update the thread with their answer.

    I've waited like 40 minutes for the modem to get a data connection again, but it didn't happen. Resets via the Reset Pin or the Reset button didn't help with the issue at all. After 40 minutes I did a power cycle, completely cutting off the power and afterwards, the GPy got a connection again and could transmit data, which is kinda concerning.

    I thought about using lte.deinit() in this case and make a completely fresh start. Would this probably solve my issue? Any suggestion how to handle this situation to get a data connection going again?

    Are there any plans to update lte.isconnected() to spot a LTE Connectivity loss every time it happens to react to that problem? @Gijs

    Kind regards,

    SciWax



  • My minimal setup worked on my breadboard. Today, I've integrated that initially separated structure into my big prototype on my other breadboards.

    It is really weird. The Pull-up doesn't work always. When I use my minimal example code on my big prototype setup it works as on my minimal breadboard setup. The Pull-up works and the GPy doesn't boot up, so the GPy is powered off while the Arduino is booting. The Pull on the Gate is high enough in that case.

    When I use my real prototype code, where every sensor gets setup, the pull-up doesn't work anymore though. I can't explain why. I didn't change anything on my big prototype setup and I can't control a passive element like a simple pull-up setup via code. It must be related to the Voltage on my 5V-Pin on the Arduino then I guess? But why is the minimal example code on the same big prototype setup working as expected (the GPy is turned off at the beginning) ...

    While the Pull-up doesn't work on the big prototype setup, I can power cycle the GPy. When I pull the GPIO HIGH, which is connected to the Gate, I power the GPy off. When I set the GPIO to LOW, the GPy turns on again. I just can't explain why the Pull-Up doesn't work, while power cycling with the GPIO of the Arduino seems to be working?

    I've connected a 10k Ohm resistor to one of the 5V Pins of the Arduino, which is connected to the gate. I use this site as a reference: https://www.gammon.com.au/motors

    Would shifting the threshold by the forward voltage of the diode help, so I get consistency into my setup @robert-hh ?

    Kind regards,

    SciWax



  • Okay, I've created a minimal example on a breadboard and it works so far.
    I can reset the GPy with the DMP2045U together with an Arduino!

    My setup:

    • Arduino for controlling the P-Ch-Mosfet
    • DMP2045U Mosfet
    • 150 Ohm resistor for protecting the Digital Output pin connected to the Gate
    • 100nF Gate-Source cap
    • 10k Ohm Pull-Up Resistor on the Gate so the GPy doesn't turn on while the Arduino is booting
    • SOT23 to DIP adapter

    Thanks again for the help everybody!



  • Hi,
    Yes, a non-polarized cap would be best. You want to remove any (high-frequency) switching noise using the capacitor. It should also work without one, though you might have issues with debouncing in extreme cases.



  • Hello @Gijs,

    of course I have to use a non-polarized capacitor, like a ceramic one, when I want to put a capacitor between the gate and the drain, right?

    @SciWax said in How to handle a LTE Connectivity loss:

    @Gijs said in How to handle a LTE Connectivity loss:

    Pull the gate up to VCC to stop the flow of current, and pull it down to GND to connect the two. I'd also use a small 100nF capacitor over the Gate-Drain to protect against switching transients

    For everybody, who is rather unexperienced in regards of electrical engineering (like me unfortunately), I've found an article online, which adds to the topic of switching transients and MOSFETs.

    Dr Zhongda Li How to slow down dV/dt
    during switching

    Thanks again for the help, @Gijs . Always like to learn something new



  • @SciWax It should work. In case that the transistor starts conducting too early, you could still add a diode between gate and the Arduino GPIO and a resistor between Gate and Source to shift the threshold by the forward voltage of the diode.



  • Actually I have another newbie question in regards of the suggested P-Channel MOSFETs for low voltage applications.

    I've finally bought the DMP2045U: https://www.diodes.com/assets/Datasheets/DMP2045U.pdf

    According to the datasheet, the Vgs is between -0.3 and -1.0. I use a Powerboost from Adafruit, which sources 5.2V at max, The Powerboost powers the GPy via its 5V Pin. My Arduino pin as a digital output pin can be at 5V at max.

    The planned configuration for the P-CH MOSFET:

    The Drain is connected to my VIN Pin of the GPy. The Source is connected to the Powerboost (5.2V). My Arduino Digital Output Pin is connected to the Gate (Between 0V (On) and 5V (Off)).

    Pulling the Arduino Output Pin low would result in Vgs = 0V - 5.2V, which means -5.2V. Turning the MOSFET on wouldn't be a problem then I guess. I'm not sure, if I can turn it off though?

    5V - 5.2V is -0.2V. I guess because I'm above the -0.3V, I'm kinda fine and the MOSFET should be off (25°C), but looking at the datasheet and figure 2 makes me curious. It feels like I'm walking on the edge here?

    For instance, when I interpret figure 2 correctly, I would think that even if I reach the -0,3V (because I can't turn the MOSFET properly off, because HIGH on the the Arduino digital output pin only reaches 4,9V), the current flow should become so low, that the GPy turns off anyways? It looks like I should be safe till -0.5V at least, when I look at figure 2. With a current below 100 mA, the GPy surely should turn off, right?

    BTW I will add a 150 Ohm resistor (Current protection) between the Gate and the Arduino pin and a 100nF capacitor over the Gate-Drain.



  • As a note to people who use a 1nce-SIM card on a Pycom GPy together with an Arduino Watchdog. Today, I had another LTE Connectivity loss. Again, my GPy was only attached according to the 1nce dashboard and the normal resets through my Arduino and the Reset Pin on the GPy didn't work for getting that connection back.

    Before visiting my measurement system in the field to power cycle the GPy manually, I've decided to try the the SIM Reset in the 1nce customer portal for the SIM of the GPy. After reading,"from suspended to activated" in the event window of the dashboard, the data connection happened again after my GPy did a normal reset through pulling the Reset Pin low on the GPy (I guess). It could be pure coincidence, because unfortunately I don't have a second identical system around for debugging purposes at the moment, which would possibly support the idea. It would be really weird, if there wouldn't be a connection between the SIM card reset and the re-established data connection though, because my GPy in the field nearly didn't send for a whole hour. A few moments later after I've resetted the SIM card, the data connection came back and the GPy send data to my database again. That would be too much of a coincidence to be honest.

    So my suggestion is, if you use the 1nce service and the data connection is gone, maybe try a SIM card reset through the customer portal too. Still, I can't really tell, if it was a coincidence or not so take my advise with a grain of salt. Unfortunately I have no idea, if other providers have a "SIM reset" service like that.

    As another note: I've send my data every 3 minutes for 16 days without any problems before the loss of data connection happened. Quite happy about that,



  • @Gijs said in How to handle a LTE Connectivity loss:

    Pull the gate up to VCC to stop the flow of current, and pull it down to GND to connect the two. I'd also use a small 100nF capacitor over the Gate-Drain to protect against switching transients

    For everybody, who is rather unexperienced in regards of electrical engineering (like me unfortunately), I've found an article online, which adds to the topic of switching transients and MOSFETs.

    Dr Zhongda Li How to slow down dV/dt
    during switching

    Thanks again for the help, @Gijs . Always like to learn something new



  • @Gijs Thanks for clarifying again! Sorry, it wasn't clear for me, if the lte.deinit() and lte.reset() are realized through AT commands or through setting Pins low or high. Especially the latter. For instance, the very old SIM800L has a Reset-Pin. If this Reset-Pin is held low for a certain amount of time, the SIM800L gets reset. I was thinking About my past experiences with other Modems, so I thought the GPy interacts with its modem possibly the same way. I will definitely use the suggestion with the mosfet then.



  • You are correct saying lte.deinit() and lte.reset() should also work, though I have seen in the past that it in some cases the device gets stuck in the data mode (ppp mode), where it does not accept AT commands anymore, meaning we cannot get it to reset, and I think we were discussing this case before right? If the commands do still work for you, by all means go ahead :)

    Gijs



  • @Gjis
    Sorry for bothering you again. I just wanted to make sure, that an alternative also possibly works, which kjim suggested (Thanks again). Wouldn't lte.deinit also work in the case, that I suspect a missing data connection, which the GPy is not aware of?

    https://docs.pycom.io/firmwareapi/pycom/network/lte/

    This page says the following:

    Disables LTE modem completely. This reduces the power consumption to the minimum. Call this before entering deepsleep.

    • detach : detach from network.

    • reset : reset LTE modem.

    LTE.deinit should still be useable, even if there is a data connection, right? That would make a power cycling obsolete and therefore a MOSFET, but it's always great to have other options at hand too. :)

    I would like to test it myself, but it is hard to reproduce this issue by force, because it depends on hicc ups in the network, which I cannot control. The constellation, where everything goes wrong is probably rare.



  • That could work. The high-side driver schematic indeed looks like something you'll need!



  • @Gijs said in How to handle a LTE Connectivity loss:

    I'd also use a small 100nF capacitor over the Gate-Drain to protect against switching transients

    I guess a resistor between the Arduino Pin and the MOSFET Gate would be also fine?

    http://www.gammon.com.au/motors



  • @robert-hh
    Originally, I've bought some adapters like that, because I've bought a SOT23 Watchdog. Lucky me :) .

    Thanks again everybody for the Input! It really helps!



  • @rcolistete said in How to handle a LTE Connectivity loss:

    SOT23

    Agreed. I have them in my boxes and soldered them. There are also SOT23 -> TO92 adapters available. Just a tiny PCB.



  • @rcolistete
    Nice, with this space it should be possible to solder them comfortably on some copper pads on my boards with a standard soldering station.



  • @robert-hh They are SMD but not too small, SOT23, with almost 2 mm of space between pins.





  • @rcolistete
    Thank you for your suggestion! Indeed, I'm looking for through hole p-channel mosfet.


Log in to reply
 

Pycom on Twitter