Author Topic: Problems restoring oak  (Read 1976 times)

bobr

  • Newbie
  • *
  • Posts: 4
Problems restoring oak
« on: May 29, 2016, 02:36:38 pm »
I've got one oak which I was testing beta firmware on. I have the device id recorded however after following the restore process I connect to the oak AP but the softap says it can't find the oak. I can ping it just fine. There is no output over the serial connection after booting. I do have the most recent binaries from the OakRestore repo.
python esptool.py --baud 115200 --port /dev/ttyUSB0 write_flash -fs 32m 0x1000 blank.bin 0x2000 oaksetup_restore.bin 0x0081000 oakupdate_restore.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin

installng the first update via serial I get stuck in a boot loop with-
python esptool.py --baud 115200 --port /dev/ttyUSB0 write_flash -fs 32m 0x1000 blank.bin 0x2000 firmware_v1.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin

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

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

OakBoot v1 - W,BU,0

What am I missing?

Bob

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Problems restoring oak
« Reply #1 on: June 22, 2016, 10:41:20 pm »
I was about to post the below info / link and came across your post, which is quite relevant! Sorry for not responding earlier though, must have missed it as it poped up around exam time...

When doing some work with an ESP8266 module earlier today, I came across a handy page documenting recommended minimum support hardware - and more importantly, what the different error codes from the bootloader mean. The following information is sourced from that ESP8266 Arduino documentation.

At startup the ESP8266 (which is the CPU in the Oak) bootloader  prints out the current boot mode over the serial port. For example: rst cause:2, boot mode:(3,6)

rst cause
NumberDescription
0unknown
1normal boot
2reset pin
3software reset
4watchdog reset

boot mode
the first value reflects the pin setup of the GPIO pins (0, 2 and 15).

NumberGPIO15GPIO0GPIO2Mode
00V0V0VNot valid
10V0V3.3VUart
20V3.3V0VNot valid
30V3.3V3.3VFlash
43.3V0V0VSDIO
53.3V0V3.3VSDIO
63.3V3.3V0VSDIO
73.3V3.3V3.3VSDIO

Since you got a rst cause of 2, that means the oak/esp8266 was reset manually. That's fine. The boot mode, however, is 3, which is flash mode. So if you got that message when trying to run esptool, that suggests that GPIO2 (which is mapped to P2) was not pulled to ground properly, as when doing the esptool update, the oak/esp8266 should be in uart mode. However, at the same time, there is the oakboot message at the end, which is what you should see if the oak is booting normally (in boot mode 3).

However, having said all that... the usual culprit if soft-ap not finding the Oak is just that it is being pedantic. Try connecting to the oak on another device if you can. Sometimes a phone or tablet seems to have more luck than a desktop computer. Hopefully you have had some luck finding out the problem or fixing it in the mean time!