Attempt to Connect Causes Early Reboot Within Seconds of Turning On

Hi everyone,

I have a couple of M404s with DeviceOS 5.8.0 that will frequently turn on, attempt to connect, and reboot themselves automatically. The measured period between these cycles is around 9 seconds. I need these to not reboot so soon so that other non-connectivity functions can be performed. Eventually after several cycles, the M404 will usually connect, and everything seems to work fine.

The Cellular signal strength is around 15%, and the signal quality fluctuates between 30-75%, but even if there is a poor signal quality, this isn't the behavior I'd like to have.

I previously ran similar code on the B404 and B404X just fine without this issue.

Any idea why this might be happening?

Here's the jist of my code.

#include "Particle.h"
#include // other stuff

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

SerialLogHandler logHandler(LOG_LEVEL_INFO);
CellularSignal sig;

// instantiate some custom classes
// declare some custom variables

void setup() {
    Log.info("Starting setup");
    delay(2000ms);
    // set GPIO pin modes
    // initialize some variables

    if(!Particle.connected()) {
        Log.info("Connecting to Particle cloud");
        Particle.connect();
    }

    // set up Particle functions

    current_time_ms = millis();
}

void loop() {
    // update states of various interface inputs (buttons)
    // poll sensors
    // run actuator loop (actuator will turn on or off based on certain state conditions, should be non-blocking)
    // 

    if (Particle.connected()) {
    strcpy(state.vars.cellular_status, "Connected");
  } else {
    strcpy(state.vars.cellular_status, "Disconnected");
  }
  sig = Cellular.RSSI();
  state.vars.cellular_signal_strength = (double)sig.getStrength();
  state.vars.cellular_signal_quality = (double)sig.getQuality();
  state.cellular_status_display = state.vars.cellular_status;

  if (LOGGING) {
    state.tryLog(); // will log output if enough time has gone by based on pre-defined period
  }

  if (state.tryPublish()) { // will attempt to publish state if enough time has gone by based on pre-defined period
    // reset some variables 
  }
}

I get this output on the serial line when the rebooting happens:

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000006392 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000006395 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000006398 [hal] INFO: DNS server list changed
0000006399 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000006401 [hal] INFO: DNS server list changed
0000006403 [system] INFO: Cloud: connecting
0000006420 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000006443 [system] WARN: Failed to load session data from persistent storage
0000006462 [system] INFO: Discarding session data
0000007203 [system] INFO: Cloud socket=0, connecting to 3.230.254.13#5684
0000007226 [system] INFO: Cloud socket connected
0000007239 [system] INFO: Starting handshake: presense_announce=0
0000007255 [comm.protocol.handshake] INFO: Establish secure
Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004063 [app] INFO: open errno: 0
0000004071 [app] INFO: read errno: 0
0000004080 [app] INFO: close errno: 0
0000004090 [app] INFO: open errno: 0
0000004126 [app] INFO: write errno: 0
0000004164 [app] INFO: close errno: 0
0000004554 [app] INFO: Connecting to Particle cloud
0000004565 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004580 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004599 [net.ifapi] INFO: Netif pp3 state UP
0000004622 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004677 [mux] INFO: Starting GSM07.10 muxer
0000004680 [mux] INFO: Opening mux channel 0
0000004681 [mux] INFO: GSM07.10 muxer thread started
0000004683 [mux] INFO: Opening mux channel 1
0000004738 [mux] INFO: Mux channel 1 already opened
0000004769 [mux] INFO: Opening mux channel 2
0000005845 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005848 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005850 [hal] INFO: DNS server list changed
0000005851 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005853 [hal] INFO: DNS server list changed
0000005864 [system] INFO: Cloud: connecting
0000005877 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005899 [system] WARN: Failed to load session data from persistent storage
0000005916 [system] INFO: Discarding session data
0000006488 [system] INFO: Cloud socket=0, connecting to 34.231.252.59#5684
0000006509 [system] INFO: Cloud socket connected
0000006521 [system] INFO: Starting handshake: presense_announce=0
0000006537 [comm.protocol.handshake] INFO: Es
Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004072 [app] INFO: open errno: 0
0000004079 [app] INFO: read errno: 0
0000004088 [app] INFO: close errno: 0
0000004098 [app] INFO: open errno: 0
0000004132 [app] INFO: write errno: 0
0000004171 [app] INFO: close errno: 0
0000004562 [app] INFO: Connecting to Particle cloud
0000004577 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004594 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004613 [net.ifapi] INFO: Netif pp3 state UP
0000004630 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004692 [mux] INFO: Starting GSM07.10 muxer
0000004695 [mux] INFO: Opening mux channel 0
0000004696 [mux] INFO: GSM07.10 muxer thread started
0000004699 [mux] INFO: Opening mux channel 1
0000004754 [mux] INFO: Mux channel 1 already opened
0000004785 [mux] INFO: Opening mux channel 2
0000006361 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000006363 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000006365 [hal] INFO: DNS server list changed
0000006367 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000006369 [hal] INFO: DNS server list changed
0000006468 [system] INFO: Cloud: connecting
0000006484 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000006506 [system] WARN: Failed to load session data from persistent storage
0000006523 [system] INFO: Discarding session data

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004062 [app] INFO: open errno: 0
0000004072 [app] INFO: read errno: 0
0000004081 [app] INFO: close errno: 0
0000004091 [app] INFO: open errno: 0
0000004124 [app] INFO: write errno: 0
0000004161 [app] INFO: close errno: 0
0000004551 [app] INFO: Connecting to Particle cloud
0000004566 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004584 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004603 [net.ifapi] INFO: Netif pp3 state UP
0000004621 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004682 [mux] INFO: Starting GSM07.10 muxer
0000004685 [mux] INFO: Opening mux channel 0
0000004685 [mux] INFO: GSM07.10 muxer thread started
0000004689 [mux] INFO: Opening mux channel 1
0000004743 [mux] INFO: Mux channel 1 already opened
0000004773 [mux] INFO: Opening mux channel 2
0000005848 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005850 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005852 [hal] INFO: DNS server list changed
0000005854 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005856 [hal] INFO: DNS server list changed
0000005955 [system] INFO: Cloud: connecting
0000005970 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005994 [system] WARN: Failed to load session data from persistent storage
0000006011 [system] INFO: Discarding session data

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004062 [app] INFO: open errno: 0
0000004071 [app] INFO: read errno: 0
0000004080 [app] INFO: close errno: 0
0000004090 [app] INFO: open errno: 0
0000004125 [app] INFO: write errno: 0
0000004163 [app] INFO: close errno: 0
0000004554 [app] INFO: Connecting to Particle cloud
0000004569 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004586 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004605 [net.ifapi] INFO: Netif pp3 state UP
0000004620 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004684 [mux] INFO: Starting GSM07.10 muxer
0000004687 [mux] INFO: Opening mux channel 0
0000004687 [mux] INFO: GSM07.10 muxer thread started
0000004690 [mux] INFO: Opening mux channel 1
0000004744 [mux] INFO: Mux channel 1 already opened
0000004774 [mux] INFO: Opening mux channel 2
0000005849 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005851 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005854 [hal] INFO: DNS server list changed
0000005855 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005857 [hal] INFO: DNS server list changed
0000005859 [system] INFO: Cloud: connecting
0000005874 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005897 [system] WARN: Failed to load session data from persistent storage
0000005917 [system] INFO: Discarding session data
0000006478 [system] INFO: Cloud socket=0, connecting to 3.230.254.13#5684
0000006500 [system] INFO: Cloud socket connected
0000006510 [system] INFO: Starting handshake: presense_announce=0
0000006527 [comm.protocol.handshake] INFO: Establish secure connection
0000006551 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000011458 [comm.protocol.handshake] INFO: Sending HELLO message

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004071 [app] INFO: open errno: 0
0000004080 [app] INFO: read errno: 0
0000004089 [app] INFO: close errno: 0
0000004099 [app] INFO: open errno: 0
0000004132 [app] INFO: write errno: 0
0000004171 [app] INFO: close errno: 0
0000004563 [app] INFO: Connecting to Particle cloud
0000004578 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004590 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004610 [net.ifapi] INFO: Netif pp3 state UP
0000004620 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004685 [mux] INFO: Starting GSM07.10 muxer
0000004687 [mux] INFO: Opening mux channel 0
0000004688 [mux] INFO: GSM07.10 muxer thread started
0000004691 [mux] INFO: Opening mux channel 1
0000004745 [mux] INFO: Mux channel 1 already opened
0000004775 [mux] INFO: Opening mux channel 2
0000005850 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005853 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005855 [hal] INFO: DNS server list changed
0000005857 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005859 [hal] INFO: DNS server list changed
0000005861 [system] INFO: Cloud: connecting
0000005878 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005898 [system] WARN: Failed to load session data from persistent storage
0000005917 [system] INFO: Discarding session data

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004058 [app] INFO: open errno: 0
0000004068 [app] INFO: read errno: 0
0000004077 [app] INFO: close errno: 0
0000004087 [app] INFO: open errno: 0
0000004122 [app] INFO: write errno: 0
0000004160 [app] INFO: close errno: 0
0000004551 [app] INFO: Connecting to Particle cloud
0000004566 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004584 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004603 [net.ifapi] INFO: Netif pp3 state UP
0000004619 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004682 [mux] INFO: Starting GSM07.10 muxer
0000004685 [mux] INFO: Opening mux channel 0
0000004686 [mux] INFO: GSM07.10 muxer thread started
0000004688 [mux] INFO: Opening mux channel 1
0000004743 [mux] INFO: Mux channel 1 already opened
0000004773 [mux] INFO: Opening mux channel 2
0000005849 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005852 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005854 [hal] INFO: DNS server list changed
0000005855 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005858 [hal] INFO: DNS server list changed
0000005963 [system] INFO: Cloud: connecting
0000005977 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005999 [system] WARN: Failed to load session data from persistent storage
0000006018 [system] INFO: Discarding session data
0000006393 [system] INFO: Cloud socket=0, connecting to 34.231.252.59#5684
0000006412 [system] INFO: Cloud socket connected
0000006424 [system] INFO: Starting handshake: presense_announce=0
0000006440 [comm.protocol.handshake] INFO: Establish secure connection
0000006461 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2

Serial connection closed.  Attempting to reconnect...
Serial monitor opened successfully:
0000004074 [app] INFO: open errno: 0
0000004083 [app] INFO: read errno: 0
0000004092 [app] INFO: close errno: 0
0000004102 [app] INFO: open errno: 0
0000004134 [app] INFO: write errno: 0
0000004172 [app] INFO: close errno: 0
0000004564 [app] INFO: Connecting to Particle cloud
0000004579 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004596 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004615 [net.ifapi] INFO: Netif pp3 state UP
0000004619 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004687 [mux] INFO: Starting GSM07.10 muxer
0000004690 [mux] INFO: Opening mux channel 0
0000004690 [mux] INFO: GSM07.10 muxer thread started
0000004695 [mux] INFO: Opening mux channel 1
0000004749 [mux] INFO: Mux channel 1 already opened
0000004781 [mux] INFO: Opening mux channel 2
0000005856 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005858 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005860 [hal] INFO: DNS server list changed
0000005862 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005864 [hal] INFO: DNS server list changed
0000005866 [system] INFO: Cloud: connecting
0000005885 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005907 [system] WARN: Failed to load session data from persistent storage
0000005926 [system] INFO: Discarding session data
0000006308 [system] INFO: Cloud socket=0, connecting to 34.231.252.59#5684
0000006327 [system] INFO: Cloud socket connected
0000006338 [system] INFO: Starting handshake: presense_announce=0
0000006354 [comm.protocol.handshake] INFO: Establish secure connection
0000006362 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2

The M404 seems to reboot part way though these printouts.

Finally, when it does connect I get this:

Serial connection closed.  Attempting to reconnect...      
Serial monitor opened successfully:
0000004069 [app] INFO: open errno: 0
0000004074 [app] INFO: read errno: 0
0000004083 [app] INFO: close errno: 0
0000004093 [app] INFO: open errno: 0
0000004127 [app] INFO: write errno: 0
0000004161 [app] INFO: close errno: 0
0000004552 [app] INFO: Connecting to Particle cloud
0000004564 [system.nm] INFO: State changed: DISABLED -> IFACE_DOWN
0000004580 [system.nm] INFO: State changed: IFACE_DOWN -> IFACE_REQUEST_UP
0000004598 [net.ifapi] INFO: Netif pp3 state UP
0000004614 [system.nm] INFO: State changed: IFACE_REQUEST_UP -> IFACE_UP
0000004677 [mux] INFO: Starting GSM07.10 muxer
0000004680 [mux] INFO: Opening mux channel 0
0000004681 [mux] INFO: GSM07.10 muxer thread started       
0000004683 [mux] INFO: Opening mux channel 1
0000004737 [mux] INFO: Mux channel 1 already opened
0000004767 [mux] INFO: Opening mux channel 2
0000005846 [net.ifapi] INFO: Netif pp3 link UP, profile=NONE
0000005849 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0000005851 [hal] INFO: DNS server list changed
0000005852 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0000005855 [hal] INFO: DNS server list changed
0000005857 [system] INFO: Cloud: connecting
0000005871 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
0000005893 [system] WARN: Failed to load session data from persistent storage
0000005912 [system] INFO: Discarding session data
0000006826 [system] INFO: Cloud socket=0, connecting to 34.231.252.59#5684
0000006850 [system] INFO: Cloud socket connected
0000006864 [system] INFO: Starting handshake: presense_announce=0
0000006880 [comm.protocol.handshake] INFO: Establish secure connection
0000006901 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000011722 [comm.protocol.handshake] INFO: Sending HELLO message
0000011866 [comm.protocol.handshake] INFO: Handshake completed
0000011883 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000011900 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000013221 [system] INFO: Send spark/device/last_reset event
0000013250 [comm] INFO: Sending TIME request
0000013264 [system] INFO: Sending application DESCRIBE
0000013302 [system] INFO: Sending subscriptions
0000013312 [comm.protocol] INFO: Sending subscriptions
0000013680 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4

After this, the expected logging printouts appear, and things seem to be fine.

I will also add that removing the

if(!Particle.connected()) {
        Log.info("Connecting to Particle cloud");
        Particle.connect();
    }

from setup() makes the rebooting go away, but then we're not connecting at all. Hopefully this is a good indicator that this is not an issue elsewhere (e.g., power).

Hi there, can you please update to Device OS 5.9.0 & see if it reproduces? This release is currently in the Prerelease state, but there are a number of bug fixes for M-SoMs in there that would make it worth it. Information on how to access this version are here.

The M404 uses significantly more power than the B404 and B404X. It's very likely a brownout that is causing the device to reboot, but it's close enough to working that it works sometimes.

How much power do you have available on 3V3? The B404 could run with as little as 150 mA available on 3V3, but the M404 requires a minimum of 500 mA, preferably a little more. It's also significantly more sensitive to under-voltage.

Monitoring the 3V3 rail will be able to tell for certain. Even if you have a big enough 3V3 regulator, the voltage could be dipping as the current draw from the cellular modem on VCC/3V7 is the highest at that point of connecting.

Are you using a bq24195 PMIC and a battery or other power source?

We have a 1A linear regulator for 3.3V (AZ1117IH-3.3TRG1)

The input to the regulator comes from an AC-DC converter which outputs 5VDC with 3A max output. This also provides input to our 3.8V regulator, which has 3A max output current.

We also have capacitors on the inputs and outputs of the regulators according the manufacturer's recommendations.

If it were a power issue, would we likely be seeing brown out during publishing as well? I haven't noticed this occuring so far.

Power is coming from the wall (120 VAC)

I'm currently working with two M404 devices, and both are having issues. I upgraded the first to 5.9.0, and the issue seemed to go away, at least first the first five intentional reboots (me unplugging and plugging back in).

I tried upgrading the second system and am still seeing the issue. I am also seeing it on the first unit now. Not sure if I was just luck after updgrading the first one to see it work so many times in a row or if something caused it to start failing again.

The current during connection from the cellular modem (VCC/3V7) is the highest when connecting to the cloud and it's a few seconds. The current during publish is the same, but the duration is less than a millisecond.

Okay, here's what I've found:

Setup:
I have an AC/DC converter that outputs 5V with 3A max and feeds two linear regulators.
3.3V is supplied by a linear regulator with a max output of 1A
3.7V is supplied by a linear regulator with a max output of 3 A

Tests:

  • I hooked up the 5V line to a benchtop supply outputting 4A max - this failed
  • I hooked up the 3.3V line to a benchtop supply outputting 4A max, and I hooked up the 3.7V line to a another supply (grounds connected) outputting 4A max - this passed
  • I plugged the AC power cord in (5V generated from the AC/DC converter) and hooked up a supply to 3.3V with a max output of 3A - this passed
  • I plugged the AC power cord in (5V generated from the AC/DC converter) and hooked up a supply to 3.7V with a max output of 3A - this failed (means problem is with 3.3V regulator)
  • I repeated the test with the supply hooked up to the 3.3V line and lowered the max current down to around 70 mA at which point it started to fail again

Solution:
I installed a capacitor across the 3.3V line. It started to pass again around 1600 uF. I'm going to add a 2x safety factor and use a 3300 uF capacitor, since swapping out the regulator is not very easy for me right now.

I'm not sure why the original setup was insufficient, given that the documentation recommends 2A for 3.7V and 500 mA for 3.3V. I though that perhaps the regulators were fighting each other for current from the 5V supply, but I think some of my experiments with changing around the benchtop supply disproves that, unless anyone else can think why it might not. I do have some other components drawing a bit of current from the 3.3V line, so maybe that was a part of it. Anyways, maybe this would be helpful if anyone else has similar issues.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.