Flash unsuccessful - Device not discoverable or is offline

I tried a few more things.

“particle list” shows that the device is online and has the digitalread/write analogread/write functions

“particle call device_name digitalwrite D7, HIGH” turns the LED on and it stays on which confirms the Blink program is not running. (and probably not actually installed)

I then compiled the program: “particle compile photon xxx.ino”

and “particle flash device_name photon_firmware_yyyyy.bin”
Flash success.

Web IDE events shows correct events and program seems to runs correctly (ie: variables and functions and JavaScript API calls are working) but I need to reinstall device in panel to confirm but it looks good.

I then tried to flash with the web IDE but that still doesn’t work. (“flash unsuccessful - Device not discoverable or is offline”)

The program that was flashed via USB still behaves correctly so the unsuccessful flash via the web IDE did not affect the device (which confirms that the “successful” flash of Blink didn’t actually work.)

I can now flash this device with the CLI but not with the web IDE. My other device can be flashed via the web IDE (same program, same software rev on both devices (rev 1.4.4) so the problem appears to be something to do with the particular device.

Steve

You have definetly targeted the correct device in Web IDE?

Yes, my test set up only allows me to connect one Photon to power at a time.

That’s not what I was asking :wink:

Can you show the status bar and the target drawer of your Web IDE?
What is the device name and ID of the Photon you have issues with?

Hi ScruffR

Here are the devices: (neither device is connected via USB to my computer - both are plugged into their own power supplies and they both show up my router as 2/4 GHz allowed devices with correct ip addresses.)

The device that causing the problem is “Alarm-Panel”. The screen grab below is just after power up after flashing via the USB (The events are as expected)

and today, I get a “flash successful” when I use the Web IDE to flash the “Alarm-Panel” device but no events are published. This is the same result I get when I flash the Blink program (ie: it says it flashed successfully but the program doesn’t run). The software in the device is unchanged.

So, at this point, I can flash the Alarm-Panel device properly via USB but I still can’t flash via the Web IDE. (Force Enable OTA makes no difference). I can flash the Test device via Web IDE with the same program that fails for the Alarm-Panel.

By the way, I appreciate the effort you’ve put into trying to get this to work.

Thanks
Steve

The console events names are truncated but what I can see is that there are several events missing that I'd expect to see when flashing a device - most notable the app-hash event which would indicate that a new application has been installed.

These are the events I'd expect to see

In your screenshot ths spark/flash/status events are not showing so I'd think your device never actually receives a new firmware as you are targeting the wrong device.

So I try it again: Can you show us your Web IDE status bar and target drawer?

Hi ScruffR

The target is the correct device. ‘Test’ works but ‘Alarm Panel’ doesn’t.

The events above were from powering up the Alarm-Panel device, not from flashing it. The power up events are correct (so the device is working). Here are the flash events from the ‘Test device’: (no events are published when flashing the ‘Alarm-Panel’)

If I turn on the Chrome / developer tools / console and open the Blink code, I get:

I don’t know if this is normal or not.

I’m not sure what you mean by the Web IDE status bar and target drawer? What do they look like?

Steve

This is the status bar (bottom of the window)

And the target (or devices) drawer pops out when you hit this icon
image

This would back my assertion that you are targeting the wrong device.
You need to select the correct device in Web IDE for the cloud to know which device to deliver the new application to.

Hence the request to see the Status Bar (right hand corner states the targeted device, its currently installed device OS version and online status - during flashing you'll also see the events issued to console).
The target/devices drawer is where you would select the desired device for OTA flashing. If the yellow star is not next to your Alarm-Panel device it is not selected.

e.g. my ScruffyBlue is currently selected but ScruffyE is not.
image

Hi ScruffR

I see that I have confused the issue by mentioning the ‘Test’ device. I used the ‘Test’ device to show that the events are being displayed properly when the ‘Test’ device is being flashed and is running. I also used it to show that the router, browser, etc, are all configured properly and to prove that my setup allows me to actually flash programs.

Let’s forget about the ‘Test’ device, and I have disconnected it. Now, the only device connected and online is the ‘Alarm-Panel’.

If I flash the ‘Blink’ program, I get:

As before, events are published, but the Blink program is not actually flashed. (the functions and variables from the program I flashed via USB are still there and respond as they should. )

If I fork the ‘Blink’ program, and I can compile it and I get ‘code verified, great work’ and when I flash it, I get " Device not discoverable or is offline:" and no events are published.

If I then re-flash the original ‘Blink’ program, I get the ‘Flash successful! Your device is being updated’ message, but no events are published.

Steve

This clearly shows that you are not flashing your Alarm-Panel device but still are targeting the now offline Test device.
image

I don’t know how much clearer I can say it. In that spot you must have Alarm-Panel written - if it’s not the new application will not be delivered to any other device than the one with the name that’s written there - in this case Test.

1 Like

3 posts were merged into an existing topic: Boron Unsuccessful Flashing after multiple OTA flashing tests

Hi ScruffR

Ok, now I understand - sorry for being so slow. What steps am I missing?

  1. I log into Particle IO.

  2. I click on Console

  3. In Devices, I click on Alarm-Panel

  4. I then I click on the code </> which brings up a new window.

image

and it shows ‘Test’ - I missed that, but why is is not showing ‘Alarm-Panel’ since that is the device I selected? and how do I change it?

Steve

Open the device/target drawer and click the star next to the device you want to flash

Hi ScruffR

Well, that was easy :slight_smile:

I shall now go back and re-read the documentation to see what else I’ve missed.

Thanks for all of your help.

Steve

Hi, I am having a similar issue with my Argon.
It was working properly till saturday, as the last vitals show, but now it is impossible to flash it through the web ide.
Situation is:
my device is breathing cyan, but is no discoverable. I am sure the target device is correct.
What I tried is:

  • update device firmware through particle cli. It was updated, device flashed magenta for a few minutes, then breath cyan, but still it’s not possible to flash via web ide
  • flashed my firmware through particle cli: it worked but still the device is not discoverable online and I can’t access variables nor functions.
  • I tried to add my device again to my account. It happened that the Particle Iot App showed me that the device connects to the network but it was not possible to create a secure session with the particle device cloud. Still the device is breathing cyan (and it has always done so).
  • When I reset the device these are the events shown.

I would like to now what I am missing or what can I do to make my device work again.

Thanks in advance,

Luca


last vitals

When you said you flashed new firmware via CLI, chances are that this new firmware causes the issue.
Have you tried putting the device in DFU Mode and flash OTA?
You can also put your device in Listening Mode and run particle serial inspect to see whether anything sticks out there.

When I updated the device OS via CLI, my argon was already not discoverable and this was a trial to put it back to work.
About your suggestion, I put the device in listening mode and run the particle serial inspect. Everything looks pass as the picture shows.

About flashing the OTA, I know how to go in DFU mode, but I don’t know how to flash the OTA. Can you please guide me? I couldn’t find it in the CLI.

immagine

Luca

A bit of history. Since my original posting, the device ran for about a year without any problems. I then added one line of code (a Particle.publish), OTA compiled, flashed successfully ( at least both the code and device windows said it was successful ) but the program did not work. I could not re-flash, as the Photon had gone off-line. I had to reset the device before I could flash it. To further complicate things, I could not flash backup copies that successfully compiled and flashed a year ago .

After talking with support, I removed bits of code, tried to flash, reset the device, removed more code, etc, until I eventually got it working again.

Each time the photon went offline, I needed to reset it before I could flash the device again. I did it so many times I broke the reset button on a Photon. I then wrote a windows batch file to put the device back online:

@echo off
particle usb dfu
start /W /b particle flash --usb tinker
start /W /b particle usb dfu
start /W /b particle flash --usb photon.bin
echo Done.

Every once in awhile the batch file failed to put the Photon online and I had to run particle device doctor before I could flash again. (sometimes I couldn’t even flash the blink program without the device going offline).

… and you can run device doctor in one command window and when it asks to reset the device to DFU, you can do it from another command window with ‘particle usb dfu’ so there is no need to push the setup/reset buttons.

I eventually discovered the problem to be with the Particle functions / variables and Particle.connect. I had the functions/variables at the start of setup() immediately followed by Particle.connect. I moved the Particle.connect to the end of setup() and the program now flashes properly.

By the way, I have a couple of spare Photons that behaved exactly the same way, so it not a hardware problem.

Unfortunately, Support says there is no way to know which version of the OTA compiler was used a year ago to successfully compile the code, or what changes have been made to the current OTA compiler. Making changes to old code with the OTA compiler is always going to be bit of a problem.

Hope this helps
Steve

I suggested to put your device into Listening Mode (breathing magenta) - this way the device is not running your fimware but only listens to the cloud which is the ideal condition to flash OTA (Over The Air) - e.g. via Web IDE

After putting the device into breathing magenta I could flash over the air.
I found out that I have an issue in my code. I still have to find out where, but I can solve the problem.
Thanks a lot