I’m having a problem with Particle Electron.
The whole story goes like this:
I bought Electron about a year ago. I tried it. It worked fine. Connected to cloud - I had some fun with the Tinker app, but didn’t hava a particular project on hand, so the Electron was not used (not powered) for about a year.
Last week I started preparing for a new project which cannot use Wifi for connectivity and so I plugged the battery in to the Electron, and Electron to USB power source. After the normal procedure - the Electron connected to Cloud. I tried the “ping” widget in console and it was ok. I left it like that for some time to give the battery time to recharge… and here comes the problem.
When I got back to it, the Electron was repeating this pattern: blinking Cyan (like in Connecting to Cloud) for about 30 sec and afterwards some green blinking (repeat).
What I tried:
- Setting up the card once more (didn’t help and the setup told me that the card is already activated).
- Running the doctor in CLI. (didn’t help)
- Powering the Electron in different place with better 3G reception (thought about GSM reception)
- Updating the firmware from 0.4.8 to the newest.
- Checking this forum for similar problems (investigating the orange burst)
- Changing the power source to a huge one to eliminate the problem with lack of sufficient power
- Checking my balance and data usage (everything paid and no data used at all)
- Checking the SIM card for any visible errors/scratches etc.
- Checking the antena for connection
- Using a 3rd party SIM ---- WORKED
Hmmm… that is strange I thought. So I run a bit of tests and found a reliable repeating pattern. My code (but the same happens with “out of the box” Tinker) works like a charm with my 3rd party SIM and it doesn’t with Particle SIM.
Of course when I have my 3rd party sim, I also have to set up the APN which for my country (Poland) and my provider of the sim is “internet”. When I make the same test with original SIM I “comment out” the line: STARTUP(cellular_credentials_set("internet", "", "", NULL));
For the sake of transparency here goes my code(even though I checked with Tinker app and the problem stays):
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h>
STARTUP(cellular_credentials_set("internet", "", "", NULL));
#define DHTPIN 1 // what pin we're connected to
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
FuelGauge fuel;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
pinMode(D0, OUTPUT); // Vcc dla DHT11
digitalWrite(D0, HIGH);
pinMode(D2, OUTPUT); // GND dla DHT11
digitalWrite(D2, LOW);
pinMode(D3, INPUT_PULLUP);
dht.begin(); // Data z DHT11
}
void loop() {
delay (1500);
if (digitalRead(D3) == HIGH){
bool PUB = Particle.publish("Vbat1-test", String(dht.getTempCelcius(), 2) + ";" + String(fuel.getVCell(), 2) + ";" + String(fuel.getSoC(),0));
if (PUB == 1){
digitalWrite(D0, LOW); // wyłączam zasialanie na DHT 11
System.sleep(SLEEP_MODE_DEEP,600);
}
}
}
In short: the Particle Electron works with 3rd party SIM card, but doesn’t with the original one.
Any ideas?
I submitted a “support ticket” ID 52976 - but since I mostly use this forum to solve my problems (by reading) - I decided to document the case also here, wait for some ideas form the community, and if the thing ever get’s solved, post the solution for others to read in future.