Author Topic: Error Occurred while Flashing Device  (Read 10974 times)

brohan

  • Jr. Member
  • **
  • Posts: 59
Error Occurred while Flashing Device
« on: June 30, 2016, 05:18:41 pm »
I was running a program on my Oak just fine, which was successfully publishing to Particle just fine as well, which a dashboard I have was receiving just hunky dorey.

I noticed something was awry when I attempted to upload a new version of the program, when I received the following:

Using config file at: /home/bjrohan/.oak/config.json
Sending file to cloud, to flash Brian_Oak (Device ID: xxxxxxxxxxxxxxxxxxxx)

Error : An error occurred while flashing the device:

Upon checking my Particle account, it shows that my device shows connected when powered, and when I disconnect oak power, my Particle account responds accordingly, showing disconnected.

I tried uploading a very basic Pin 1 flash program and received the same error message.

My original program is still on my Oak, and functioning as far as I can tell as expected, however it's not publishing any Particle logs as it was before.

I also restarted the Arduino IDE, same issue.

Any ideas what is going awry, and how to correct it?

FWIW my son has another Oak, connected to the same wi-fi network, and he can flash new programs and publish to Particle just fine.

Thank you for the input.
« Last Edit: June 30, 2016, 05:26:25 pm by brohan »

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: Error Occurred while Flashing Device
« Reply #1 on: June 30, 2016, 08:13:50 pm »
It sounds like you may running into the same problem I've experienced. See my thread on the Particle forums for a description: https://community.particle.io/t/anyone-else-not-seeing-events-from-their-devices/21854. I've seen one similar report on this forum too: https://digistump.com/board/index.php/topic,2265.msg10612.html

I'm fairly confident it's a bug in Particle Cloud. I've run a myriad of tests and have even captured and analyzed the traffic between the Particle Cloud and my Oak. All the communications with the cloud are normal. Events published by the Oak get sent to the cloud correctly, but the cloud never passes them on. It seems to be Oak-specific, as there are no reports of this problem with Cores, Photons or Electrons.

I've been trying to debug this with the people at Particle, but things seem to have ground to a halt recently. I haven't heard from them in quite some time. If your problem appears to match, it would be great if you could post in the above Particle forums thread. If they hear that the issue affects other people too, I think they'll be more likely to do something about it.

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #2 on: June 30, 2016, 09:59:16 pm »
Thank you for the cross posting suggestion.

To note, when I go to the OakTerm, the dashboard shows my Oak as being offline, however when I look under the Device Info tab, the last_heard counter reflects the near current time. Unplugging my Oak, keeps the status as offline, while also stopping the last_heard, as I would expect.

Why would it show offline + have a current last_heard?
« Last Edit: June 30, 2016, 10:01:18 pm by brohan »

PeterF

  • Hero Member
  • *****
  • Posts: 883
Re: Error Occurred while Flashing Device
« Reply #3 on: June 30, 2016, 10:11:28 pm »
Have you tried uploading your new program whilst in safe mode (P1 to GND on boot)? I had that issue before (online on particle, program working but error occuring on upload - was a couple of weeks ago though) and the Oak seemed to be less stubborn about taking the new program when it was in safe mode. I still agree with kh's feeling that it is something on the Particle end, so maybe it was just a coincidence that the safe mode boot cleared things up.

I've also noticed that my Oak with attached TFT LCD almost always won't accept a new program when the display is attached unless I'm in safe mode... don't know if that has any bearing on this (1.0.1 fw - hasn't had any code changes in a while)

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #4 on: June 30, 2016, 10:35:23 pm »
Thank you for the reply PeterF. I put my Oak into safe mode, then went through the connection process by connecting to its WiFi. After reconnecting to my Wifi, i received the Successfully connected to Particle message, unfortunately, no change from what I can tell. Particle shows it as on, however not receiving logs. The Oakterm shows it as offline, however the last_heard is updating with current time. I still can't upload via the Arduino IDE.

Original program is still in Oak memory and working fine.

PeterF

  • Hero Member
  • *****
  • Posts: 883
Re: Error Occurred while Flashing Device
« Reply #5 on: July 01, 2016, 01:22:27 am »
Drats! btw, I should have been clearer before (as you didn't need to go through the wifi configuration process again) - if the oak is in safe/config mode, it will still connect to it's configured access point and particle if it can (and you'll see on the particle dashboard log a message about it being in config mode), and you can load a program onto it whilst it is in that state. It is there to prevent the Oak from ending up in a state where you can't program it at all if there is something wrong in your sketch. However, that all hinges on Particle working as well! :-O

If you are so inclined, try putting it into safe mode again, but don't configure it - just leave it for say 30 seconds, and see if it appears online on OakTerm/Particle dashboard, or says that it is in config mode...

You should see something like this on OakTerm. For me the online tag came on, and the uptime also updated...
Code: [Select]
[18:22:24] Event: spark/status - online
[18:22:36] Config Mode

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #6 on: July 01, 2016, 06:06:58 am »
I put the Oak into safe mode again, and left it there for a few minutes with the LED blinking away, it never appeared online in the Particle dashboard, or on Oakterm. In Oakterm it didn't register the last_heard. It stayed where it was when I unplugged the unit.

I then went through the configuration for my Wifi, which took it back to the state it's been in, showing connected on Particle, and giving a last_heard in Oakterm, but no communication otherwise.

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: Error Occurred while Flashing Device
« Reply #7 on: July 01, 2016, 08:00:27 am »
To note, when I go to the OakTerm, the dashboard shows my Oak as being offline, however when I look under the Device Info tab, the last_heard counter reflects the near current time. Unplugging my Oak, keeps the status as offline, while also stopping the last_heard, as I would expect.

Why would it show offline + have a current last_heard?

This conflicting info comes directly from the Particle Cloud! It comes from the ParticleJS / Cloud API list devices call. OakTerm uses the "connected" value for offline/online and then last_heard for last_heard. When I saw this with my Oak, this is what first tipped me off that it was probably a bug on Particle's side.

Definitely sounds like you have the same issue as me.

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #8 on: July 01, 2016, 08:09:08 am »
No response yet to my post on the Particle forums under the Troubleshooting section FWIW.

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #9 on: July 01, 2016, 08:49:52 am »
For anyone interested I have inquired on the particle IRC channel.

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #10 on: July 02, 2016, 10:36:41 pm »
Over the past few days I have been unplugging, and re plugging my Oak, as well as putting it in safe mode, all to no avail. This last attempt however, upon a safe mode (to try to upload the prgram, to no avail), now my particle account doesn't show my device as being on, however after running the "http://rawgit.com/digistump/OakSoftAP/master/config.html" process my browser said my Oak connected successfully. Perhaps it was getting that info merely from the fact that my Oak had been registered with Particle before?

I am getting quite discouraged by this. I was enjoying learning how to program and use the device.

Any other helpful hints?

Thank you.

weaslyd

  • Newbie
  • *
  • Posts: 3
Re: Error Occurred while Flashing Device
« Reply #11 on: July 03, 2016, 09:59:30 am »
It seems I'm having the same issue. I have two oaks running in a project that are still on pre-1.0 firmware and appear to be working correctly. Over the last few days I have spent some time with a third and fourth Oak, updating to newer firmware and uploading a simple sketch. Each worked fine for a bit, but now cannot be programmed. Have tried multiple steps to recover, all to no avail. I suppose a post on the Particle forum couldn't hurt ...

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #12 on: July 03, 2016, 10:58:49 am »
I have a post on the particle forum, under troubleshooting, with the same title as this one, in case you'd like to follow, as well as post your own. If you do post there, please let me know so that I may follow yours as well.

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: Error Occurred while Flashing Device
« Reply #13 on: July 03, 2016, 12:15:54 pm »
I suppose a post on the Particle forum couldn't hurt ...

Yes, please do post there. The more attention we can draw to this issue, the more likely they will investigate it further.

PS Due to the Independence Day holiday in the US, we're not likely to see any response from the Particle staff until Tuesday (or later, since they probably will have a backlog to clear)

brohan

  • Jr. Member
  • **
  • Posts: 59
Re: Error Occurred while Flashing Device
« Reply #14 on: July 04, 2016, 07:08:03 am »
FWIW I am running V6 of the firmware. Should I attempt something different?