Photon won't connect to cloud


#1

I think I’ve tried all fo the suggestions to get my Photon to connect to the cloud. I had it working at another location and am thinking this has something to do with the cloud db and the device not being properly claimed. In any event, this is what I did:

I put the device in listening mode (held setup until flashes rapid blue, then slow flashing blue)

$ particle flash --serial boot* [to flash the 0.7.0 boot loader]

I then put the device in DFU mode and

$ dfu-util -d 2b04:d006 -a 0 -s 0x8020000 -D system-part1-0.7.0-photon.bin
$ dfu-util -d 2b04:d006 -a 0 -s 0x8060000:leave -D system-part2-0.7.0-photon.bin

The device still slow flashes blue. I put it in DFU mode and

$ particle flash --usb tinker

and got Flash success!

The device remains in listening mode (blue slow flashing)

I then

$ particle identify

and the device id was returned

I then

$ particle serial wifi

and went thought the steps

and received Done! Your device should now restart.

Now the device then started flashing cyan with occasional orange/red and occasionally green flashing

I have also tried

$ particle keys doctor device-id

with no luck.

I’ve done this on 2 separate wifi networks with the same result. - no breathing cyan

Is there something in the cloud db that may be preventing this device to connect to the cloud?


#2

It looks like you might also need:

particle keys server

in DFU mode (blinking yellow).


#3

Tried that and received this result:

Okay! New keys in place, your device will not restart.

I then hit the reset button and still alternating between flashing cyan and green, and occasional orange/red


#4

In that case, either the keys doctor didn’t work, or there’s something else like a firewall preventing cloud access.

Getting a cloud debug log will indicate for sure what’s wrong. Flash this firmware by USB then monitor the USB serial port.


#5

OK - downloaded clouddebug.bin and

$ particle serial monitor

Resulting in this log:

Opening serial monitor for com port: "/dev/tty.usbmodem14121"
Serial monitor opened successfully:
failed to get device.spark.io from DNS, try 1
failed to get device.spark.io from DNS, try 2
failed to get device.spark.io from DNS, try 3
device.spark.io=0.0.0.0
connecting to cloud


#6

That sounds definitive… it looks like a DNS resolution issue. Can you connect a laptop to the same wireless network and do some network troubleshooting? You might also want to add some serial output on the photon to report the local IP, subnetmask, gateway, and dns server.


#7

Yes, the most likely problem is that your DHCP server is not returning valid DNS server addresses. Without working DNS the Photon won’t connect to the cloud.


#8

I’m doing this on an iMac. I disabled the wired network interface and used the wireless interface - all good from that end and see the DNS servers being used. Can the DNS info be manually pushed into the photon? I haven’t seen that ability in the various setup cli commands.


#9

What happens when you ping the DNS server from the iMac? I also see in @rickkas7 library that it already outputs all the server connection data. Does all that match the iMac’s wireless interface?

Edit: you can’t ping the device.spark.io… it doesn’t return a response. However, when doing a ping, it does show that the dns resolves to 52.91.51.61.


#10

I can ping both the wireless DNS references from the iMac. Both return 64 bytes received.

When I $ ping device.spark.io I get

PING device.nodes.spark.io (107.22.28.43): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4

And here’s an update result for $particle serial monitor

connected to WiFi!
localIP=192.168.1.180
subnetMask=255.255.255.0
gatewayIP=192.168.1.254
dnsServerIP=0.0.0.0 (often 0.0.0.0)
dhcpServerIP=0.0.0.0 (often 0.0.0.0)
ping gateway=0
ping addr 8.8.8.8=0
failed to get device.spark.io from DNS, try 1
failed to get device.spark.io from DNS, try 2
failed to get device.spark.io from DNS, try 3
device.spark.io=0.0.0.0
connecting to cloud

with 8.8.8.8 being one of the wireless DNS servers


#11

The problem is most likely that your network DHCP server is returning an invalid DNS server address. Those addresses are not displayed by the cloud debug tool, but clearly device.spark.io cannot be resolved by DNS on the Photon.

I don’t recommend doing this, but you can pin the Photon to a specific cloud server by IP address, eliminating the need to use DNS. This isn’t ideal because the reason cloud servers are located by DNS is that they change. If you pin by IP address and the server is rotated out, you won’t be able to connect.

However, to unblock you for now:

Download cloud_public.der.

Put the Photon in DFU mode (blinking yellow) and run the command:

particle keys server cloud_public.der 52.90.98.3

Then reset the Photon.


#12

When I run this I’m getting

Command parameters ‘52.90.98.3’ are not expected here.


#13

Make sure you run the command from the directory where you downloaded cloud_public.der to, like:

cd ~/Downloads
particle keys server cloud_public.der 52.90.98.3

#14

Yes - doubled checked and in the directory of the download


#15

Tried this

$ particle keys server cloud_public.der --host 52.90.98.3

and received message

Okay! New keys in place, your device will not restart.


#16

Oops, sorry about that. In the current version of the CLI:

particle keys server --host 34.229.193.77 cloud_public.der

However it appears that this technique no longer works. I’m not sure why yet.

Maybe it does still work. Is it working for you?


#17

No luck with this either. Now with $particle serial monitor I get this:

Opening serial monitor for com port: "/dev/tty.usbmodem14121"
Serial monitor opened successfully:
configured credentials:
ssid=FLC security=wpa2 cipher=1
available access points:
SSID=FLC-2 security=wpa2 channel=1 rssi=-48
SSID=FLC security=wpa2 channel=1 rssi=-49
SSID=HP-Print-03-Officejet 4630 security=wpa2 channel=1 rssi=-72
SSID=NETGEAR53 security=wpa2 channel=7 rssi=-71
SSID=DIRECT-84-HP M281 LaserJet security=wpa2 channel=7 rssi=-73
SSID=CBCI-72AE-2.4 security=wpa2 channel=11 rssi=-61
SSID=SSID2-2.4 security=unsecured channel=11 rssi=-57
SSID=SETUP security=unsecured channel=11 rssi=-81
connecting to WiFi
connected to WiFi!
localIP=192.168.1.180
subnetMask=255.255.255.0
gatewayIP=192.168.1.254
dnsServerIP=0.0.0.0 (often 0.0.0.0)
dhcpServerIP=0.0.0.0 (often 0.0.0.0)
ping gateway=0
ping addr 8.8.8.8=0
failed to get device.spark.io from DNS, try 1
failed to get device.spark.io from DNS, try 2


#18

Then the only thing that might work is downgrading to system firmware to 0.5.5. That has has fallback for when there’s no DNS.


#19

@rickkas7, the DHCP server doesn’t look right which would also explain the DNS failing.


#20

Are there still binaries for 0.5.5 or would this be a local build from git? And to downgrade, I’m assuming that would be bootloader and system parts 1 and 2?