Local Flash vs Cloud Flash?

hi guys,

I continue my tests to connect to Azure via MQTT-TLS. the creator Hirotakaster advised to comment out a few options on the library files, and so far I can make the VSCode do a full local compile. However, I don’t have a Boron unit connected via USB, but only available via the cellular connection. Hence, I can’t make a local flash to the device. The question comes up:

is the cloud flash sending the modifications I did on the library on the VSCode project? or does it flash the device with the Particle IO original available library?

Thanks!

-R

Hi R,

In the future, in order for your devices to obtain an OTA (more than one), you will need to make the binary you created available either as the default firmware for your Product OR you can attach this new firmware to specific devices by using Groups.

To do this pretty easily, please use the Particle Console and upload your firmware via the Website, just to be sure you’re setting up the defined Flash for the devices desired correctly.

But since you’re working with just one device, simply type:

particle flash DeviceID appName.ino

thanks @lanceseidman

for some reason, when I type the command you suggest, it tries to compile and then fails. When I do a local compile it compiles fine, but not when I do the command.

My question is: if I do a cloud compile from the project I have, will it try to compile the libraries I have modified on my VSCode? or will it use the libraries available on the Particle platform? because what I need to do is compile and flash the code I have on my VSCode.

Thanks!

-R

when compiling via the cloud, libraries defined in your project.properties take precedence over those installed locally

Hi, I would tend to think that yes, it will compile and then flash the library with your modifications - as long as you do a local compile and then cloud flash.

If you wanted to verify this, can you add a Particle.publish() in your library so when you deploy it you are 1000% sure when you see this publish coming through?

thanks, I blelieve that is what happens. I do local compiles all the time, but wasn’t able to flash to the device remotely. However, I did a workaround and uploaded the .bin file, then on the device console selected the fw version, then checked the ‘flash now’ check box. Still testing, and still not connecting to Azure, but it’s moving!

-R

I did a little workaround where I uploaded the .bin from the local compile, then on the device console selected the fw version, and checked the box ‘Flash now’.

I will try your suggestion of adding a Particle.publish on one of the library files. I’ll let you know if it works!

-R

alright, so I did the check as suggested by @gusgonnet regarding adding a Particle.Publish in the library files, and it worked. In order to make it work, I did a procedure something like this:

  1. Create project on VSCode with Particle Workbench
  2. Install libraries required
  3. Write code
  4. Troubleshoot/modify libraries as needed
  5. Local Compile
  6. Upload .bin file from Local Compile to a Product created for this specific testing device
  7. On the Device console – edit – Unlock FW version – select newest version – check ‘Flash now’ box
  8. Reset device or wait for automatic new session. I have a Particle function where I can reset the device manually.

The scope of my project is to connect to Azure via MQTT-TLS, and that has not happened yet. I’ll continue the tests on that now. Wish me luck!

Thank you all for your support, this is a great forum.

-R

Hey, I wish you the best of luck and will leave you with my BEST advice in your situation:

  • I see you can't get the device to you to get console logs
  • so please use any device you have around (boron, argon, xenon-ok I'm pushing it a little) and use one device close to you to observe those console logs.
  • you will not regret

Cheers!

1 Like

I’ll reiterate what @m_m tried to suggest.
You can force a cloud compile to use your locally altered libraries by removing/commenting the dependencies entries for the respective libraries from the particle.project file.

Additionally I’m pretty sure you can send a binary to non-product devices via particle flash <device ID> firmware.bin

2 Likes