Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception 28 #16

Closed
DarkLotus opened this issue Jan 24, 2016 · 86 comments
Closed

Fatal Exception 28 #16

DarkLotus opened this issue Jan 24, 2016 · 86 comments

Comments

@DarkLotus
Copy link
Contributor

@DarkLotus DarkLotus commented Jan 24, 2016

Ran Wifi Config, connected to cloud, received update.
confirmed update with /system-version

I wiped out my 0.9 in ardunio and installed 0.9.1.

Built blink sample with Particle.delay. Flashed over the cloud then

Fatal exception (28):
epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00637ff0, depc=0x00000000

I grabbed the boot output as well which is as follows:

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 3632, room 16
tail 0
chksum 0xc0
load 0x3ffe8000, len 352, room 8
tail 8
chksum 0x82
csum 0x82

OakBoot v1 - N,BP,0

Tried grounding pin 10, but doesnt appear to change anything.

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 24, 2016

Okay i read the oakboot source.

Grounding pin 10 it boots with N,BU,0 instead of N,BP,0

which i hadnt noticed before.

But then it spams Fatal 28 the same as above since its loading the same rom i guess.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

Anyone getting a Fatal Exception error after successfully connecting to Particle and trying to upload a sketch, if you can please do the following, the more people who can do this the better I can diagnose the issue (as I haven't been able to reproduce yet):

  1. Make sure you have python installed and in your path and a serial adapter to connect your Oak.
  2. Grab an unzip this script: https://github.com/digistump/OakCore/files/102522/esptool.zip
  3. Connect pin 2 to Gnd and power up your device. This puts the hardware bootloader in serial mode.
  4. From a command line with your Oak attached via Serial Adapter run "esptool.py --baud 115200 --port COMX read_flash 0x000000 0x300000 flash_dump.bin"
  5. Email (don't upload as it may be possible to get your network password from this file, don't send if you aren't comfortable sending that to me, I will of course not use or keep it) the flash_dump.bin file to support@digistump.com
  6. Comment as to specifically what error you are seeing - uploading or pasting the serial log is even better.

File for dumping flash:
esptool.zip

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

Also if anyone seeing this error wants to try this - unzip the file attached to this and put it in the same folder as esptool.py from the post above this.

Follow 1-3 above then run the command "esptool.py --baud 115200 --port COMX write_flash -fs 32m 0x3fc000 blank.bin 0x3fd000 blank.bin 0x3fe000 blank.bin 0x3ff000 blank.bin"

Please do a flash dump per above first, then try that, and let me know if your unit can then boot - again serial log is best.

blank.zip

@nkildal
Copy link

@nkildal nkildal commented Jan 24, 2016

Hi Erik

My Oak is spamming with Fatal 28 exceptions when I power it up (also with pin 10 grounded)
Trying to dump from it, but I get the following:

MacBook-Pro-2:Oak_debug nicolai$ ./esptool.py --baud 115200 --port /dev/tty.SLAB_USBtoUART read_flash 0x000000 0x300000 flash_dump.bin
Connecting...
A fatal error occurred: Failed to connect to ESP8266

I also tried grounding pin10 before applying power to the board, but with the same result.
Also tried using a baud rate of 74880 - also without success.

Do I need to something else to get the flash image dumped?

/Nicolai

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

@nkildal Sorry - I missed an important part in my instructions - please connect Pin 2 to GND and then power up and dump the flash - same for writing files to flash - this puts the device in the serial bootloader mode - you'll need to power cycle it after a write or dump to put it back in the serial bootloader mode again.

@nkildal
Copy link

@nkildal nkildal commented Jan 24, 2016

No problem - it worked!
I've attached my dump file.

Removed for security reasons.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

Thanks @nkildal - if you don't mind trying the possible fix (it's a bit of a shot in the dark, but won't disable the Oak any further) - I'd love to hear if it works for you, I'll take a deep look at the dump file later today or first thing tomorrow, but at a glance nothing obvious yet.

@nkildal
Copy link

@nkildal nkildal commented Jan 24, 2016

I tried writing the blank.bin file:

MacBook-Pro-2:Oak_debug nicolai$ ./esptool.py --baud 115200 --port /dev/tty.SLAB_USBtoUART write_flash -fs 32m 0x3fc000 blank.bin 0x3fd000 blank.bin 0x3fe000 blank.bin 0x3ff000 blank.bin
Connecting...
Erasing flash...
Wrote 4096 bytes at 0x003fc000 in 0.4 seconds (85.1 kbit/s)...
Erasing flash...
Wrote 4096 bytes at 0x003fd000 in 0.4 seconds (85.1 kbit/s)...
Erasing flash...
Wrote 4096 bytes at 0x003fe000 in 0.4 seconds (85.1 kbit/s)...
Erasing flash...

A fatal error occurred: Failed to enter Flash download mode (result "0x1, 0x6")

Powering down and up again, gives me repeating fatal (28) exceptions on serial...

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

Looks like the final one failed @nkildal - can you try just this:

esptool.py --baud 115200 --port COMX write_flash -fs 32m 0x3ff000 blank.bin

@nkildal
Copy link

@nkildal nkildal commented Jan 24, 2016

Here goes:

MacBook-Pro-2:Oak_debug nicolai$ ./esptool.py --baud 115200 --port /dev/tty.SLAB_USBtoUART write_flash -fs 32m 0x3ff000 blank.bin
Connecting...
Erasing flash...

A fatal error occurred: Failed to enter Flash download mode (result "0x1, 0x6")
@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

And a little more background - what we're trying here is blanking out where the Oak stores wifi config data - not the SSID and passcode which is saved in the particle config area and CRCed on save, but the data it uses to reconnect quickly to a known good network - it is the one area I have no control over as it is written inside the ESP8266 SDK, which is why I suspect it might be at fault.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

blank2.zip
Hmm @nkildal - how about this file with

esptool.py --baud 115200 --port COMX write_flash -fs 32m 0x3fe000 blank2.bin

If that doesn't work I'll hold off on any more hunches until I successfully reproduce the issue so I can test locally.

If that doesn't work - if you don't mind doing a full dump (the one before was only the most important 3/4) so that maybe if I load your full rom into one of mine I can reproduce the issue:

esptool.py --baud 115200 --port COMX read_flash 0x000000 0x400000 flash_dump_full.bin

Probably best to email the result as I realized that it could present some security issues, it is possible to deconstruct the file and get someones WiFi password - of course don't send it, if you are not comfortable sending that to me (I won't use it nor even care to look at it, but I want to be clear as to what is being sent). I removed the one you uploaded earlier for the same reason.

Thanks for all your help.

@nkildal
Copy link

@nkildal nkildal commented Jan 24, 2016

Ok - tried blank2.bin:

MacBook-Pro-2:Oak_debug nicolai$ ./esptool.py --baud 115200 --port /dev/tty.SLAB_USBtoUART write_flash -fs 32m 0x3fe000 blank2.bin
Connecting...
Erasing flash...
Wrote 8192 bytes at 0x003fe000 in 0.8 seconds (85.2 kbit/s)...

Leaving...

Disconnecting power, removing GND on pin2 and powering up again, still gives me a steady green light - serial console still shows scrolling fatal exception 28 :-(

I'll go ahead and produce a full dump, and send it to you in an email - I have no issues sending you the data - just happy to help out :-)

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 24, 2016

Awesome @nkildal - thanks again - next chance I get I will try loading it into an oak and see if I can reproduce

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 25, 2016

Here is a dump of mine as well, wifi passwords are for suckers, so nothing personal in here.

My AP it "should" be connected to is called "KKLOLK"
Another AP within range is called "belkin.743c" and the third one in range is "Speedweb" something

I noticed at offset 0x100B1D and 0x200B1D there is a string "KKLOLK.743c" which seems strange?
flash_dump_full.zip

Could i dump one of my working oaks and flash it? or would that give me a world of pain and conflicting device id's lol

Bit off topic but, if i power my oak from dedicated wall psu, rather than my USB hub I would then need a ground line for serial yes? I assume im getting away with tx/rx only since my stlink and the oak are powered via same USB hub currently?

If that's the case just a jumper between grnd on the oak and grnd on the st link would be all thats needed?

Using an ST-Link v2 from the top of a STM nucleo development board.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 25, 2016

Awesome - thanks! @DarkLotus

I wouldn't advise moving a dump from one to the other - you could dump a good one from 0x0 to 0x201000 and then replace the device ID's with the ones from this dump - you'll find them just past 0x100000 and 0x200000 but ymmv

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 25, 2016

think ill wait, i dumped a good firmware and there is quite a few differences apart from the user rom sections.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 26, 2016

@DarkLotus Would you mind compiling and uploading the bin file produced by the same Blink example you flashed with Arduino IDE - hit "Verify" instead of "Compile" and then grab the path to the bin file from the output at the bottom of the window. (You may need to turn on Verbose compiling in the preferences). I've got a way to fix the bricked units, and some ways to avoid this from bricking units, but still no idea why this occurred unless the compiled bin file was actually bad to start with.

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 26, 2016

sketch_jan22a.cpp.zip
Here you go. built with the same ardunio / oaktools etc install as what killed mine.

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 26, 2016

Comparing my bad bin to the sketch bin, its byte for byte there. so my compiled sketch must be bad?

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 26, 2016

@DarkLotus yes that's exactly what I'm thinking - what OS was this compiled on?

Mind also uping the exact sketch and the .elf file from the same folder as the bin? - I'll compile the sketch and compare, and the elf can be used to disassemble and see where the error occurs

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 26, 2016

@nkildal - What OS were you using? Any chance you can upload the sketch, bin and elf as requested of @DarkLotus above?

Thank you both for helping unravel this mystery!

@nkildal
Copy link

@nkildal nkildal commented Jan 26, 2016

@erik: I'd love to, but it has to wait until I get home from work in about 8 hours - 7:15AM here in Denmark :-)
If you've not fixed the issue by then, I'll upload the files as soon as I get home.
My OS is Mac OSX El Capitan 10.11.

The sketch was the blink example with the two Particle.delay() lines..

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 26, 2016

@nkildal - thanks! that is actually all I need to know, there is a very definite pattern developing here - if @DarkLotus says he is on OSX and even more so if he was on El Cap - then 100% of people who have written to me with this issue are on El Cap

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 26, 2016

Compiled on Linux x64, Ardunio 1.6.5

sketch_jan22a.elf.zip
void setup() {
// initialize the digital pin as an output.
pinMode(1, OUTPUT); //LED on Model A
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(1, HIGH); // turn the LED on (HIGH is the voltage level)
Particle.delay(4000);
// wait for a second
digitalWrite(1, LOW); // turn the LED off by making the voltage LOW
Particle.delay(1000); // wait for a second
}

I can do a build on OSX 10.10 or Windows as well if needed

@ripred
Copy link

@ripred ripred commented Jan 26, 2016

@erik: Can confirm, once Nicolai Kildal and I found some issues with oak.js via comments on the KS comment section on OS X (me El Capitan 10.11.3) and I initiated the upload of my first sketch, it was bricked after that. My serial adapter is still somewhere in a box from my move from California so haven't been able to contribute to this thread. But yes, El Cap here. Firmware upgrade seemed to go fine, registered with particle fine, good to go. First upload via the oak.js (via Node.js and corrected code) seemed to brick it. Powered via USB on Mac Pro desktop. For what clues it might add I'm an IOS dev with probably their latest updates to gcc/LLVM &c. if that matters at all.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 26, 2016

@ripred - Thanks for the info!

@DarkLotus, @nkildal

Here is what I've figured out this far, in case any of you are interested in the details:

  1. Compiling on Windows vs OSX and Linux 64 produces a very different bin file. (Unconfirmed but given that I developed on Linux32 as well, Linux32 may produce something similar to Windows)
  2. The differences are from compilation - not related to esptool2 or oakcli.
  3. This has nothing to do with the OTA upload itself as that gets CRC checked 3 different ways (one on a packet by packet basis during transfer, one at end of transfer, one on boot)
  4. This exposed a bug in the ESP8266 SDK (aka we can't fix it) where the ESP8266 goes into a fatal exception loop without rebooting like it is supposed to - this prevents our bootloader from kicking into safe mode (aka config mode).
  5. This also exposed a bug in our code that prevented the GPIO Pin10 recovery mode from working. (a flag wasn't set to enable it)

To deal with #4 I've added a bunch more logic around when to consider a new rom file as good, namely instead of just booting it needs to actually run, and also some extra logic for when to jump into this mode. I've also fixed the Pin10 entry into config mode.

I've booted one of my computers into OSX to address the main issue, but haven't got too far in terms of results yet - things/thoughts on my list:

  1. Is it 32 vs 64 bit related? As in was the compiler for 64 bit machines compiled differently to cause this error.
  2. Decompile both ELF files and compare.
  3. Decompile the bad ELF file and find where the exception occurs.
  4. Use the bad bin file to test the new logic for when to enter safe mode.
  5. Try using the latest files from ESP8266 core, see if that fixes anything, look at commits for any hints.

Thank you all again for your help! More tomorrow!

@digistump digistump changed the title Fatal Exception 28 BOUNTY: Fatal Exception 28 Jan 26, 2016
@digistump
Copy link
Collaborator

@digistump digistump commented Jan 26, 2016

I thought I'd add a bounty on this - in case someone wants to figure it out before I get back to it tomorrow.

TASK:
Figure out why sketches compiled on OSX/Linux64 are failing with an exception loop and implement a fix.

HOW TO TEST:

Manually upload the bin file created when you compile the sketch, using the following command (blank.bin is attached:
blank.zip
):

esptool.py --baud 115200 --port /dev/tty/YOURPORT write_flash -fs 32m 0x1000 blank.bin 0x101000 blank.bin 0x2000 YOURSKETCH.bin

Confirm that it fails with a fatal exception loop on the serial monitor with the current install. Then confirm that it succeeds (by watching via serial monitor and making sure the blinking executes) with your fix.

NOTE: blank is just being used to overwrite the bootloader config (and backup copy of the bootloader config) to force it to boot into rom 0, where the bin is being written

BOUNTY: $150 cash or $225 store credit or 25 Oaks (your choice) - subject to terms of the otehr bounties listed on here. Claimed by DarkLotus

Bootloader layout for those curious why blank is being written to those locations:

0x000000 boot
0x001000 boot config
0x002000 rom0
0x100000 particle config 
0x101000 boot config backup
0x102000 rom1
0x200000 particle config backup
0x201000 boot key sector - direct write area
0x202000 rom2
0x300000 1MB filesystem
0x3fb000 EEPROM sector
0x3fc000 sdk config (4 sectors)

Sketch for testing:

void setup() {

// initialize the digital pin as an output.
pinMode(1, OUTPUT); //LED on Model A

}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(1, HIGH); // turn the LED on (HIGH is the voltage level)
Particle.delay(4000);

// wait for a second
digitalWrite(1, LOW); // turn the LED off by making the voltage LOW
Particle.delay(1000); // wait for a second
}
@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 26, 2016

Just to let you know your on the right track, i flashed the same sketch from windows. and my dead oak is back to life. You missed the blank.bin, but if anyone wants to follow the above, you want a 4kb blank.bin
blank.zip

@nkildal
Copy link

@nkildal nkildal commented Jan 27, 2016

Ah - sorry erik :-)

@ajpowell:
I am running 10.11.3 - your topmost esptool error looks like it may be a communication problem?

@digistump:
I finally got some progress flashing an OSX generated bin file from Windows 10.

I compiled the blink sketch on OSX El Capitan 10.11.3 and then transferred the bin file to a Windows 10 machine, where I then flashed my Oak.
I tried various combinations of c, c.elf and cpp compiler -O flags in platform.conf - all except one combination failed to create a working bin file:
I only ended up with a working bin file, when all 3 flags were set to -O2 :-)

So: compiling on OSX 10.11.3 with all 3 flags changed from -Os to -O2 and then transferring and flashing the bin file on Windows seemed to work for me.

Perhaps the above information is useful - I'm a bit confused :-)

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 27, 2016

Morning all!

@ajpowell Are you sure you have a stable connection? I know to begin with i had some dodgy soldering on one of my ground pins and getting into serial flash mode was hit and miss.

@nkildal Glad to hear it worked for you, Looks like we can confirm -O2 as working on all platforms then, for the blink example anyway.

Interesting that just -O2 on cpp works for linux, but osx needs all three, we must be hiding a deeper issue lol.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 28, 2016

Github is back!

@nkildal - Did you completely exit and restart Arduino IDE between changes to the -O flags? Just a recompile won't force it to refresh the platforms.txt data.

Building a new beta firmware with -O2 on all three for now - but I agree @DarkLotus , something bigger seems to be going on here.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 28, 2016

Instruction for restoring Oak to factory: http://github.com/digistump/OakRestore

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

@digistump - hmm no I did not restart the IDE between the changes - I do however see different file sizes for the bin files.

Well - I also feel something bigger is going on, so I'll stop fooling around and instead try to use your factory restore instructions on my 2 of my 3 Oaks tonight, making sure the serial adapter and power conditions are optimal..

@ajpowell
Copy link

@ajpowell ajpowell commented Jan 28, 2016

@DarkLotus - loose connection could be the problem - currently have the Oak connected via some headers in a breadboard - I'll try soldering those tonight when I get home - however, when I transferred my usb connector between systems, I'm pretty sure the breadboard didn't get moved - I'll let you know how I get on.

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 28, 2016

@nkildal - interesting, I guess I'm wrong about it - it must only be boards.txt that requires a restart to update, often deciphering how the Arduino IDE does things takes a bit of magic! (or reading java sources)

Thanks - let me know how the factory restore goes!

@ajpowell
Copy link

@ajpowell ajpowell commented Jan 28, 2016

@digistump - Thanks - Will try this tonight when I get home.

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 28, 2016

Past midnight here so i cant test any further tonight but testing with a fresh oak.
Run SoftAP, Oak reboots, appears to grab firmware (15 secs of fast flashing), never connects to particle though.
Re ran setup a few times without any change in behaviour. Will get some Serial logs in the morning.

@cpetito
Copy link

@cpetito cpetito commented Jan 28, 2016

@digistump - I updated the Arduino IDE to 0.9.2 and now get the following error while trying to compile the simple blink sketch:

Arduino: 1.6.7 (Windows Vista), Board: "Oak by Digistump, 80 MHz, Particle OTA, OAK (4M/1M SPIFFS), Single - 1MB (Fullsize)"
--- snip ---
Board oak (platform oak, package digistump) is unknown
Error compiling.

Any thoughts as to how to investigate/correct this issue?

BTW, the previous version worked fine. In fact I was able to compile the web server example and load it via the serial link with no issues.

Thanks!

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

@digistump - Good news!

2 previously bricked Oaks successfully restored to fresh working order, using the method described in http://github.com/digistump/OakRestore

Everything done from my Mac, running El Capitan 10.11.3.
Oaks power supplied using 2A wall wart - programmed using serial TTL adapter with GNS/TX/RX connected to Oaks.

Next step: programming using Arduino IDE :-)

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

Did the following (all steps on Mac OS X El Capitan 10.11.3):

  1. shut down the Arduino IDE
  2. deleted the ~/Library/Arduino15 directory
  3. started the Arduino IDE
  4. added "http://digistump.com/package_digistump_index.json" as additional board manager url in preferences
  5. tried to the Digistump Oak board in the boards manager

It failed showing this error message:

 Invalid archive: it must contain a single root folder while file __MACOSX/ is outside 0.9.1/
java.lang.RuntimeException: java.io.IOException: Invalid archive: it must contain a single root folder while file __MACOSX/ is outside 0.9.1/

Had a look inside the ~/Library/Arduino15/stagingpackages/oakcli-0.9.1-osx.zip file:

MacBook-Pro-2:packages nicolai$ unzip -l oakcli-0.9.1-osx.zip 
Archive:  oakcli-0.9.1-osx.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  01-26-16 11:26   0.9.1/
 19526676  01-24-16 04:52   0.9.1/oak
        0  01-26-16 11:26   __MACOSX/
        0  01-26-16 11:26   __MACOSX/0.9.1/
      222  01-24-16 04:52   __MACOSX/0.9.1/._oak
 --------                   -------
 19526898                   5 files

I then replaced the oakcli-0.9.1-osx.zip file, with a new file, where the __MACOSX directory was removed. Restarted the Arduino IDE, went into the Boards Manager and added the board again - this time with success :-)

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

I seem to be unable to flash my Oaks via the Particle cloud.
Configuring the "oak" binary - entering my user/pass and selecting the destination Oak - woks fine.
The upload and flash start seems to also work, but nothing happens on my Oaks:

Sketch uses 259,370 bytes (24%) of program storage space. Maximum is 1,040,368 bytes.
Global variables use 51,064 bytes (62%) of dynamic memory, leaving 30,856 bytes for local variables. Maximum is 81,920 bytes.
/Users/nicolai/Library/Arduino15/packages/digistump/tools/oakcli/0.9.1/oak /var/folders/wg/s_dd80c14z7dlyzgzh96mn640000gp/T/build9be48dc9aa0fd82acc80b50bcacd7309.tmp/DigistumpOak_HelloWorld.ino.bin 
Sending file to cloud, to flash to device.
Device flashing started successfully.

Is the cloud functionality disabled, while we debug?

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 28, 2016

@nkildal - thanks for the tip on the oakcli - I will get that fixed

The ones you are trying to do the OTA with - did you go back through the initial setup process to download the update with them? You will need to do that before they can be flash over OTA - to do so just plug them in and do "I'm just configuring the wifi" but watch the LED, if it only blinks fast for a few seconds you'll need to retry until it blinks for at least 20-40 seconds. (and to answer your question - no, cloud functionality should be working and I tested it before releasing with some fresh oaks)

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 28, 2016

@cpetito - looking into it now, its working on windows for me, but trying a fresh install - will follow up on it here #19

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

Well - actually my Oaks did not seem to want to register on the cloud, so:
I did another factory restore of one Oak, then went to http://build.particle.io and removed both oaks.
Followed the procedure at http://rawgit.com/digistump/OakSoftAP/master/config.html, registering a new device. Firmware seemed to download (rapid blinks for minute or so), but the Oak never show up in the Particle cloud and the SoftAP never verified it.
Boot messages on serial (74880 baud) says:

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 3632, room 16 
tail 0
chksum 0xc0
load 0x3ffe8000, len 352, room 8 
tail 8
chksum 0x82
csum 0x82

OakBoot v1 - N,BP,8

I can see that my Oak connects to my wifi and grabs an IP address...
Anything else I can try?

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 28, 2016

That sounds like the perfect procedure and your serial log is as expected - it is booting to the updated firmware at location 8

what do you get at 192.168.0.1/particle - when connected to the Oak AP of course

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

Hmm - I can't seem to make it boot into AP mode - connecting pin 10 to GND and applying power gives this output on the serial console at 74880 baud:

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 3632, room 16 
tail 0
chksum 0xc0
load 0x3ffe8000, len 352, room 8 
tail 8
chksum 0x82
csum 0x82

OakBoot v1 - N,BP,8

I can see it connects to my wifi and grabs an IP address - just like when booting normally (without pin 10 grounded).
Browsing to this ip on /particle gives me nothing - seems like no web server is running:

MacBook-Pro-2:OakRestore-master nicolai$ ping 10.0.0.196
PING 10.0.0.196 (10.0.0.196): 56 data bytes
64 bytes from 10.0.0.196: icmp_seq=0 ttl=255 time=1.912 ms
64 bytes from 10.0.0.196: icmp_seq=1 ttl=255 time=4.561 ms
64 bytes from 10.0.0.196: icmp_seq=2 ttl=255 time=1.490 ms
^C
--- 10.0.0.196 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.490/2.654/4.561/1.359 ms
MacBook-Pro-2:OakRestore-master nicolai$ telnet  10.0.0.196 80
Trying 10.0.0.196...
telnet: connect to address 10.0.0.196: Connection refused
telnet: Unable to connect to remote host
@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

Just did a factory restore on my other Oak - connected to the Oak AP.
Now http://192.168.0.1/particle gives me:

File Not Found
@ajpowell
Copy link

@ajpowell ajpowell commented Jan 28, 2016

@digistump - I updated the Arduino IDE ion a similar way to @nkildal, but didn't get an error - checking /staging/packages, I see that oakcli-0.9.1.zip only contains 0.9.1/oak...so I guess you have already updated that - great! Should that not be 0.9.2? Though Boards Manager does show that 0.9.2 is deployed...

Needed to check I'd got the correct Oak selected, so went to the deployed copy of oak, but find that it is not executable i.e.

Adrians-MBP:0.9.1 apowell$ pwd
/Users/apowell/Library/Arduino15/packages/digistump/tools/oakcli/0.9.1
Adrians-MBP:0.9.1 apowell$ ls -lrt
total 38144
-rw-r--r--  1 apowell  staff  19526676 24 Jan 03:52 oak

A simple chmod 755 oak, fixes this, of course. Need to do the same for esptool2 as well:

Adrians-MBP:0.9.1 apowell$ pwd
/Users/apowell/Library/Arduino15/packages/digistump/tools/esptool2/0.9.1
Adrians-MBP:0.9.1 apowell$ ls -lrt
total 40
-rw-r--r--  1 apowell  staff  18112 18 Jan 18:39 esptool2

This occurred on both Yosemite and El Capitan.

Reset Oak successfully using OakRestore - had to do chmod 755 on esptool.py (ah...except just realised why you put 'python esptool.py ...' now - doh!)

Connected to the Oak AP - 192.168.0.1/info gives sensible data; 192.168.0.1/particle gives File Not Found.

I have just been trying to get this Oak connected to Particle - had to try a couple of times then got it - no shows as active on the Particle dashboard -I didn't delete from the Particle dashboard before hand (can't see how to, to be honest!)

Built and complied the code given above in the Arduino IDE and deployed OTA from my Yosemite machine - and SUCCESS! My Oak is now flashing 4s on, 1s off.

So, in summary:

  • OakRestore works OK to reset to factory conditions (albeit keeping the Particle data)
  • Building on Mac OSX appears to be working correctly (couple of minor issues around permissions on binaries)
  • Deploying OTA is also working - deployment is a little slow, took a couple of minutes in my case but this was mentioned in an earlier post somewhere - improvements should been seen once beta tests are complete.

And on that note, I'm calling it a night ;)

@nkildal
Copy link

@nkildal nkildal commented Jan 28, 2016

@digistump - I'd just like to add to @ajpowell:
After having gone through several OakRestore experiments - finally getting all my Oaks registered on Particle - I have also been experimenting with OTA deployment.
Everything seems to work just fine.
I tested both the classic Oak blink sketch - but also tested a sketch using "Blynk" to control the pins of the Oak - success!

Also done for tonight 😄

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Jan 29, 2016

Just wanted to report all working on my end as well since trying it this morning.

Fresh Oak, Updated, Clouded, then OTA flashed. All smooth as silk :)

@haakonnessjoen
Copy link

@haakonnessjoen haakonnessjoen commented Jan 29, 2016

All working here too. But I still had to chmod +x the tool-binaries in Arduino. (I'm running OS X Yosemite)

Also, I could not save the oakcli-settings with the binary downloaded from the link in the wiki. I had to use the binary that came with the latest arduino-oak-board files. After using that one, it saved the config to the correct file, and OTA worked fine.

Although the wiki said the firmware update would take several minutes, it only took about 10-20 seconds I think. But OTA takes more than a minute as foretold.

It's working great, I have tested both Particle.publish and Particle.variable, and they function as they should :)

@digistump
Copy link
Collaborator

@digistump digistump commented Jan 29, 2016

Fixing the executable permissions now, by switching to using tar.gz for OSX packages

I've updated the wiki links to point to the right oakcli

Glad it is working for most(?) who try it now! Thanks for testing!

@ajpowell
Copy link

@ajpowell ajpowell commented Jan 31, 2016

Been playing around some code and created a few simple code examples earlier today - plan to create more as I explore the oak device and particle - putting the code here for now https://github.com/ajpowell/OakSamples - these could be added to the Wiki later on.

Did find an issue when trying to compile the OneWire library - raised an issue for this: #22

To retest the deployment on OSX, I have just cleared down the ~/Library/Arduino15 directory and re-deployed as per tutorial - basic blink code has just deployed OTA with no permission issues (oak and esptool2) that had been seen previously - deployment on OSX is now working well.

@DarkLotus
Copy link
Contributor Author

@DarkLotus DarkLotus commented Feb 3, 2016

Have not had as much free time the past few days but I've still been digging!

I've narrowed it down thus far to something in the Oak/Particle integration. Stripping the oak includes and Particle.connect/ Particle.process from arduino.h and esp_main.cpp results in -0s working. Hopefully will have more free time over the weekend to narrow it down further.

@digistump digistump changed the title BOUNTY: Fatal Exception 28 Fatal Exception 28 Feb 10, 2016
@digistump digistump closed this Mar 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants