[RESOLVED] SYSTEM_MODE not working when compiling from Particle Dev (IDE)

I’ve copied (manually) my project from the web IDE, making sure I have a .ino file that is my ‘main’ file etc…

Project compiles fine on the web IDE, no issues at all. I upload (via DFU) and my Electron ‘breathes cyan’, as I’ve put it in SYSTEM_MODE(SEMI_AUTOMATIC).

However, when I compile in the cloud, via the Particle Dev IDE, and upload (via DFU) The Electron blinks green, not the normal ‘breathing cyan’ that I would expect from setting the SYSTEM_MODE.

Has anyone else experienced this?

Thanks

What system version were you targeting with Web IDE (Particle Build)?

Dev only does 0.5.3 currently.

You could also try

particle compile electron <yourProjectFolder>

This might give you more info about the build, especially the memory usage info, to compare with what Build tells you.

0.4.8 on the web IDE. Ok I’ll give that a try.

Yes, my Electron is on 0.4.8, so it should be within the firmware range of Dev. Compiled with CLI with no issues, but the same thing happens - the Electron tries to connect to cell.

@joearkay, in SYSTEM_MODE(SEMI_AUTOMATIC), the cloud connection will NOT be established unless you add Particle.connect() in your code. Thus the blinking green.

Hi @peekay123 Yes, that’s what I’m after. When I’m doing debugging I don’t want my Electron to connect to the cell. Instead, I use the Serial Monitor to read information. The cell signal where I live is bad and I can’t wait 10 minutes for the Electron to connect to the cell every time I update the firmware whilst building code, so I set it to semi automattic, so that it does not connect to the cell, and runs setup() and loop() immediately.

@joearkay, you may need to set SYSTEM_MODE(MANUAL) and also turn off the modem with Cellular.off() as the first thing in setup(). You can use SYSTEM_THREAD(ENABLED) to run the user code in its own thread. This will start the user code immediately on booting.

@peekay123, I could try this, but the issue is that the the SYSTEM_MODE(SEMI_AUTOMATIC) seems to work when compiling from the Web IDE, but not from the Particle Dev IDE. I’m updating the firmware on my Particle now to 0.5.2 to see if this fixes it.

@peekay123 @ScruffR The Particle will not update to 0.5.2 with the ‘Particle Device Updater’ software…it just hangs and then displays “Aw something bad happened… ;-(”. Tried over the CLI, I think it has updated but no way to know for certain…

I have also tried with the ‘blink an LED’ sketch setting SYSTEM_MODE(SEMI_AUTOMATIC) before setup() with the same issues…so it isn’t my code base

Nope, that won’t do.
Since Dev builds for 0.5.3 but your system is 0.4.8 that would not work. The system version has to be equal or greater than the applicatin version.

If the updater doesn’t work you can use one of the options explained there

2 Likes

Sorted it! You’re a genius!

2 Likes

By far not - but thanks for that :blush:

4 Likes

Thanks @ScruffR @peekay123 for the help!