Author Topic: Recovery from unsuccessful code upload  (Read 4084 times)

Z69

  • Newbie
  • *
  • Posts: 28
Recovery from unsuccessful code upload
« on: March 25, 2016, 11:24:58 am »
I am having issues where my Oak does not recover when my code upload fails.
This happen even tough Arduino indicated an successful upload and reboot, but i can see that it is not correct as the led keeps flashing.

Once this happen i then have issues getting my unit to link to my wifi network.
The ip address is then 192.168.4.1, opening this page then show that i am in "Soft AP Setup"
If i enter "http://192.168.4.1/connect-ap", it then connect to the AP that i used before and it is then online again.

Will i have to do this every time my uploads fail and my Oak become unresponsive?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Recovery from unsuccessful code upload
« Reply #1 on: March 25, 2016, 04:08:37 pm »
What is the text of the error you get on upload fail?

I'd suggest trying to go through the RAWGIT Firmware_update process again if you can get that started after powering up P1 to GND 3 seconds.

I only got one error - "Flash timeout - flash failed".  It hit ONCE and cleared the next time on one unit, it hit the hardest unit I had to get registered and Firmware_updated FIVE times, but it never went offline - would happily try and fail - before I re-Firmware_updated again with "LOCAL server" and it then worked a couple times before I parked it.  I also hit the Pin1 to GND at least twice on that unit - once for the initial Firmware_update - and once again just to shake it up.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Recovery from unsuccessful code upload
« Reply #2 on: March 25, 2016, 10:20:20 pm »
Does the code you are uploading involve any libraries that might be messing with the WiFi settings? Like ESP8266WiFi?

Z69

  • Newbie
  • *
  • Posts: 28
Re: Recovery from unsuccessful code upload
« Reply #3 on: March 26, 2016, 01:16:54 am »
Hi defragster

If i try to use the RAWGIT Firmware_update process, it does not connect to the oak when it is in this state.

Hi digistump

No, i have not loaded any code that mess with the wifi.
Only code i load is to drive a oled, SSD1306, wire and eeprom.

Here are screen shot from Particle and from Arduino
« Last Edit: March 26, 2016, 01:37:09 am by Z69 »

Z69

  • Newbie
  • *
  • Posts: 28
Re: Recovery from unsuccessful code upload
« Reply #4 on: April 08, 2016, 05:22:16 am »
Hi Digistump

Is there an alternative to OTA but still retain all the functionality of Oak?
The reason i am asking is that i am getting a very high rate of failure when i upload code to the oak, 99% of the time the code does not load.
Most of the time Arduino show timeout and every so often i get success from Arduino, but Particle show upload was unsuccessful.

Since i got my Oak, i have been able to upload code 3x.
It is very frustrating to not even use the basic test examples to flash a led on and off.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Recovery from unsuccessful code upload
« Reply #5 on: April 08, 2016, 11:48:14 am »
Not sure if there is a way around that doesn't preclude particle. 

However - I had one of my OAKS not upload like my others after UPDATE and particle register.  I went through the Firmware UPDATE again and then it worked 2 times in a row.  { I used the LOCAL SERVER UPDATE process as my 6 new ones all failed to get the UPDATE initially and register - even the two that gave the triple blink }  If you can get an UPDATE to process again - it might help?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Recovery from unsuccessful code upload
« Reply #6 on: April 08, 2016, 12:24:47 pm »
Hi Digistump

Is there an alternative to OTA but still retain all the functionality of Oak?
The reason i am asking is that i am getting a very high rate of failure when i upload code to the oak, 99% of the time the code does not load.
Most of the time Arduino show timeout and every so often i get success from Arduino, but Particle show upload was unsuccessful.

Since i got my Oak, i have been able to upload code 3x.
It is very frustrating to not even use the basic test examples to flash a led on and off.


If particle is showing the upload failed that does not mean it failed - this is a known bug with particle.

I haven't heard many reports of OTA updates timing out - that is interesting - does this occur even if you hold P1 to GND on power up (and remove the jumper about 5 seconds after) and then do an update from safe mode?

You can upload over serial - its documented on the wiki - use the serial option in the Arduino IDE, you need python installed, and you need to do a restore first or at least clear the bootloader config with this command:
<code>
esptool --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x1000 blank.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin
</code>

Z69

  • Newbie
  • *
  • Posts: 28
Re: Recovery from unsuccessful code upload
« Reply #7 on: April 09, 2016, 06:42:24 am »
Hi digistump

As per my post here - https://digistump.com/board/index.php/topic,2127.msg9792.html#msg9792 - i had endless issues getting my Oak to update to the latest firmware and only after getting local server update working could i get to Ver.1

That was why i was asking if you track update timeouts to see where in the world they occur.
That might give us pointers on how to solve the timeout issues.

Yes, this occur even if i hold P1 to GND on power up (and remove the jumper about 5 seconds after) and then do an update from safe mode?