I'm new to particles photon so sorry if this is a trivial question.
I'm trying to flash a fresh photon (the ID has been added to a project, but the device has never been online) with user firmware that need to run on the device without a connection to particle. Later wan't to handle connection to wifi and particle could manually from firmware code (os firmware version is 0.6.0).
From documentation the system mode "manual" seems to allow just that but after setup I end up in device listening mode.
I have found this sugesting simply to interrupt listening mode - but being a noob - I haven't gotten it to work yet ( and it feels like a hack):
Short example to illustrate:
SYSTEM_MODE(MANUAL); // or SEMI_AUTOMATIC
int led = D7;
void setup() {
pinMode(led, OUTPUT);
// blink 10 times "high" frequency
for(int i = 0; i < 10; i++){
digitalWrite(led, !digitalRead(led));
delay(500);
}
}
void loop() {
// blink led with low(er) frequency
digitalWrite(led,!digitalRead(led));
delay(2000);
}
I would expect this to blink fast for 5 seconds and then blink slowly forever but it blinks fast and then goes into device listening mode. Any ideas on how to make the Photon just run my code?
There are no WiFi credentials on the device - it is band new and newly flashed just running the code in the example. The mode-LED is blinking blue (I assume this is WiFi listening mode and that that is blocking the loop() part of the example).
Ultimately what I want to do is to start the loop() do some data gathering and processing - and at some point down the line - provide WiFi credentials over a serial connection.
So I have had the device disconnected for a couple of minutes - then powered by an external power supply - and now it behaves as expected. Now even when reflashing i’m unable to reproduce the behavior previously described.