Author Topic: Particle not connected  (Read 4902 times)

victagayun

  • Newbie
  • *
  • Posts: 6
Particle not connected
« on: May 24, 2016, 08:22:16 am »
I did what stated here https://digistump.com/wiki/oak/tutorials/connecting
and now the Oak is connected to the wifi...
But it was not added to the Particle, I checked http://192.168.1.109/particle but it is not connected, previously was trying to add manually by using http://192.168.1.109/device-id but cant because it is not connected to the Particle.

Anyone knows how to solve this?

Ncbob

  • Newbie
  • *
  • Posts: 10
Re: Particle not connected
« Reply #1 on: May 24, 2016, 08:28:39 am »
I had the same problem, try this :

http://digistump.com/board/index.php/topic,2046.0.html

Biggest thing I think was to power the oak down when it says to, and then it connected for me.

victagayun

  • Newbie
  • *
  • Posts: 6
Re: Particle not connected
« Reply #2 on: May 24, 2016, 09:32:51 am »
Hello ACORN-XXXXXX is not anymore bradcasting as the Oak is now connected to my router.
I got the IP from the router gateway.

The LED is blinking as per like this https://digistump.com/wiki/oak/tutorials/troubleshooting

I cannot manual claim (https://digistump.com/wiki/oak/tutorials/manual_claim) as the Oak is not connected to the particle.

Ncbob

  • Newbie
  • *
  • Posts: 10
Re: Particle not connected
« Reply #3 on: May 24, 2016, 10:52:15 am »
If it's not showing anymore I would do a factory reset and start over.

When I updated mine even when it was connected to my router it was still showing up.

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Particle not connected
« Reply #4 on: May 25, 2016, 10:45:17 pm »
victagayun,

Since it sounds like you're oak has successfully updated, but hasn't been added on particle, you'll need to put in into safe mode before doing the manual claim process.

1) Disconnect the power from the oak
2) put a jumper/link/wire between P1 and GND
3) Power up the Oak
4) After 2-3 seconds, remove the jumper link between P1 and GND -
5) The Oak should now be doing a triple blink pattern indicating is in safe mode, where you can connect to it's access point, change its wifi settings and upload code to it.

Then go thought the manual claim process you linked to before (https://digistump.com/wiki/oak/tutorials/manual_claim)

bobr

  • Newbie
  • *
  • Posts: 4
Re: Particle not connected
« Reply #5 on: June 01, 2016, 12:36:15 pm »
Does manual claim work for anyone? I'm working with a device which I had claimed to my account but then removed when I was having problems restoring it. Now my oak shows connected to the particle cloud but when trying to manually claim the device I just get the error "Could not claim device."

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Particle not connected
« Reply #6 on: June 01, 2016, 10:30:37 pm »
I've just tried unclaiming via the Particle dashboard, and then going into Build -> Devices to add my Oak again, and didn't have any issues. I had the Oak powered the whole time, but I don't know if that had anything to do with it. I've been able to add a new sketch to it, so that is working fine.

What does your device ID look like... maybe there's something wrong with that? It should looks like d9570401184e2e9ff0e0xxxx (I just blanked out the last four characters of the one I was just using.

bobr

  • Newbie
  • *
  • Posts: 4
Re: Particle not connected
« Reply #7 on: June 02, 2016, 10:11:52 am »
d957040108fc7fc94b64xxxx
I even tried claiming it through the particle API directly and it tells me the device is not online-
curl https://api.particle.io/v1/devices -d access_token=9c1234569d784696ff8daabc12345677yyyyyy -d id=d957040108fc7fc94b64xxxx
{
  "ok": false,
  "errors": [
    "Device is not connected"
  ]
}

http://192.168.10.231/info
{"id":"d957040108fc7fc94b64xxxx","claimed":0,"claim_code":"yP4cVwZ2e40VnLJeFXFthisismodified9VtXkJmx51123+~","server_address_type":1,"server_address_domain":"device.spark.io","system_version":6,"version_string":"1.0.0","meta_id":0,"meta_data":"","first_update_domain":"oakota.digistump.com","first_update_url":"/firmware/firmware_v1.bin","first_update_fingerprint":"98 66 d5 5c 3d 4a 49 24 e3 1b 72 8b 8f 2e 65 2e 32 2a 7b 95"}

http://192.168.10.231/particle
Connected

I haven't dug into the source code to see how the oak determines if it's connected to the particle cloud or not.. I'd guess this might be where the problem lies?

Bob

bobr

  • Newbie
  • *
  • Posts: 4
Re: Particle not connected
« Reply #8 on: June 02, 2016, 10:45:05 am »
I've traced out /particle. To me it looks like it simply returns if the oak is connected as a wifi client and has nothing to do with the particle cloud.

https://github.com/digistump/OakSystem/blob/master/OakSystem.ino#L381
server.on("/particle", displayParticlePage);

https://github.com/digistump/OakSystem/blob/master/OakSystem.ino#L411
void displayParticlePage() {
  displayParticle(true);
}

https://github.com/digistump/OakSystem/blob/master/OakSystem.ino#L469
void displayParticle(uint8_t streamType) {
  String particle = "";
  if(Particle.connected())
    particle = "Connected";
  else
    particle = "Not connected";

  if(streamType ==1){
    sendHTML(particle);
  }
  else if(streamType == 2){
    sendSerial(particle);
  }
  else{
    sendTelnet(particle);
  }

}

https://github.com/digistump/OakCore/blob/master/cores/oak/OakParticle/OakParticle.cpp#L116
bool CloudClass::connected(void) { return spark_connected(); }

https://github.com/digistump/OakCore/blob/master/cores/oak/OakParticle/OakParticle.cpp#L205
CloudClass Particle;

https://github.com/digistump/OakCore/blob/master/cores/oak/OakParticle/particle_core.cpp#L256
bool spark_connected()
{
    return pClient.connected();

}

https://github.com/digistump/OakCore/blob/master/cores/oak/OakParticle/particle_core.cpp#L41
WiFiClient pClient;

kh

  • Jr. Member
  • **
  • Posts: 64
  • OakTerm developer
Re: Particle not connected
« Reply #9 on: June 05, 2016, 11:02:51 pm »
Hi @bobr

I've been looking into this too. The Oak returns the status as "Connected" whenever it has an open tcp connection to the Particle Cloud (i.e. pClient.connected()). However, this doesn't tell you whether the Oak has successfully authenticated or not.

If you have a USB serial adapter, you can turn on debugging messages by uncommenting the "#define DEBUG_SETUP" line in particle_globals.h and watching the serial port as your Oak boots up. You should see "Hanshake: completed" (sic) when the authentication handshake completes.

A successful bootup in config/safe mode (after the router ssid and password have been set so that it can connect to the internet) should look something like this:

Code: [Select]
tail 0
chksum 0xc0
load 0x3ffe8000, len 352, room 8
tail 8
chksum 0x82
csum 0x82

OakBoot v1 - N,BP,0

START
0
0
8
10
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
END AUTO CONNECT
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
12
BLSEND
50
0
AP ONLINE
START AP
STARTED
GOTO LOOP
HRM1
BLRECV
HM1
13
HRM1
BLRECV
HM1
1
BLSEND
210
0
BLSEND
34
0
BLSEND
18
0
HRM1
BLRECV
HM1
13

The last seven lines repeat every 15 seconds as the Particle Cloud pings the Oak to see if it's still online and it responds. Note that I've commented out line 128 of OakSystem.ino (Serial.println("LOOP")) as it fills up the terminal almost immediately.