Author Topic: Blink patterns after factory restore?  (Read 7084 times)

exeng

  • Sr. Member
  • ****
  • Posts: 454
Blink patterns after factory restore?
« on: August 17, 2016, 05:21:06 pm »
Can anyone tell me the 2 blink, pause, 2 blink pattern is an indication of after a factory restore? This Oak is not being seen on my network. Just what I need now, arrrgh, another problem.

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Blink patterns after factory restore?
« Reply #1 on: August 17, 2016, 06:41:36 pm »
Just what I need 2 Oaks to debug...

This Oak (not the OTA upload failing Oak. That's another thread) was acting strange so I did the factory restore (latest) which resulted in the 2 slow blink / pause pattern I asked about. Decided to serial load the system master with debug on and this is what I'm seeing cycling:
Quote
0
0
0
0
WIFI CONNECT
WIFI CONNECTED
PARTICLE CONNECT
AUTO CONNECT
START HANDSHAKE
SHAKE
4
BLRECV
40
SHAKE1
4
SHAKE2
BLSEND
256
0
SHAKE3
SHAKE4
BLRECV
SET KEY
SEND HELLO
GET HELLO RESPONSE
BLSEND
18
0
WAIT FOR SERVER HELLO
HRM1
BLRECV
HM1
0
Hanshake: completed
END HANDSHAKE
SEND EVENTS
BLSEND
50
0
BLSEND
50
0
SEND SUBS
BLSEND
18
0
BLSEND
18
0
SEND TIME REQ
BLSEND
18
0
LOOP
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
12
END AUTO CONNECT
PARTICLE PUBLISH EVENT
BLSEND
50
0
BLSEND
50
0
AP ONLINE
START AP

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff4030 end: 3fff4380 offset: 01a0

>>>stack>>>
3fff41d0:  3fff7948 00000001 000000ff 00000006 
3fff41e0:  40237d5e 4022b1fc 00000018 3fff7440 
3fff41f0:  00000028 3fff78e0 3fff78e0 40237f44 
3fff4200:  3fff78e0 3fff7440 00000000 3fff4428 
3fff4210:  3fff1ec4 3fff1cd8 b3d907c8 3fff424f 
3fff4220:  40243278 00000064 0b7fcf5e fffeffff 
3fff4230:  00000018 0000ffff 3ffecb64 402216a8 
3fff4240:  3fff4258 402344f8 3fff1c54 3fff7440 
3fff4250:  0b7fcf5e 3fff26b7 00000000 00000000 
3fff4260:  00000000 00000000 00000000 00000000 
3fff4270:  00000000 00000000 00000000 00000000 
3fff4280:  00000000 00000000 402351ef 3fff7440 
3fff4290:  3fff3230 3fff7440 3fff7440 40235237 
3fff42a0:  00000026 3fff43e8 3ffecb7c 00000000 
3fff42b0:  40224039 00000003 00000003 00000000 
3fff42c0:  40224151 00000003 00000003 402190e0 
3fff42d0:  00000001 402241aa 00000003 00000000 
3fff42e0:  4020eca4 00000003 3fff3230 00000000 
3fff42f0:  4020ecd4 3fff3230 00000003 4020ed06 
3fff4300:  3ffe884c 00000001 3fff3230 4020e750 
3fff4310:  3ffe99b0 3fff5afd 3fff5afd 3fff4428 
3fff4320:  00000000 00000009 3fff43e8 40219298 
3fff4330:  3ffe8820 3fff441c 3fff43e8 3fff4428 
3fff4340:  00000000 00000001 3fff43e8 4020eaf7 
3fff4350:  00000000 00000000 3fff334c 3fff3354 
3fff4360:  3fffdc20 00000000 3fff334c 40211d27 
3fff4370:  00000000 00000000 3fff3360 40100114 
<<<stack<<<

 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 - E,BU,0

START
0
0
0
0
WIFI CONNECT
WIFI CONNECTED
PARTICLE CONNECT
AUTO CONNECT
START HANDSHAKE
SHAKE
4
BLRECV
40
SHAKE1
4
SHAKE2
BLSEND
256
0
SHAKE3
SHAKE4
BLRECV
SET KEY
SEND HELLO
GET HELLO RESPONSE
BLSEND
18
0
WAIT FOR SERVER HELLO
HRM1
BLRECV
HM1
0
Hanshake: completed
END HANDSHAKE
SEND EVENTS
BLSEND
50
0
BLSEND
50
0
SEND SUBS
BLSEND
18
0
BLSEND
18
0
SEND TIME REQ
BLSEND
18
0
LOOP
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
12
END AUTO CONNECT
PARTICLE PUBLISH EVENT
BLSEND
50
0
BLSEND
50
0
AP ONLINE
START AP

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff4030 end: 3fff4380 offset: 01a0

>>>stack>>>
3fff41d0:  3fff7948 00000001 000000ff 00000006 
3fff41e0:  40237d5e 4022b1fc 00000018 3fff7440 
3fff41f0:  0000008b 3fff78e0 3fff78e0 40237f44 
3fff4200:  3fff78e0 3fff7440 00000000 3fff4428 
3fff4210:  3fff1ec4 3fff1cd8 b3d907c8 3fff424f 
3fff4220:  40243278 00000064 0b7fcf5e fffeffff 
3fff4230:  00000018 0000ffff 3ffecb64 402216a8 
3fff4240:  3fff4258 402344f8 3fff1c54 3fff7440 
3fff4250:  0b7fcf5e 3fff26b7 00000000 00000000 
3fff4260:  00000000 00000000 00000000 00000000 
3fff4270:  00000000 00000000 00000000 00000000 
3fff4280:  00000000 00000000 402351ef 3fff7440 
3fff4290:  3fff3230 3fff7440 3fff7440 40235237 
3fff42a0:  00000026 3fff43e8 3ffecb7c 00000000 
3fff42b0:  40224039 00000003 00000003 00000000 
3fff42c0:  40224151 00000003 00000003 402190e0 
3fff42d0:  00000001 402241aa 00000003 00000000 
3fff42e0:  4020eca4 00000003 3fff3230 00000000 
3fff42f0:  4020ecd4 3fff3230 00000003 4020ed06 
3fff4300:  3ffe884c 00000001 3fff3230 4020e750 
3fff4310:  3ffe99b0 3fff5afd 3fff5afd 3fff4428 
3fff4320:  00000000 00000009 3fff43e8 40219298 
3fff4330:  3ffe8820 3fff441c 3fff43e8 3fff4428 
3fff4340:  00000000 00000001 3fff43e8 4020eaf7 
3fff4350:  00000000 00000000 3fff334c 3fff3354 
3fff4360:  3fffdc20 00000000 3fff334c 40211d27 
3fff4370:  00000000 00000000 3fff3360 40100114 
<<<stack<<<

 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 - E,BU,0

START
0
0
0
0
WIFI CONNECT
WIFI CONNECTED
PARTICLE CONNECT
AUTO CONNECT
START HANDSHAKE
SHAKE
4
BLRECV
40
SHAKE1
4
SHAKE2
BLSEND
256
0
SHAKE3
SHAKE4
BLRECV
SET KEY
SEND HELLO
GET HELLO RESPONSE
BLSEND
18
0
WAIT FOR SERVER HELLO
HRM1
BLRECV
HM1
0
Hanshake: completed
END HANDSHAKE
SEND EVENTS
BLSEND
50
0
BLSEND
50
0
SEND SUBS
BLSEND
18
0
BLSEND
18
0
SEND TIME REQ
BLSEND
18
0
LOOP
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
12
END AUTO CONNECT
PARTICLE PUBLISH EVENT
BLSEND
50
0
BLSEND
50
0
AP ONLINE
START AP

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff4030 end: 3fff4380 offset: 01a0

>>>stack>>>
3fff41d0:  3fff78e8 00000001 000000ff 00000006 
3fff41e0:  40237d5e 4022b1fc 00000018 3fff73e0 
3fff41f0:  00000040 3fff7880 3fff7880 40237f44 
3fff4200:  3fff7880 3fff73e0 00000000 3fff4428 
3fff4210:  3fff1ec4 3fff1cd8 b3d907c8 3fff424f 
3fff4220:  40243278 00000064 0b7fcf5e fffeffff 
3fff4230:  00000018 0000ffff 3ffecb64 402216a8 
3fff4240:  3fff4258 402344f8 3fff1c54 3fff73e0 
3fff4250:  0b7fcf5e 3fff26b7 00000000 00000000 
3fff4260:  00000000 00000000 00000000 00000000 
3fff4270:  00000000 00000000 00000000 00000000 
3fff4280:  00000000 00000000 402351ef 3fff73e0 
3fff4290:  3fff3230 3fff73e0 3fff73e0 40235237 
3fff42a0:  00000026 3fff43e8 3ffecb7c 00000000 
3fff42b0:  40224039 00000003 00000003 00000000 
3fff42c0:  40224151 00000003 00000003 402190e0 
3fff42d0:  00000001 402241aa 00000003 00000000 
3fff42e0:  4020eca4 00000003 3fff3230 00000000 
3fff42f0:  4020ecd4 3fff3230 00000003 4020ed06 
3fff4300:  3ffe884c 00000001 3fff3230 4020e750 
3fff4310:  3ffe99b0 3fff5afd 3fff5afd 3fff4428 
3fff4320:  00000000 00000009 3fff43e8 40219298 
3fff4330:  3ffe8820 3fff441c 3fff43e8 3fff4428 
3fff4340:  00000000 00000001 3fff43e8 4020eaf7 
3fff4350:  00000000 00000000 3fff334c 3fff3354 
3fff4360:  3fffdc20 00000000 3fff334c 40211d27 
3fff4370:  00000000 00000000 3fff3360 40100114 
<<<stack<<<

 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 - E,BU,0

START
0
0
0
0
WIFI CONNECT
WIFI CONNECTED
PARTICLE CONNECT
AUTO CONNECT
START HANDSHAKE
SHAKE
4
BLRECV
40
SHAKE1
4
SHAKE2
BLSEND
256
0
SHAKE3
SHAKE4
BLRECV
SET KEY
SEND HELLO
GET HELLO RESPONSE
BLSEND
18
0
WAIT FOR SERVER HELLO
HRM1
BLRECV
HM1
0
Hanshake: completed
END HANDSHAKE
SEND EVENTS
BLSEND
50
0
BLSEND
50
0
SEND SUBS
BLSEND
18
0
BLSEND
18
0
SEND TIME REQ
BLSEND
18
0
LOOP
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
12
END AUTO CONNECT
PARTICLE PUBLISH EVENT
BLSEND
50
0
BLSEND
50
0
AP ONLINE
START AP

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff4030 end: 3fff4380 offset: 01a0

>>>stack>>>
3fff41d0:  3fff7948 00000001 000000ff 00000006 
3fff41e0:  40237d5e 4022b1fc 00000018 3fff7440 
3fff41f0:  0000003a 3fff78e0 3fff78e0 40237f44 
3fff4200:  3fff78e0 3fff7440 00000000 3fff4428 
3fff4210:  3fff1ec4 3fff1cd8 b3d907c8 3fff424f 
3fff4220:  40243278 00000064 0b7fcf5e fffeffff 
3fff4230:  00000018 0000ffff 3ffecb64 402216a8 
3fff4240:  3fff4258 402344f8 3fff1c54 3fff7440 
3fff4250:  0b7fcf5e 3fff26b7 00000000 00000000 
3fff4260:  00000000 00000000 00000000 00000000 
3fff4270:  00000000 00000000 00000000 00000000 
3fff4280:  00000000 00000000 402351ef 3fff7440 
3fff4290:  3fff3230 3fff7440 3fff7440 40235237 
3fff42a0:  00000026 3fff43e8 3ffecb7c 00000000 
3fff42b0:  40224039 00000003 00000003 00000000 
3fff42c0:  40224151 00000003 00000003 402190e0 
3fff42d0:  00000001 402241aa 00000003 00000000 
3fff42e0:  4020eca4 00000003 3fff3230 00000000 
3fff42f0:  4020ecd4 3fff3230 00000003 4020ed06 
3fff4300:  3ffe884c 00000001 3fff3230 4020e750 
3fff4310:  3ffe99b0 3fff5afd 3fff5afd 3fff4428 
3fff4320:  00000000 00000009 3fff43e8 40219298 
3fff4330:  3ffe8820 3fff441c 3fff43e8 3fff4428 
3fff4340:  00000000 00000001 3fff43e8 4020eaf7 
3fff4350:  00000000 00000000 3fff334c 3fff3354 
3fff4360:  3fffdc20 00000000 3fff334c 40211d27 
3fff4370:  00000000 00000000 3fff3360 40100114 
<<<stack<<<

 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

... and on and on...


Anyone have a clue? Exception (29) after START AP, with registers and stack dump.

I'm down to 3 out of 5 Oaks working. Haven't and will not touch the other 3. All started with recent updates.

PeterF

  • Hero Member
  • *****
  • Posts: 883
Re: Blink patterns after factory restore?
« Reply #2 on: August 17, 2016, 07:03:19 pm »
Try another OakRestore or a serial firmware update when you're sick of it... the exception makes me thing the firmware update was b0rked... consequently the Oak is crashing and rebooting.

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Blink patterns after factory restore?
« Reply #3 on: August 17, 2016, 07:35:08 pm »
Did a second restore. Same result. Added debug. Checking now. If it fails, I will grab the latest factory restore and try again. The ironic thing is this was the new working Oak, that started to act weird after a power cycle and before any updates to it's working state.

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Blink patterns after factory restore?
« Reply #4 on: August 17, 2016, 07:44:37 pm »
The exception is coming from the call to "WiFi.mode_internal(WIFI_AP_STA);" in this call sequence:
Code: [Select]
void setupAccessPoint(bool leaveSTAOn) {
  #ifdef DEBUG_SETUP
        Serial.println("START AP");
    #endif
 
  if(leaveSTAOn)
    #ifdef DEBUG_SETUP //SJC
    {
        Serial.println("WIFI_AP_STA");
   
    #endif
    WiFi.mode_internal(WIFI_AP_STA);
    } // Remove when debug off
  else{
      #ifdef DEBUG_SETUP //SJC
        Serial.println("WIFI_AP");
    #endif
    WiFi.mode_internal(WIFI_AP);
  }

As seen in the debug output:
Quote
...
AP ONLINE
START AP
WIFI_AP_STA

Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff4090 end: 3fff43e0 offset: 01a0

>>>stack>>>
3fff4230:  3fff7948 00000001 000000ff 00000006 
3fff4240:  40237e2a 4022b2c8 00000018 3fff7440 
3fff4250:  000000a3 3fff78e0 3fff78e0 40238010 
3fff4260:  3fff78e0 3fff7440 00000000 3fff4488 
3fff4270:  3fff1f24 3fff1d38 b3d907c8 3fff42af 
3fff4280:  40243348 00000064 0b7fcf5e fffeffff 
3fff4290:  00000018 0000ffff 3ffecbc4 40221774 
3fff42a0:  3fff42b8 402345c4 3fff1cb4 3fff7440 
3fff42b0:  0b7fcf5e 3fff26b7 00000000 00000000 
3fff42c0:  00000000 00000000 00000000 00000000 
3fff42d0:  00000000 00000000 00000000 00000000 
3fff42e0:  00000000 00000000 402352bb 3fff7440 
3fff42f0:  3fff3290 3fff7440 3fff7440 40235303 
3fff4300:  00000026 3fff4448 3ffecbdc 00000000 
3fff4310:  40224105 00000003 00000003 00000000 
3fff4320:  4022421d 00000003 00000003 402191ac 
3fff4330:  00000001 40224276 00000003 00000000 
3fff4340:  4020ed20 00000003 3fff3290 00000000 
3fff4350:  4020ed50 3fff3290 00000003 4020ed82 
3fff4360:  3ffe88b8 3fff3290 3fff4448 4020e779 
3fff4370:  3ffe9a10 3fff5b5d 3fff5b5d 3fff4488 
3fff4380:  00000000 00000009 3fff4448 40219364 
3fff4390:  3ffe888c 3fff447c 3fff4448 3fff4488 
3fff43a0:  00000000 00000001 3fff4448 4020eb73 
3fff43b0:  00000000 00000000 3fff33ac 3fff33b4 
3fff43c0:  3fffdc20 00000000 3fff33ac 40211df3 
3fff43d0:  00000000 00000000 3fff33c0 40100114 
<<<stack<<<


Really? Damn was working just fine. Arrrrrgh!

exeng

  • Sr. Member
  • ****
  • Posts: 454
CLOSED: Blink patterns after factory restore?
« Reply #5 on: August 20, 2016, 09:46:28 pm »
I believe it was a symptom of a problem that occurred while flashing this device with marginal power. Can't be sure. But after making matters worse by erasing flash (do not do that) it was solved by some extreme efforts related to this thread http://digistump.com/board/index.php/topic,2388.msg11294.html#msg11294 with some critical off line (not shown) help from kh.

CLOSED

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: CLOSED: Blink patterns after factory restore?
« Reply #6 on: August 20, 2016, 10:46:59 pm »
with some critical off line (not shown) help from kh.

Let me post this help here publicly in case anyone needs it. But do try and avoid getting into this situation (i.e. never fully erase the flash on your Oak or overwrite the config sectors) because it's difficult to restore, especially on a Windows system.

Here is a procedure to restore an Oak that has been completely wiped or had its config and backup config sectors overwritten. It writes the bootloader, then sets the device id (you need to have a record of what it was), sets the Oak's copy of the Particle cloud public key, and finally sends the Oak's auto-generated public key to Particle. See here for some additional info.

I don't know for sure that all of these steps are necessary - setting the server key in step 2 and sending the Oak key to Particle in step 3 might not be needed (if you test this, please let me know) - but they have worked successfully for both exeng and me.

Required software (on a Windows system):
  • Git for Windows
  • Python 2.7. I use the Anaconda Python distribution as it makes installing the necessary Python packages easy.
  • The pyserial python module - if you installed Anaconda, open a command prompt and type "conda install pyserial" to install it.
  • The Particle CLI. This is a bit of a pain as it requires several prerequisites - see the installation instructions here.
  • OakRestore from Digistump. Open a Git Bash Shell (installed with Git for Windows above), cd to the directory where you want to put it, then type "git clone https://github.com/digistump/OakRestore.git" to download it. Once it's done, type "cd OakRestore" and keep the window open to use for the commands below...

Procedure:

1. Write the firmware and update images

Get the Oak bootloader:
Code: [Select]
curl -O https://github.com/digistump/OakBoot/raw/master/oakboot.bin
Write the bootloader, config and update firmware:
Code: [Select]
python esptool.py -p YOUR_COM_PORT -b 115200 write_flash -fs 32m 0x0000 oakboot.bin 0x2000 oaksetup_restore.bin 0x81000 oakupdate_restore.bin

2. Set the device id and the server public key

Get the Particle server public key:
Code: [Select]
curl -O https://s3.amazonaws.com/spark-website/cloud_public.der
Connect to the Oak's AP and then send http requests to set these parameters. You can use a tool like the Chrome Postman (https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en) extension, or my Python script:

Code: [Select]
import urllib2
import json
import binascii
import sys

data={'device-id':'xxxxxxxxxxxxxx'} # *** Insert the device id you noted earlier here

with open('cloud_public.der','rb') as f:
    data['server-public-key']=binascii.hexlify(f.read())

response=urllib2.urlopen(urllib2.Request('http://192.168.0.1/set',json.dumps(data,separators=(',',':')),{'Content-Type': 'application/json'})).read()

if json.loads(response)['r']==0:
    print 'Successfully set device id and server public key'
else:
    print 'Failed to set device id and server public key'

To run this Python script, and the one below, save the code as a file in the current directory, e.g. script.py, then run it by typing "python script.py" in the Git Bash Shell.

3. Get the new public key your Oak generated and send it to the Particle Cloud

My Python script will automate fetching the key from your device, but you can also do it manually.
Code: [Select]
import urllib2
import json
import os

response=urllib2.urlopen('http://192.168.0.1/device-id').read()
id=json.loads(response)['id']

response=urllib2.urlopen('http://192.168.0.1/public-key').read()
pubkey=json.loads(response)['b']

os.system('echo "{}" | xxd -r -p - | openssl rsa -inform der -pubin -pubout -out {}.pub.pem'.format(pubkey,id))

Then connect back to your normal WiFi and send the key with the Particle cli (replacing 'xxxxxx' with your device id)

Code: [Select]
particle keys send xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxx.pub.pem

4. Update your Oak to the current firmware

Use the standard update procedure, or the forced update method.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Blink patterns after factory restore?
« Reply #7 on: November 28, 2016, 06:44:59 am »
Well dang. I finally had a chance to try this to restore an errant Oak, but it didn't work for me.

The flash in step 1 goes fine, with no errors. But I can't perform step 2 because the Oak won't go into AP mode, and I only get a garbled mess from serial (I tried several different baud rates). And yes, I also tried grounding P1 momentarily for safe mode.

Any other suggestions?

Additional info: This Oak was previously working fine. But it mysteriously stopped responding to me one day when I was doing some OTA software changes. After that, I was never able to get to go back online for another OTA, the usual OakUpdate method didn't fix it (remote or local), and the various esptool reflash methods here haven't gotten it back to a responsive state, either.
« Last Edit: November 28, 2016, 06:51:06 am by dougal »

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: Blink patterns after factory restore?
« Reply #8 on: November 28, 2016, 07:53:48 am »
Most likely, that garbled mess means it's not getting into Oakboot. Set your terminal to 74880 bps and you should see recognizable text. This is the native baud rate for the internal ESP8266 bootloader. Not all terminals can handle this baud rate, but I know PuTTY can.

I suspect something went wrong with the flashing or oakboot.bin is corrupt or incorrect.

I'm not at my computer right now to give you a checksum of Oakboot.bin to compare, but as a start, check the size is 4016 bytes.

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Blink patterns after factory restore?
« Reply #9 on: November 28, 2016, 10:51:58 am »
RealTerm is another serial monitor that will support the ESP8266 native 74880 buad rate.

http://realterm.sourceforge.net/

Another tool you may need if you don;t already have one is a hex editor. Good for viewing bin files and edit if needed. I use Hxd...

https://mh-nexus.de/en/hxd/
« Last Edit: November 28, 2016, 10:56:06 am by exeng »

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Blink patterns after factory restore?
« Reply #10 on: November 28, 2016, 02:24:28 pm »
@kh, @exeng -- Thanks for the info. the 74880 baud rate isn't supported in my usual terminal program (CoolTerm), so I'll try using screen or something. I should be able to find time to try again in a day or so.

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Blink patterns after factory restore?
« Reply #11 on: November 28, 2016, 08:43:26 pm »
dougal, This may or may not be helpful but worth trying...

First some background: I had an Oak that was not behaving and narrowed it down to an exception error. I inquired with Erik about it. See text here...

Quote
In addition to the Oak failing OTA uploads that I previously wrote you about (my last email), I now have another Oak that is in a different failing state. The ironic thing is it happens to be one that I had saved as spare and recently brought up successfully as part of debugging the other Oak as I wanted to see how my current 1.0.5 repo would behave when bringing up a virgin Oak. It was working just fine and would accept sketch uploads OTA (it's only been used for a few days).  But tonight after a power cycle to safe mode the LED began to act strangely, so I did a factory restore that yielded a blink pattern that did not look right. I then created a system with debug on and added a few extra debug items. The .txt file shows the output. Seems to be continuously resetting after an exception error. Additional debug suggests that the exception is coming from or after a call to "WiFi.mode_internal(WIFI_AP_STA);".

And Erik's response here...
Quote
This is a corruption of the final sectors where the WiFi info is stored - a horrible problem with ESP8266 chips when the power supply is borderline.

The solution is to erase the last several sectors with a command like this

python esptool.py --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x3FC000 blank.bin 0x3FD000 blank.bin
0x3FE000 blank.bin 0x3FF000 blank.bin

This actually worked for me on one Oak. It may snap yours back.

The method that kh posted I also successfully used on another Oak that I had stupidly erased pretty much everything on.

I believe both of these Oak's suffered from marginal power during OTA uploads. I was using a very cheap USB cable that I since have thrown away.

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: Blink patterns after factory restore?
« Reply #12 on: November 28, 2016, 09:51:19 pm »
FYI, here are the details of my oakboot.bin

Code: [Select]
$ md5sum oakboot.bin
765f33099ee2264f00959baa8616514b *oakboot.bin

$ sha1sum oakboot.bin
e643b6e55614f02bbe1f86cb1d6671f001a260f0 *oakboot.bin

$ git log --stat oakboot.bin
commit b827b81a181b67b465e882ddd5f5a02a28f10066
Author: Erik Kettenburg <support@digistump.com>
Date:   Wed Jan 20 13:30:25 2016 -0800

    upload bootloader

 oakboot.bin | Bin 0 -> 4016 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)


And Erik's response here...
Quote
This is a corruption of the final sectors where the WiFi info is stored - a horrible problem with ESP8266 chips when the power supply is borderline.

The solution is to erase the last several sectors with a command like this

python esptool.py --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x3FC000 blank.bin 0x3FD000 blank.bin
0x3FE000 blank.bin 0x3FF000 blank.bin

This actually worked for me on one Oak. It may snap yours back.

Very interesting.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Blink patterns after factory restore?
« Reply #13 on: November 29, 2016, 01:31:36 pm »
Aha! I'm glad you posted the md5sum for oakboot.bin, @kh -- turns out I had a bad file. Bonehead admission: my file was 136 bytes, and contained an html message saying "you are being redirected." Doh!

I'll try reflashing in a few minutes. With luck, this will fix things up. I also discovered that it's possible to add custom baud rates to CoolTerm, so I might be able to see if that offers any clues, too.

And if all else fails, I'll try blanking the flash like @exeng suggested.

Thanks for the feedback, there might be hope for this Oak, yet!

I've got two other Oaks I could have swapped in. But this is the only one that I've soldered headers onto so far, and it's way easier for me to find a few minutes here and there to try reflashing than it is to find a block of time big enough to dig out my soldering iron, relocate a spool of solder, clear off my desk, and put headers on another board. :)

PeterF

  • Hero Member
  • *****
  • Posts: 883
Re: Blink patterns after factory restore?
« Reply #14 on: November 29, 2016, 03:42:08 pm »
Ooooh..... don't you just HATE those pages.... you right click and save/download... and it don't download!!!! Grrrrr!

Well, hopefully that will explain the garbled mess... and get you back in business ;)