Digistump Forums

The Oak by Digistump => Oak Support => Topic started by: jbeaubien on May 23, 2017, 09:26:39 pm

Title: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 23, 2017, 09:26:39 pm
I was able after 3 hours of screwing around with my router to update it to version 10. I had to use an unprotected access point. I could not make it work with WPA.

Again it connects to my unprotected network for around 1min then disconnects... but does not complete the registration to particle, nor can I register manually through particle.

When I access http://192.168.0.1/particle it says: Not connected

Not sure where to go next.

If I disable my AP, I am able to connect back to it and when I check 192.168.0.1/info I get some valid data. Here is a couple of keys from it:

"claimed":0,
"server_address_type":1,
"server_address_domain":"device.spark.io",
"system_version":10,
"version_string":"1.0.5",
"meta_id":0,
"meta_data":"",
"first_update_domain":"oakota.digistump.com",
"first_update_url":"/firmware/firmware_v1.bin"

Anyone has ideas of new things to try?
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 24, 2017, 07:42:02 pm
I tried different hotspots tonight, private, public. Still the same result. It will connect to the spot but won't register on particle.io... after a while it disconnects from the router. Not sure how to debug this.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 24, 2017, 08:46:38 pm
Tried putting in safe mode with jumper on p1+gnd... redid the AP config. Still no device yet in particle.io. I see the oak connecting to my router with IP 192.168.1.4 but it keeps disconnecting.
Tried to assign it a fixed ip. Still not working.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: albertzerok on May 25, 2017, 04:20:20 am
Same problem.  I bought my oaks from the website via paypal, so I've filed a claim.  These things are worthless.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: PeterF on May 25, 2017, 06:44:33 pm
Sorry you feel that way @albertzerok... but the score of happy satisfied Oak owners would probably disagree with you one that point. I have three running 24x7 just doing their job, and they work just fine. There are bugs for sure, but depending on what you want to do with them, these are easily worked around. At worst, these are just high quality ESP8266's, and you can use them as such with a cheap 3.3v logic level CH340 usb to serial adapter for programming (or use the Arduino ESP8266 OTA programming). You'll still get all the wifi and cloud stuff, just not particle.

Did you try contacting Erik directly via support (a-t) digistump (d-o-t) com???

@jbeaubien: So you did the online update (http://digistump.com/wiki/oak/tutorials/connecting), and had trouble, but got it to update the system firmware to v10 / 1.0.5. But it didn't claim, so you've tried to manual claim (http://digistump.com/wiki/oak/tutorials/manual_claim). Did it add to your particle account - is there an entry for it on your console on particle (https://console.particle.io/)? If there is no entry, there could be problem on the particle end.... I'm just not sure if the device needs to be online for that the claim to process, or it if should add, but simply be listed offline until it does connect.

If you have a 3.3v logic level usb to serial adapter, it might be worth re-loading the firmware manually just in case something went wrong with the update process and corrupt firmware was loaded. There are some simple instructions on an easy serial firmware update on the wiki (http://digistump.com/wiki/oak/serialupdate), and a link to the suggested sort of adapter on that page. They're only $1-2, and you'll find it handy when developing code on these sorts of devices as you easily load directly via the serial if you want to develop stuff faster, or simply have a serial terminal so you can output debugging messages.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 25, 2017, 07:41:39 pm
Hi Peter. I really appreciate you reaching out and trying to help out.

I did indeed tried to do a manual claim. However im stuck at step 3 since it says 'not connected' when i access /particle. Unfortunately the tutorial doesnt cover that case...

I did order a usb serial to investigate further. I suspect the oak crashes at some point when connecting to the ap or when it connects to particle.io. When it disconnects from my router it doesnt go back into config mode.

To be honest after three night of investigation im a bit disappointed. I was not expecting that many hurdles so soon. I havent even started my project yet. I'm simply trying to get to that point where i can just send my code to it...

What i have planned next night is too sniff the network traffic to see whats going on between the oak and particle.io.

You said you have many oaks Peter, how did you configure them? Web, local server or direct flash?

Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: PeterF on May 26, 2017, 01:24:54 am
Yeah, I've got either 7 or ten of then knocking around... 4 are in service, the others cycle between projects and being victims for test code.

I did the normal firmware 'update' for the first two, then tried the local install for another, and then just did a serial update for the rest as the online updates were being a pain in the a$$. Particle was having some problems at one point with firmware uploads and connection, but as far as I know that isn't the case at the moment as two of the oaks are sat right in front of me, and the one with a TFT display receives particle data packets from some of the other(s).

Well, since you have nothing to lose, have you tried skipping step 3 and just entering the device ID into particle anyway?

I wanted to use the local server approach, but the local particle server stuff is broken, and Erik hasn't made his alternative available yet AFAIK. In the mean time I've used direct serial uploads or even tried out the Arduino ESP8266 OTA programming for fun. If I wanted fast (3 second) local OTA programming... ArduinoOTA is the way to go. I'd just have to make sure I backup all my Oaks first so I can re-oak-ify them if I want Particle back again! :-O ;) Things aren't that bad though I hope!

Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 26, 2017, 04:35:19 am
Yes i tried a manual entry in the dash but i gt an error. Particles says it needs to be connected to claim it.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: PeterF on May 26, 2017, 05:15:00 pm
 :o  :o

Ah well, can't do much until you can re-load the firmware and hopefully it's just stuck.

In the meantime, are there any fancy characters or anything in your SSID or password that it could be choking on? Any chance you can make a secondary SSID that it can connect to that has standard WPA2/TKIP authentication and a simple SSIS/password? Maybe even a hotspot through a phone or laptop as a test? Also, don't have it too close to your router / access point... closer is NOT always better with RF stuff... give it at least a couple of meters of seperation so the AP and Oak don't swamp each other out.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 26, 2017, 11:06:08 pm
Well my hotspot is fairly simple. Its ssid is 'Sanjuro_Guest' and it doesn't have a password. Otherwise it doesn't work at all. Also my router is like 2 floors down.

I tried also on my cell, ssid called simply 'oaktest'  (2 meters away). No password also. Still no luck.

I see in the info that the server_address_domain is device.spark.io. When I checked in the documentation on particle, it seems to be a tcp connection. Maybe my router's firewall blocks it.


Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: PeterF on May 27, 2017, 01:49:58 am
Ok, well that rules that out then!  :-\

That could explain why the Oak goes stupid also after a few minutes... by default it is supposed to try and reboot itself into safe mode when there is no internet (or particle) for a 90-120 second period, and if your router is blocking it, it might be trying to reboot. I can't remember it using any special ports or anything, so I can't say that may be the case or not.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 31, 2017, 07:05:58 pm
Well....... i am very disappointed.... i finally received my ttl usb cable to debug this thing... and guess what.... it is still not connecting to particle.io to register it self....

I know the update works because I was able to restore it to v0 then update over to serial to v10. Now what? Seriously, i wasted too many night on this...

Is there a way to get the output of what it trying to do/connect too?
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 31, 2017, 08:01:18 pm
I was able to connect and get the following output from the Arduino Serial Monitor... however i never receive anything else after OakBoot v1. The oak goes back to ap mode...

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


Anyone has any clues to the next steps I should try to debug this?
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on May 31, 2017, 08:28:27 pm
I noticed it keeps rebooting. Only line that changes is:

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

Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: PeterF on June 01, 2017, 01:54:57 am
I'll have to scratch around in order to remind my self how to do it, but there is a flag you can flip and then re-compile the firmware the Oak uses, in order to turn on the debug mode. It's off by default because it slows everything down a bit if it's on. Just bear with me for a day or two...

btw, I don't think I asked how you're powering it... might be worth trying a different USB lead or way of powering it just in case there's something dodgy about how it's getting power and that's why it's playing up.
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: jbeaubien on June 02, 2017, 11:06:03 pm
I am using this power supply:
https://www.canakit.com/raspberry-pi-adapter-power-supply-2-5a.html
Title: Re: Not sure what to do now.... cant register on particle after firmware update.
Post by: PeterF on June 04, 2017, 08:25:59 pm
Drats... that looks like it should do the job without any issue at all :(

Right, in a nutshell, this is the best way to do some debug stuff. We need to replace the config/safe mode firmware in this case, as you don't have anything else on that Oak yet, so only the config/safe mode firmware is running.

For that, you'll want this (https://github.com/digistump/OakSystem/blob/master/OakSystem.ino)... it's the Arduino sketch that the Oak runs in safe mode. Put that in a folder called OakSystem, and you'll be able to compile it on the Arduino IDE. But before you do that, you'll need to go and edit a line one of the board core files. On windows 10, this is located in %appdata%\..\Local\Arduino15\packages\digistump\hardware\oak\1.0.6\cores\oak\OakParticle. Not sure on mac, linux it would most likely be (~\.Arduino15\packages\digistump\hardware\oak\1.0.6\cores\oak\OakParticle). In that folder, you are after a file called particle_globals.h, where you'll remove the comment ('//') from in front of '//#define DEBUG_SETUP' on line four. That's it. Compile the OakSystem.ino, and then load it onto the Oak using the Arduino IDE board type set as Tools -> Boards -> Oak and Tools -> Upload Using -> Serial (Expert Use Only).

You may want to also have a look at this wiki article (http://digistump.com/wiki/oak/tutorials/serialfirmware) before you begin... walks you the process of doing a serial upload to the Oak, and the setup stuff. ;)

Hopefully you can make sense of all of that, and will get some more sense out of what's going on. Let me know if I goofed up on something or something still doesn't make sense...