Digistump Forums

The Oak by Digistump => Oak Support => Topic started by: ty1911 on December 10, 2016, 01:03:48 am

Title: Kickstarter Oak will not first update
Post by: ty1911 on December 10, 2016, 01:03:48 am
Hey everybody,
So I purchased 3 Oaks during the Kickstarter campaign and only now do I have time to monkey around with them (well from the Kickstarter updates, I was told to wait).  So I found them while I was cleaning up and I checked that it was OK to update and start using them.  Anyway, long story short, the last 5 hours and I still cannot update 1 of them.  I just ordered a USB to serial adapter, but I was wondering if anyone knows if I can trade the other 2 for ones that are past this first update?
I just uploaded a video (https://vimeo.com/195158693) of what happens.  Once plugged in, it will blink every second.  When I start the upgrade, it blinks once then twice for 10 seconds then back to once every second.

Thanks,
Alan
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 10, 2016, 11:29:41 pm
Have you tried the Troubleshooting a First Update (http://digistump.com/wiki/oak/tutorials/local_update) steps? To be honest, this should be the only 'big' issue you'll have... getting past this first update. After that, most reports I've heard (and my own experiences) say it's fine after that. The single most effective solution I've found is to do the serial update, and it's pretty quick and painless once you've done it a few times! ;) I have another four yet to be provisioned... and I'll just serial update them when they get used... I won't even bother with OTA for the first update.
Title: Re: Kickstarter Oak will not first update
Post by: ty1911 on December 11, 2016, 05:38:34 pm
Thanks for the vote of confidence PeterF.
I tried all the different first update styles.
I have a serial adapter from ebay coming soon.
I was very frustrated when I wrote the post, but after reading the other posts, I feel confident that I'll get it done with the serial adapter.

Thanks,
Alan
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 11, 2016, 10:06:23 pm
Hey Alan. Just checking as if you haven't, you haven't... and it might be the solution! ;) Anyway, I appreciate you were frustrated... it is certainly annoying when you pull something out of the draw to use it and it just won't co-operate... a bit like the STM Maple Mini I'm playing with at the moment... just can't seem to work out how to get it to be a low power proposition without studying the code and datasheet for the next month straight... :-/ ... I now the Oak certainly isn't a polished end product, and has more than a few issues, but once you work them out it seems pretty robust. I hope to see you around on the forum after the usb-serial adapter arrives... ;)
Title: Re: Kickstarter Oak will not first update
Post by: ty1911 on December 16, 2016, 09:37:14 pm
Hi Peter,
Just an update.  Believe it or not, I ordered the serial adapter on Saturday (12/10) and I got it Monday morning (12/12)!  This is exciting because I live in Hawaii and nothing gets here this fast.  OK, I am sort of kidding, but I jury-rigged the adapter to the Oak (like connect the adapter directly into the Oak with the micro USB to power up the Oak) and it still didn't work.  So I finally got the correct connectors and make the connections and it still didn't work!  I re-read the instructions and I realized that when I ran the BAT file (http://digistump.com/wiki/oak/serialupdate), I was just entering 3 instead of COM3. DUH!  About one minute later, Success!  So if I re-read the instructions, I could have had these Oaks updated.
I double checked the System Version and it shows 10!
So now I am just checking the forums for trying to get my Oak onto Particle.

Thanks Again!
Alan
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 16, 2016, 09:42:36 pm
lol... glad you're up and running. I amended the instructions on the 13th, so if you had been looking before then you would have been frustrated, as there wasn't a mention of needing to enter the full name before then ;) Nice to hear the adapter turned up that fast... yikes that was fast!

Use the OakConfig (http://digistu.mp/oakconfig) web app, log into your particle account (or register first if you need to and then log in), and then connect to your Oak, and tell it which wifi network to connect to. Once you let it loose on your wifi, it should automatically register on Particle. If it doesn't, you'll need to follow the manual claim steps (http://digistump.com/wiki/oak/tutorials/manual_claim) because it's being stubborn.

Title: Re: Kickstarter Oak will not first update
Post by: ty1911 on December 16, 2016, 11:13:53 pm
Thanks for pointing me in the right direction regarding Particle.io
When I go to the OakConfig web app and I log in, I get a message saying "Your Oak is connected to the cloud and ready to use!"
I would assume this is the message I want to see, but when I refresh my devices (I have the Partilce.io website up) it does not show up. So I click on Console and something shows up. Now I am just logging down the Device ID and associating it with my Oak using Excel.
Slowly I am getting this.

I appreciate all the help.

Good luck with your Maple Mini (I also have a Pine64 I have been messing with, but that is more full on computer than like the Oak)

Alan

Update:
I got 2 out of the 3 to connect to Particle.io
The third Oak?
After entering my login and then my network, I get "Waiting for your Oak to connect to the cloud..."
Then after about 30 seconds, I get "Your Oak did not connect to the cloud, please retry or change your WiFi settings."
So I have started looking into this problem.  I hope it is nothing big.
Do you think I should try safe mode?
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 17, 2016, 03:31:51 am
No problem Alan.

lol... so you're also a pine64 user... I'm one of the mods over on the pine64 forum (pfeerick), so flick me a PM over there if you need any help on that front. I just haven't been on over there for the last week or so due to uni assessment.

Once you get your Oaks on the Particle cloud then the real fun can begin programming them OTA, or if that is an issue, using your USB-to-serial adapter.

Pete
Title: Re: Kickstarter Oak will not first update
Post by: ty1911 on December 17, 2016, 01:04:38 pm
Update:
I got 2 out of the 3 to connect to Particle.io
The third Oak?
After entering my login and then my network, I get "Waiting for your Oak to connect to the cloud..."
Then after about 30 seconds, I get "Your Oak did not connect to the cloud, please retry or change your WiFi settings."
So I have started looking into this problem.  I hope it is nothing big.
Do you think I should try safe mode?
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 17, 2016, 03:47:23 pm
As long as it accepted the wifi config and rebooted, if it didn't connect to particle on it's own, you'll just need the follow the manual claim process. It doesn't matter what the config app says at that point. All you will need to do is enter the device ID on Particle Build, and it should be registered / paired.

Your Oak should still be in safe mode (doing a triple blink), as at this point you haven't loaded a sketch onto it. If it is still doing the single flash pattern, it hasn't updated, and that needs to happen before it can connect to Particle.
Title: Re: Kickstarter Oak will not first update
Post by: ty1911 on December 17, 2016, 06:20:34 pm
When I checked on the Particle website, it only shows 2 out of the 3 registered.  While I was there, I tried manually entering the Device ID, but then it says "Could not claim device."
Funny though, when I check http://192.168.0.1/info (http://192.168.0.1/info) it shows claimed (unless I am reading that wrong).
Wait, if I go to http://192.168.0.1/particle (http://192.168.0.1/particle) it shows "Not Connected" which is probably more accurate.
The Oak is blinking 3 times and It also shows "system_version":10,"version_string":"1.0.5", so the update did go through, right?

Can you think of anything else I could try?
I am in no rush for this third Oak because I only need 2 for a project I am doing, but it would be nice to have all three working properly.

Thanks,
Alan
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on December 26, 2016, 05:42:48 am
I'm at the same point Alan is.

I have done serial update, several times. Always get 3 blinkies, version 10, yada yada.
Connected to ACORN-xxxxxxx, did the config for the local network all the others have worked with.
Oak does NOT seem to reboot and certainly does not connect to Particle. Cannot manually claim.

The key here is that it will not config for the network.

Is there a verify after program on the serial method?

Help!
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 26, 2016, 05:16:32 pm
When you said it will not config for the network... what actually happens? It might help if list some steps, then we'll be on the same page:

1. Load the Oak WiFi Config (http://digistu.mp/oakconfig) page on a wifi capable device connected to the internet.
2. Log in to Particle
3. Connect to Oak Acorn network (your Oak should be doing the P1 triple blink pattern because it is in config mode)
4. See list of wifi devices, system version. Pick your network from the list or enter one manually.
5. Save the new config
6. Reboot and connect to configured network.

If you are getting to step 4, then the Oak WiFi is working - it is serving the ACORN network, scanning other available networks and sending that info back to the OakWiFiConfig page. If it freezes on step 5, the times that has happened to me I have just had to do it a couple of times until it takes... making sure I'm not too close to the Oak when doing so (i.e. closer is NOT better). I have had the best luck with my tablet and use that all the time when configuring Oaks. One trick I learn with it was to connect and leave it for about 30 seconds, so it could do the wifi handshaking and come to terms with the fact it no longer had an active connection to the internet.

One thing to do after the serial update, or even the OTA update if that succeeds is to manually power cycle the Oak - it doesn't seem to work well / reboot properly after doing the update.

There is no specific mention of esptool verifying after write, but there must be some verification or communication as a write can fail. There is a specific verify function, but it shouldn't be needed as the bootloader has a checksum verification protocol, and that should be enough to catch any errors there. If you can see things like the Oak AP, acccess info about the system version, and see wifi scan results, it appears to be working properly.

What do http://192.168.0.1/device-id (http://192.168.0.1/device-id) and http://192.168.0.1/particle (http://192.168.0.1/particle) return/display when connected to the Oak? device-id will display your Oaks device ID, and also the claim status - 1 for claimed, and presumably 0 for not claimed. particle should return Connected to indicate the Oak is connected to the Particle Cloud.
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on December 28, 2016, 09:29:03 pm
Thanks for your swift reply.

I get to step 5 on WiFi-1. It doesn't seem to do a full reboot but enough of some horsing around to disconnect from the PC doing the config.
There are a number of short and long blinks with short and long pauses but the Oak network never leaves the list of available networks as all the others have done by this point but perhaps momentarily.
Eventually it just goes back to the triple blink and as an available network.

I even tried the manual power cycle (disconnect as you described) to no avail.

I tried and got the same result on WiFi-2.

Went back to WiFi-1 (it is 15 feet farther away from the Oak than -2) and repeated 3 times doing 'Change Settings' each time.

I tried from scratch 3 times and always giving the board plenty of settle time, no joy.

While connected to the ACORN-network I checked the id, the particle state (Not connected), and the info, which I show below (less some possible private...info).
Then I did another config with PUTTY on TX pin 4, which spits out the following at 'reboot' time:
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 - N,BU,0


It all seems like good info but I have no knowledge about it to align with. It would be nice if there was a 'verbose debug' switch that would give a play by play on the boot/reboot at TX.

Any more clues here?
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 29, 2016, 11:03:59 pm
It sounds like for some strange reason the wifi config isn't being saved, and hence it isn't going online, so it can't automatically claim on particle or let you claim it manually. And the claim information from the Oak is confirming that - as far as it's concerned, the claim process hasn't occurred. I would suggest seeing if you can power it from a different power source, or use a different lead, just in case the Oak is having power issues...

Otherwise, if you're game for some lower level tinkering, you can enable some diagnostic messaging, and see if that sheds any light. Firstly, you'll want to make sure your system is ready for Serial programming an Oak (http://digistump.com/wiki/oak/tutorials/serialfirmware)... Then, you'll need to do an OakRestore (https://github.com/digistump/OakRestore), as that will ensure your Oak is ready for Serial programming - else you'll load your serial program onto the Oak, but it won't run it! Then, download OakSystem (https://github.com/digistump/OakSystem), which is the code that the Oak runs in the background of your sketch,and when in config mode. Before you compile it, and load it onto your Oak, goto either (%appdata%\..\Local\Arduino15\packages\digistump\hardware\oak\1.0.6\cores\oak\OakParticle\particle_globals.h [on windows - but don't quote me on it... I'm on linux at time of writing!] or ~/.arduino15/packages/digistump/hardware/oak/1.0.6/cores/oak/OakParticle/particle_globals.h [on linux]) and uncomment #define DEBUG_SETUP. This enables the debug messages. You can then compile and upload the code to your misbehaving Oak, and see if any useful messages ensue. Note that the serial debug messages are output at 115200 baud, not the 74880 of the bootloader.

Hopefully that doesn't scare you off... please ask if something doesn't make sense! :)

The
Code: [Select]
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

bit is normal... that is the standard ESP8266 boot code, and the

Code: [Select]
OakBoot v1 - N,BU,0
line tells you that the Oaks bootloader has started.
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on December 31, 2016, 11:16:30 am
THANK YOU SO MUCH FOR THAT INFO! Really, you pointed me to where I wanted to go but didn't expect to get to so soon.

So, I tried the master reset and the consistent part here is that it will not connect to download the update, just blink blink blink.

Following your instructions (had to install pyserial, for other readers information), close the Arduino IDE Serial Monitor window (apparently gets its own handle to the COM port) and some trouble with my connections, I managed to get the 1.0.5 core written with the #define DEBUG_SETUP. (OH, yeah!)

I found the Arduino IDE Serial Monitor options (none) disappointing so switched to PUTTY to capture the entire serial output.

Adding some more meaningful debug info to the system I found that even though the WiFi is apparently working, after Oak.connect() executes, Oak.waitForConnection() times out and the connection fails. Hence, there is no Particle connect attempt.

I'm now off on a journey of discovery in the bowels of the Oak system to add more debug info in the area where the connection fails. My gut says faulty micro memory somewhere, like a setting isn't taking hold.

A point in the right direction (file) would be great, otherwise, "a huntin I will go".
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on December 31, 2016, 07:10:16 pm
Hm... very curious.

I'm afraid that is about the extent of my knowledge of the depths of the Oak... I haven't had any need to fiddle with the wifi stuff so haven't looked into that at all. My prefered text editor (Notepad++) has a handy find in files option gets a good working out - I usually point it at the Oak directory to root through all the files and find interesting bits and work out how the code bolts together.

There was some mention before about a section of memory used to hold the different configuration values... it would be interesting to know if there is any easy or 'safe' way to wipe that so the Oak completely reverts back to "factory defaults". Maybe kh or exeng can shed some light on this if they are following along (as I think they were in the discussion earlier about the config memory block?)

Happy huntin' ;)

Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 01, 2017, 01:19:58 am
If this is a corruption of the final sectors where the WiFi info is stored, the solution is to erase the last several sectors with a command like this according to Erik.

Code: [Select]
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

I once had a misbehaving Oak the was snapped back to working by doing this per Erik's advice. Don't know why it worked but it did. Worth a try.
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 01, 2017, 10:41:06 pm
Wow, that sounds like my gut was right. Here is the output from that command...

Code: [Select]
Connecting...
Erasing flash...
Wrote 4096 bytes at 0x003fc000 in 0.4 seconds (75.2 kbit/s)...
Erasing flash...
Wrote 4096 bytes at 0x003fd000 in 0.4 seconds (74.5 kbit/s)...
Erasing flash...
Wrote 4096 bytes at 0x003fe000 in 0.4 seconds (74.5 kbit/s)...
Erasing flash...

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

Houston, I think 0x3FF000 has a problem.

I tried it 3 times, each time checking my connections and a power cycle before the last.

Bad chip?

Is this "ESP8266EX Datasheet - Version 4.3" the right datasheet for the Oak?
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 01, 2017, 10:56:43 pm
Bobzilla,
It's been awhile since I've done this but I recall seeing a similar error when trying to erase the 0x3FF000 sector. It still fixed my problem. In fact I recall mentioning to Erik that I had seen the same error. So I would ignore it for now.

Did this help to fix the problem? Or are you still experiencing the original issue?
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 02, 2017, 11:37:10 am
Nope, same problem.
I went through all the previous programming steps.
No improvement.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 02, 2017, 02:26:00 pm
Probably not what you want to hear but I would try factory reset again. Make sure you a good power source.

https://github.com/digistump/OakRestore
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 02, 2017, 06:36:00 pm
No change.

Downloaded OakRestore-master.zip again from your link.

I changed to my Nexus USB charger and ran the gamut.

Changed to local 5V supply into the Vin.

I tried clearing the 0x3FF000 before 0x3FE000.

Nothing different, still won't connect to particle.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 02, 2017, 09:36:07 pm
I assume you get through the SoftAp config and can still get to three blinks?

I've been there with a couple of my Oaks. One was fixed by extreme measures and the other by what I suggested. It's frustrating I know because there seems to be no if this then do that knowledge.

Has this Oak ever been claimed on Particle?

The extreme measure is documented here (but I wouldn't try that just yet):
https://digistump.com/board/index.php/topic,2381.msg11296.html#msg11296
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 03, 2017, 05:58:37 am
This one, #4 of 5, has never claimed but does update to system 10 (3 blinks). Obviously I could only do that via serial.

Wow, that is involved. I'm on Windows 7 but have some experience with Linux. (Like to make the switch some day. Need 3D CAD.)

This may take a couple days.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 03, 2017, 09:39:24 am
The extreme method was required because I stupidly erased all of flash thinking a factory reset would restore the Oak. I wiped the boot sector among other things. I don't think it's necessary for you because you are getting to the 3 blinks and only seemed to be hung up on connecting to Particle.

You say...
Quote
Obviously I could only do that via serial.

Does that mean you are not able to SoftAP update the Oak to configure it via a wireless connection?

Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 03, 2017, 11:22:09 am
Because though the Soft AP comes up and I select a network, it never connects to Particle, so it won't do the OTA update. Have to use serial until this issue is resolved. This is what led to finding that the 0x3FF000 sector is not saving the config.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 03, 2017, 12:10:22 pm
If you have a way to view hex files (hex editor) you should be able to see your SSID and PW in the bin file at about offset 0x00000B10 in the bin file resulting from this command to read flash.

Code: [Select]
python esptool.py --baud 115200 --port COM3 read_flash 0x100000 0x100000 flash_dump_0x1.bin
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 03, 2017, 10:01:31 pm
I cannot complete step 4 with the Particle CLI https://digistump.com/board/index.php/topic,2381.msg11296.html#msg11296 (https://digistump.com/board/index.php/topic,2381.msg11296.html#msg11296) because I cannot login to get at it. They keep rejecting my particle account login and even the community login and they hide the location for signing up for whatever that login is for as well.

In the flash_dump_0x1.bin file I see my network SSID but the password is not correct or not what I enter.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 03, 2017, 11:43:26 pm
What you opted to go the extreme route and got through the first 3 steps? And, your blocked at the  SoftAP login to Particle? Or do you mean normal Particle login? Or the link below?

BTW: I can't log in to that link either in kh's message post but can log in to the normal Particle.io. Perhaps when kh posted his summary he linked the wrong login screen???? I'll have to look at my notes.
Quote
4. The Particle CLI. This is a bit of a pain as it requires several prerequisites - see the installation instructions http://zendesk.particle.io/hc/en-us/articles/203265730-Installing-the-Particle-CLI (http://zendesk.particle.io/hc/en-us/articles/203265730-Installing-the-Particle-CLI)

RE: the WiFi password not being correct. Could be a clue to why you are having difficultly. Is it even close or garbage? I can see mine clear.

I've been off on other micros so I haven't touched my Oaks for awhile. I have some new ones that I recently ordered. I'll have to try and bring one up. Let me check my notes to see if the Particle link is the one I used to get the Particle CLI install instructions.

EDIT: Should be able to find the Particle CLI instructions for Windows here: https://docs.particle.io/guide/getting-started/connect/photon/#installing-the-particle-cli

Scroll up until you see the Using Windows header. Hopefully this will help.



Title: Re: Kickstarter Oak will not first update
Post by: PeterF on January 04, 2017, 01:41:22 am
Same here. I narrowed it down to a smaller chunk of memory

Code: [Select]
esptool --baud 115200 --port COM3 read_flash 0x100B00 0x000100 flash_wifi_config.bin
and could also see my WiFi SSID and passwd in the clear. So there is something really odd going on if your SSID is making it intact, but not your password. Any 'odd' characters or symbols in it?

Thanks for pointing out the wifi config memory blocks exeng... that will be very handy as it is an easy way to get my Oaks to forget the AP so I don't need to 'de-particle-ise' them when trying to get them to work with the particle server (and they don't want to play)... once I make a small enough blanking binary to wipe out *just* that bit!!!

Edit: I also get the same error for 0x3FF000... but this is on a Oak that had no WiFi issues, so I don't think it is a sign of memory failure in my case. I may be completely misreading this, or taking it out of context, but I see mention of "0x3ff00000 = peripheral registers base", so it probably isn't program memory space?? ??? 

Code: [Select]
Connecting...
Erasing flash...
Wrote 4096 bytes at 0x003fc000 in 0.4 seconds (83.8 kbit/s)...
Erasing flash...
Wrote 4096 bytes at 0x003fd000 in 0.4 seconds (83.8 kbit/s)...
Erasing flash...
Wrote 4096 bytes at 0x003fe000 in 0.4 seconds (83.4 kbit/s)...
Erasing flash...

A fatal error occurred: Failed to enter Flash download mode (result "0x1, 0x6")
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 04, 2017, 09:40:36 am
I could be wrong but I've seen WiFi credentials in other sectors, specifically the 0x3FC000, 0x3FD000, and 0x3FE000 (I think). I'd have to dump these sectors to verify. I say this because I remember seeing them and posting about the WiFi credentials being in the clear once. I don't pretend to understand the Oak memory map but I know I've seen them elsewhere.

BTW: My backup image has these sectors erased which is further evidence that I capture the sectors when the Oak was first brought to 3 blinks.
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 04, 2017, 10:45:56 am
Ah, the second link works fine. I'll check it out.

Yeah, the password is not there, just ghost data from something else. I noticed that when I switched from a longer named SSID, ending '321', to a shorter one by two characters ending with 'E', that the 00 byte comes right at the end of that new SSID but the last character and previous 00 byte of the first SSID with the rest of the previous ghost data are still there, represented below.
Code: [Select]
Starting at 0B1D ending at 0B35 ('_' replacing private info and '.' representing 0 byte locations.)
____________321.vant 1234
____________E.1.vant 1234

My SSID passphrases never show up in this block of memory. If it should follow right after the SSID then yes, I'd agree. Something isn't allowing the passphrases to be written there. That seems like there is a possible code error based on some hardware difference in this chip not found in the other four or if it is copied to this area from another malfunctioning area. Given that the software has all been the same, it seems there is a hardware issue somewhere. Perhaps there is an unexpected condition  happening with this unit that isn't accounted for in the software?

Good troubleshooting method there Peter.
However one of the datasheets says:
According to that the 0x3FF000 sector should be writable. Maybe something else is going on there.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 04, 2017, 02:49:24 pm
Bobzilla,

Just for reference the SSID sits at offset 0x000B1D in that sector (0x100000) and the PW at offset 0x000B3E in the same sector.
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on January 04, 2017, 04:54:42 pm
I could be wrong but I've seen WiFi credentials in other sectors, specifically the 0x3FC000, 0x3FD000, and 0x3FE000 (I think).

No, not wrong... they are duplicated there also... but I don't know why.

@Bobzilla: Fair enough... There wasn't enough context around the post where I saw the mention of the peripheral registers, so there is a good chance it was talking about runtime memory or something else entirely! :-O

How long is your SSID? Mine was 17 characters, and (making the assumption that is fixed length slots for config data) it looks there is space for a 33 character long SSID (34 if there is no gap at all) before the password field would be overrun??? Baring that, I would suspect that the Oak is somehow faulty... they should all be the same hardware, and since you've done OakRestore, there isn't anything wrong in the software...
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 05, 2017, 12:19:51 am
Just for snits and giggles I read out to file the 0x3FC000-0x3FFFFF range from my #3 that has been running for months now and the same range from the troubled #4. They are identical! I reread #4 to file a second time wondering if I had accidentally read #3 again.
So, I 'blanked' that area again with the command...
Code: [Select]
python esptool.py --baud 115200 --port COM4 write_flash -fs 32m 0x3FC000 blank.bin 0x3FD000 blank.bin 0x3FE000 blank.bin 0x3FF000 blank.bin with the very same error on sector 4.
Then I read it back out. There was NO change in any of the 4 sectors and certainly not blank!  :o
Maybe I did something wrong or assumed wrong that it should work that way.
Oh, and in #3 the password is where it should be and another at the end of the program. I'm guessing that perhaps the password doesn't get saved there until after a successful connect? Hmm, there's an idea.
I wrote #3's file back to #4 with this command...
Code: [Select]
esptool --baud 115200 --port COM4 write_flash -fs 32m 0x1000 blank.bin 0x100000 flash_dump_03_0x1.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.binIt is running the program but still not showing on Particle. Oh, well.
Title: Re: Kickstarter Oak will not first update
Post by: exeng on January 05, 2017, 09:57:44 am
Bobzilla, Forgive me for the silly question but you realize that blank is 0xFF throughout. What do you see in these sectors after writing the blank bin file to them?
Title: Re: Kickstarter Oak will not first update
Post by: Bobzilla on January 05, 2017, 08:50:51 pm
Yeah, that's what I meant to say. After writing the blank file to those sectors they were not blank (all FF like the file). Those four sectors were surprisingly identical to my working #3 Oak.

That left me with two questions in my mind.

Though I'd like it to be fully functional, the hunt for a nasty bug is very enticing. I wish this Arduino IDE had debug/stepping capability. The problem with inline serial debugging is you have to know where to put them. When dealing with C libraries they're all over the place. If anyone can point me in the right direction (file) it would cut down on my time.
Title: Re: Kickstarter Oak will not first update
Post by: PeterF on January 05, 2017, 10:14:37 pm
Against my Oak, running the first of the two scripts below (on Windows) resulted in a result of two entries in 0x003FC000 related to my wifi config, and two entries in 0x003FD000. 0x003FC000 was blank for me and there were a few bytes of data at the start of 0x003F000.

Running the second erased those sectors (all 4096 bytes of them) - when re-running the second script there was nothing in all four sector dump files.

And yes, I know... I could have simply dumped all four sectors into one file with one read (i.e. esptool.exe --baud 115200 --port COM%COMPort% read_flash 0x003fc000 0x004000 flash_endSectors_0x003FC-0x003FF.bin) ... but I wanted to make it as comparable to the 'erase' as possible.   8)  ;D

Edit: btw... this was WITHOUT re-configuring the Oak inbetween... I simply read it, wiped it, and read it again, with the appropriate power cycles and P2 to GND as needed.

Both scripts use esptool.exe and wipe script needs blank.bin

OakReadEndSectors.cmd

Code: [Select]
@ECHO OFF
SET ESPTOOL=esptool.exe

ECHO Oak Read End Sectors
ECHO ====================
ECHO.
ECHO Available Serial Ports appear to be:
for /f "tokens=4" %%A in ('mode^|findstr "COM[0-9]:"') do echo %%A

ECHO.
set /p COMPort="Which COM port do you want to use (e.g. 3)? "

CHOICE /M "Run esptool on COM%COMPort%"
IF ERRORLEVEL 2 goto end
IF ERRORLEVEL 1 goto run_esptool
goto end

:run_esptool
%ESPTOOL% --baud 115200 --port COM%COMPort% read_flash 0x003fc000 0x001000 flash_endSectors_0x003FC.bin
echo Reconnect Oak
pause
%ESPTOOL% --baud 115200 --port COM%COMPort% read_flash 0x003fd000 0x001000 flash_endSectors_0x003FD.bin
echo Reconnect Oak
pause
%ESPTOOL% --baud 115200 --port COM%COMPort% read_flash 0x003fe000 0x001000 flash_endSectors_0x003FE.bin
echo Reconnect Oak
pause
%ESPTOOL% --baud 115200 --port COM%COMPort% read_flash 0x003ff000 0x001000 flash_endSectors_0x003FF.bin

:end
pause


OakWipeEndSectors.cmd

Code: [Select]
@ECHO OFF
SET ESPTOOL=esptool.exe

ECHO Oak Wipe End Sectors
ECHO ====================
ECHO.
ECHO Available Serial Ports appear to be:
for /f "tokens=4" %%A in ('mode^|findstr "COM[0-9]:"') do echo %%A

ECHO.
set /p COMPort="Which COM port do you want to use (e.g. 3)? "

CHOICE /M "Run esptool on COM%COMPort%"
IF ERRORLEVEL 2 goto end
IF ERRORLEVEL 1 goto run_esptool
goto end

:run_esptool
%ESPTOOL% --baud 115200 --port COM%COMPort% write_flash -fs 32m 0x3FC000 blank.bin 0x3FD000 blank.bin 0x3FE000 blank.bin 0x3FF000 blank.bin

:end
pause
Title: Re: Kickstarter Oak will not first update
Post by: pck on May 20, 2019, 09:51:39 pm
hey man
สมัครufabet (http://www.ufabet99.vip)