Hi,
I wrote an small application to gather sensor data and send it directly to my server, without connecting to the particle cloud (if not specified by my server).
Unfortunately since a few months I get various "SOS" errors,.. Until now it was always pretty disturbing but now it is getting permanent and I don't have any ideas how to find the root cause of this error,.
executing Particle.connect(); in SYSTEM_MODE(SEMI_AUTOMATIC);
calling callular.connect when not execute cellular.on before
....
Example:
Serial.print("Turn on cellular device,..");
delay(1000);
Cellular.on();
Serial.println("done");
delay(1000);
Turn on cellular device,..done
Setting credentials,..done
Connecting,..
==> SOS
I tried that sketch on 2 different electrons, 2 different SIM cards, 0.6.2 on the first, 0.7.0-rc.3 on the second Electron. I compiled the code in the cloud using CLI and flashed thru USB (--serial) and even in recovery mode!
That said, the electron, the SIM and the credentials must be OK (at least somehow). There should be still plenty of heap memory free (approx 100k) just before entering cellular.connect.
ok, I disabled 2 externa libs (smsNotify and cellLocate) and it seems to work for now,… both talk to the modem directly and may cause unexpected states,… I’ll keep you posted!
OK, I still got a lot of SOS-errors, but I found out that,…
1.) one error was caused by an overflow (?) when printing Serial.printf("integer: " + integer); instead of Serial.printf(“integer: %d”, integer)
2.) some more errors still happen when calling Particle.connect() in UDP mode.
When changing mode to TCP (and recreating keys) everything looks OK so far,…
Anyone ever had a similar issue or can give me a hint how to debug this issue??
sorry for not responding earlier. Unfortunately it was not because the issue(s) disappeared but because I had many more issues getting electron REAL stable. Somehow they work, but I cannot leave them alone some miles away,…
What is working right now:
Connecting to network with 3rd party SIM (emnify)
Connecting to Particle Cloud (most of the time)
What does not work:
Firmware upgrade thru the cloud (almost 99% fail)
Stable particle.connect - still I get some occasional Red SOS
The issue is not limited to one device and not limited to one SIM provider. Right now I have 3 devices with emnify, 2 more with an local provider, one more with another one.
In the void loop() I shut down the system completely to save power, except if my own server tells not to do, eg to connect to particle cloud.
For that I had also a Particle.process() in the loop. The loop itself was slowed down using delay(200);
The ApplicationWatchdog is right now set to 120s, as sometimes the modem takes very long to connect. If a reset occurs, a counter is beeing increased by one, if this counter is odd during loop, the device resets the modem and goes into deep_sleep for 10 seconds.
The rest is just a arduino sketch that runs nice. Usually I have around 100 kbytes free.
Just to complete previous attempts to resolve the issue:
I changed the cloud communication protocol from UDP to TCP (and back). Didn’t really change anything, suffer still a lot of various issues preventing the stuff to become a commercial product.
I would try to debug your issues by running known good firmware such as Tinker for Electron, the app that is installed at the factory. Since you have third-party sim cards, you will need to compile Tinker yourself adding the correct startup commands for your sims.
If Tinker has connection issues you need to look at your provider settings. On the other hand, if that works OK, you need to look at your code.
is there any possibility to output any debugging-information to the (USB) Serial port?
Usually the Electron hang or SOS immediately after calling cellular.connect or particle.connect,…
In some cases the electron even hang when reset and booted into rescue mode,…
OK, it is possible to send some debugging information to console:
SerialLogHandler logHandler(LOG_LEVEL_ALL);
It seems, that there are several issues with the SIM card not completely detected (couldn’t get ICCID) or some errors while connecting to the mobile network,…
That said, I have still no idea how to recover from that state. I tried to reset anything, if the connection fails several times:
ok, I got this specific error better under control by limiting the timespan between two connects to 3 minutes. But I cannot yet confirm it completely.
Furthermore, an old “friend” appeared again. I get occasional SOS - even when loading the electron in rescue mode. I also found another issue, that once connected to the cloud, breathing cyan stopps within seconds without any possibility to recover by ApplicationWatchdog,…
Is it rocket-science what I’m doin?
triggering a sensor delivering data over serial/TTL
querying one onewire sensor
submitting data over HTTP
keeping some values in EEPROM and/or retained RAM
checking values every 3 minutres, goin online once every half hour (or when value changed dramatically)
Is there anyone, who has knowledge of particle electron and can do code review & bug hunting for $$$?