Using Electron in Manual or Semi-Automatic Mode Without SIM [Solved]

Hi,

Is it possible to use electron in manual or semi-automatic mode without claiming the device? I am using the LED blink code with the addition of

SYSTEM_MODE(SEMI_AUTOMATIC)

However my electron keeps going into listening mode. I have updated the firmware by issuing

particle update

from the CLI, which seem to complete the task successfully. I am using the electron without any SIM card. I want to setup the basic local tasks before I connect it to cloud. I noticed that updating the firmware solved the problem for few people. Sending ‘v’ over a terminal in listening mode returns

system firmware version: 0.5.3

You can use MANUAL and SEMI_AUTOMATIC and even AUTOMATIC with an unclaimed device.

But running without SIM card is different thing than having the device claimed or not.

Showing your test code might reveal some cause for listening mode.

1 Like

Here is the code I am using.

SYSTEM_MODE(SEMI_AUTOMATIC);
//SYSTEM_THREAD(ENABLED);
int led1 = D0; // Instead of writing D0 over and over again, we'll write led1
int led2 = D7; // Instead of writing D7 over and over again, we'll write led2
void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
}

void loop() {
  digitalWrite(led1, HIGH);
  digitalWrite(led2, HIGH);
  delay(1000);

  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  delay(1000);
}

Adding/Removing SYSTEM_THREAD(ENABLED) makes no difference. The device always goes into listening mode after around 15 sec.

EDIT: Same thing happens even when I use SYSTEM_MODE(MANUAL);

You mean it starts blinking as expected and then dropps into LM?

Have you tried MANUAL - as your topic title suggests?
You could always add a Cellular.off() in setup() to be on the safe side.

No. Sorry I should have mentioned that the LED never blinks. Electron goes from breathing white for some time and then into listening mode.

I will try Cellular.off(). Thanks for the hint.

Okay. This is little embarrassing, but the following code doesn't compile:

#include "application.h"

SYSTEM_MODE(MANUAL);
//SYSTEM_THREAD(ENABLED);
 
int led1 = D0; // Instead of writing D0 over and over again, we'll write led1
int led2 = D7; // Instead of writing D7 over and over again, we'll write led2


void setup() {
  Cellular.off();
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
}

void loop() {
  digitalWrite(led1, HIGH);
  digitalWrite(led2, HIGH);
  delay(1000);

  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);
  delay(1000);
}

It returns:

error: 'Cellular' was not declared in this scope

EDIT:
This link says I need to set some star flag under devices tab. My device is still unclaimed.

EDIT2: Trying to add device using particle-cli returns

Failed to claim device, server said: [object Object]

Which I guess doesn't work offline. Now what? :confused:

Hmm, you’re using firmware that’s incompatible with an electron. Seeing as you haven’t claimed it yet, it’s not yet available as a target. As such, you’ll have to compile using the CLI. Make an empty directory and copy & paste your code into a blank .ino file. Then, in that directory, issue particle compile electron . in the CLI. That should give you a binary which you can flash using particle flash --usb [.bin name].

2 Likes

That did it. Thanks a lot!

2 Likes

Thanks @ScruffR @Moors7 for the help!