SparkFun Photon - unable to connect with Particle App or over USB

I’ve just receive my Sparkfun Photon redboard and never reached to establish a connection.
When using Particle App or Over USB, the process is blocked to the waiting for device cloud connection step.
When using CLI particle cloud claim id, I have the error “server said: device is not connected”.
I nevertheless managed to perform particle setup wifi with our Wifi network, but the device does not appear in the Particle app.

I get the appropriate answer when using:

  • particle serial identity etc…

Is there a mean to solve this problem (and then be able to test D7 LED blinking with Particle app)

Does the device reach breathing cyan?
If not, claiming will inevitably fail.

No the device never reach Breathing cyan, that confirm that is not connected to the cloud. It remains in the listening mode.

Nevertheless, my main problem is to be able to pass the device cloud connection step.

When connecting with Particle App:

  • Connecting on Photon Wifi => OK
  • Configuring device Wifi connection => OK
  • Connecting to Wifi network => OK
  • Disconnecting from softApp => OK
  • Waiting for device cloud connexion => NOK…

Perhaps Cloud to configure ?

Maybe perform a

particle update

to get the device up to v0.6.2 system and the flash this simple sketch via USB

SYSTEM_THREAD(ENABLED)
STARTUP(delay(5000))

SerialLogHandler traceHandler(LOG_LEVEL_TRACE);

void setup() { }
void loop() { }

This way you should get some serial output during bootup which you can post.

BTW, what WiFi encryption are you using? If WEP we might have a possible suspect for the issue.

  1. The system update improve the situation (I was in v0.4.4 before). But connection is still failed

I pass two more steps in the Particle App connection initialization:
When connecting with Particle App:

  • Connecting on Photon Wifi => OK
  • Configuring device Wifi connection => OK
  • Connecting to Wifi network => OK
  • Disconnecting from softApp => OK
  • Waiting for device cloud connexion => OK
  • checking for internet connectivity => OK
  • verifying product ownership => NOK…
  1. My Wifi encryption is WPA2

  2. I flashed the simple sketch (such as) but did not reach to obtain traces at reset or power-on (I even added log.info in setup() but are not displayed).
    I compiled my .ino such as and flashed it successfully.
    Is there a specific way of use , perhaps library to add ?

Does this mean your device is no breathing cyan?

  1. No, it (RGB) is blinking Green AND Blue (Sparkfun Photon Redboard)

On Particle APP, the following message is displayed:
"Setup process couldn't claim your photon ! ....."

  1. When performing: >particle setup
    ...
    ? Would you like to use this account? Yes

! PROTIP: Hold the MODE/SETUP button on your device until it blinks blue!
! PROTIP: Please make sure you are connected to the internet.

I have detected a P1 connected via USB.
? Would you like to continue with this one? Yes
! The device supports setup via serial.
setting up device 3500xxxxxxxxxxxxxx33

Obtained magical secure claim code.

Claim code set. Now setting up Wi-Fi
? Should I scan for nearby Wi-Fi networks? Yes
? Select the Wi-Fi network with which you wish to connect your device: inside
Attempting to configure Wi-Fi on COM5
? Security Type WPA2
? Wi-Fi Password pppppppppppp
Done! Your device should now restart.

! It doesn't look like your Photon has made it to the cloud yet.

I finally manage to get traces: Here below the last ones during my Particle APP connection attempt

0000159456 [system] ERROR: connection failed to 34.224.22.50:5683, code=-2
0000159456 [system] WARN: Cloud socket connection failed: -2
0000159475 [system] WARN: Internet available, Cloud not reachable!
0000159475 [system] WARN: Handling cloud error: 3
0000161475 [system] INFO: Cloud: connecting
0000161475 [system] INFO: Read Server Address = type:1,domain:device.spark.io
0000161494 [system] INFO: Resolved host device.spark.io to 34.224.22.50
0000166498 [system] ERROR: connection failed to 34.224.22.50:5683, code=-2
0000166498 [system] WARN: Cloud socket connection failed: -2
0000166500 [system] WARN: Resetting WLAN due to 2 failed connect attempts
0000166519 [system] WARN: Internet available, Cloud not reachable!
0000166519 [system] WARN: Handling cloud error: 3
0000166619 [system] WARN: Resetting WLAN due to SPARK_WLAN_RESET
0000166722 [hal.wlan] INFO: Using internal antenna
0000166724 [system] INFO: ARM_WLAN_WD 1
0000167416 [system] INFO: ARM_WLAN_WD 2
0000167416 [hal.wlan] INFO: Bringing WiFi interface up with DHCP
0000167430 [system] INFO: CLR_WLAN_WD 1, DHCP success
0000168532 [system] INFO: Cloud: connecting
0000168532 [system] INFO: Read Server Address = type:1,domain:device.spark.io
0000168584 [system] INFO: Resolved host device.spark.io to 34.224.22.50
0000173588 [system] ERROR: connection failed to 34.224.22.50:5683, code=-2
0000173588 [system] WARN: Cloud socket connection failed: -2
0000173607 [system] WARN: Internet available, Cloud not reachable!
0000173607 [system] WARN: Handling cloud error: 3
0000177607 [system] INFO: Cloud: connecting
0000177607 [system] INFO: Read Server Address = type:1,domain:device.spark.io
0000177626 [system] INFO: Resolved host device.spark.io to 34.224.22.50
0000182630 [system] ERROR: connection failed to 34.224.22.50:5683, code=-2
0000182630 [system] WARN: Cloud socket connection failed: -2
0000182630 [system] WARN: Resetting WLAN due to 2 failed connect attempts
0000182650 [system] WARN: Internet available, Cloud not reachable!
0000182650 [system] WARN: Handling cloud error: 3
0000182750 [system] WARN: Resetting WLAN due to SPARK_WLAN_RESET
0000182853 [hal.wlan] INFO: Using internal antenna
0000182855 [system] INFO: ARM_WLAN_WD 1
0000183607 [system] INFO: ARM_WLAN_WD 2
0000183607 [hal.wlan] INFO: Bringing WiFi interface up with DHCP
0000183630 [system] INFO: CLR_WLAN_WD 1, DHCP success
0000186632 [system] INFO: Cloud: connecting
0000186632 [system] INFO: Read Server Address = type:1,domain:device.spark.io
0000186650 [system] INFO: Resolved host device.spark.io to 34.224.22.50
0000191654 [system] ERROR: connection failed to 34.224.22.50:5683, code=-2
0000191654 [system] WARN: Cloud socket connection failed: -2
0000191672 [system] WARN: Internet available, Cloud not reachable!
0000191672 [system] WARN: Handling cloud error: 3

@slorre, what’s missing from your log are the WiFi connection details. The first thing that happens is that the Photon will negotiate a connection with your router which should assign it an IP address along with Gateway and DNS IPs. I don’t see these details in your log. What is obvious is that the Photon can’t find the device.spark.io server. This could be caused by:

  1. The IP details handed to the Photon via DHCP are problematic, or
  2. Your router is blocking the port used for contacting the server (port 5683)

Can you provide the log portion showing where the Photon is giving IP details from your router?

1 Like

First thanks very much to everybody for your help…

There’s a strong chance that the port 5683 will be blocked by our router.

Otherwise the only supplementary trace info concerning Wifi interface with DHCP is the following ones
0000101974 [hal.wlan] INFO: Bringing WiFi interface up with DHCP
0000102856 [system] INFO: CLR_WLAN_WD 1, DHCP success

Perhaps an other mean to retrieve supplementary info ?

@slorre, it seems the DHCP is ok so chase down the possible port issue and let us know how it goes. :wink:

1 Like

That was indeed 5683 that was blocked.
I have my device on the Particle App List now.

Nevertheless, I don’t manage to flash the tinker app by OTA on my device. Perhaps a mean by USB ?

You can flash a binary via CLI

// in DFU Mode
particle flash --usb <yourFirmware.bin>
// or in Listening Mode (less reliable)
particle flash --serial <yourFirmware.bin>