Electron wants to flash programs only OTA not serial

This might be quite basic but why does my Electron want to flash programs made in Particle build and saved in .io-files ONLY OTA and not using serial? I have succeeded in registrating my Electron and in flashing the firmware.bin so that's not the problem.The message in CLI goes as following:


Memory use:
text data bss dec hex filename
5532 8 1564 7104 1bc0
Compile succeeded.
Saved firmware to: /tmp/117013-28306-1xja21.vedgarwwmi.bin

! Flashing firmware Over The Air (OTA) uses cellular data, which may cause you to incur usage charges.
! This flash is estimated to use at least 0.007 MB, but may use more depending on network conditions.

! Please type 0.007 below to confirm you wish to proceed with the OTA flash.
! Any other input will cancel.
? Confirm the amount of data usage in MB:

What’s the command that you’re using?

1 Like

particle flash my_electron_name blinky

There’s the problem then:

So what should I do if I want to upload the blinky.io trough serial instead of OTA?

Use the appropriate command ;)? Check the help command (in the image above) to see which one to use.

1 Like
  1. particle flash --serial tinker //works fine
  2. particle flash serial firmware.bin //woks fine
  3. particle flash device_id blinky.ino //Wants to transfer the file trough OTA

So what do I have to use instead the third one to get the file there trough serial. Please answer :slight_smile: !

I don't get what you're trying to do...

if it works, for the very purpose it's made for, then why would you want to use something else, which is clearly not made for that task?

I’d try the middle one (from the help command) like this

particle flash --serial firmware.bin

I’d think the middle one (in your list) would work when you have a device called serial

1 Like

ScruffR yes I typed it here incorrectly, in CLI it worked fine with --serial.

Okay, Moors7, if I want to upload blinky.ino (so that my led in D/ would blink in my Electron) to my board without OTA using serial, what is the command i should use?

That?

If you want to flash via --serial you need a .bin file.
To get one of those from an .ino you need to compile it

1 Like

Thank you! The problem was that i didnt know that you can only flash .bin files trough serial and not e.g. .ino.

You always flash a binary to the device - never source code!
The command particle flash <deviceName> <source.ino> just hides the fact that you send the source.ino to the build farm which compiles it into a .bin but instead of handing it back to you (for download and USB flashing) forwards it directly to the OTA update endpoint which then loads the binary onto your device to be flashed there.

Thank you! I restarted my terminal and now it says “command not found” when I use particle -commands. What should my path be exactly to run particle-commands? I’m inside particle-cli -folder where there is app.js and particle.sh -files for example but commands are still not working.

You want to install the CLI globally so you can access it from anywhere. For Windows there’s an installer, but doing npm install -g particle-cli should do the trick as well.