Duo WiFi will not connect

I have had my RedBear Duo for about two months and done many many flashes of my firmware during that time. After trying to do an app code flash last night it can no longer connect to the internet.

I just get the Green flashing then a short burst of rapid Green flashing then a flash of Red over and over again.

I have tried provisioning again which works fine using WiFi so the basic WiFi is working. After selecting my home network and giving it the password it goes back to the Green/Green/Red flashing sequence again.

Is there any chance the Particle server that handles the flashing is actually having a problem and not my board?

What does the Red flash mean? Is the server refusing to allow my board to connect for some reason?

Place the Duo in Safe mode and see if it connects properly.

Yes, I have tried Safe mode. It goes to magenta but then goes back to the Green/Green/Red sequence.

Go back to Safe Mode and then flash a very simple sketch - it’s quite possible that your own code causes the troubles.

If that doesn’t help, post a video of your flashing sequence (min 20sec)

When I go into safe mode it only stays there (with a magenta color LED) for a split second before going back to the flashing Green, rapid flashing Green then a single flash of Red then repeat this sequence over and over.

Again what does a flash of Red after the rapid flashing of Green mean? The basic flashing Green means looking for Internet connection and the fact I can provision means WiFi is working.

So there is no way to flash code in Safe mode using WiFi.

Perhaps you are saying to use the USB port to load my app. For that I am going to need to research how one uses the USB port to Flash as I have only ever used the Particle.io website to write and flash code and that, as far as I know requires a working Internet connection in order to flash.

My code does not override the default startup sequence which requires an internet connection before the app code is run. Even if it did entering Safe Mode would block running my app.

This problem started not AFTER successfully flashing my last code change but WHILE flashing the last code change. My app was working then I changed three constants of 0x00 to array variables x[4],x[5]. A very simple change I have made other places many times before while testing.

I can also post a short video tomorrow. It will look like this:
G----G----G----G----G----G----G–G--G–G--G–G--G–R----G----G----G----G----G repeat

The G----G sequence goes for several second before it switches to a single G–G--G–G--G–G--G–R rapid sequence with single Red flash at the end.

I’m not sure wheter the Duo is supported by the Particle CLI, but with a Particel device you’d do it this way

particle update
particle flash --usb tinker

to revert back to a safe state.

Otherwise you could read up here

Does your R rapid sequence resemble an SOS pattern (… _ _ _ …)?
If so, the single red blink after that indicates a so called hard fault which might be caused by buffer overrun, index violation and such things

I have just reloaded all the firmware and still have the same problem.
Loaded the following firmware:

fac-dct.bin (stored to new location for 0.3.0 firmware and above, downloaded from Particle website per instructions.)
duo-system part 1&2 for firmware 0.3.1

Rebooted and got the expected Blue flashing LED. Provisioned with Duo app which reports the following:

Released Version: 0.3.1 (which is what I just loaded)
Bootloader: 5 (latest version which I did not load so don’t know how it got it)
System Part 1: 9 (why the 9 when I loaded 0.3.1?)
System Part 2: 9
User Part: 7

So all looks good. Selected my network and gave it my password.

At this point it when to the slow flashing Green (no pattern just flash flash at equal rate) then the short burst of fast flashing Green then one flash of Red.

Again this looks like the Duo has connected to the the Particle server when it switches to the fast flashing then Red when rejected for some unknown reason. Perhaps I will try deleting and giving Particle my device ID again and see if that helps?

Removing and trying to add my device to Particle website did not help.

Next test was to disconnect my network from the internet.

The Red single flash turns into several Orange flashes. So I think that proves the problem has something to do with the Particle server not wanting to connect to my Duo.

I gave up on Particle.io and have installed the Arduino IDE on my PC.

Tried a couple of example programs (LED flash and a simple Bluetooth 4x LE chat) and both work just find.

So I can see nothing wrong with my board except the Particle.io server will not allow it to connect.

I have two more boards coming and it will be interesting to see if they have the same problem out of the box. If that happens it would seem to indicate Particle.io has dropped support for the RedBear Duo as of Monday night.

How does this conclusion come about?

You might want to contact RedBear Labs for support instead of thinking that this is happening when it’s not.

RedBear might need to reprovision the device on their side.
You can check their forum. I had a similar issue before and they had to do something on their side.

Thanks for the information. I will contact RedBear and see about a reprovision from their side.

I now have my app running again by using the Arduino IDE. The app has nothing to do with WiFi. It only accesses Bluetooth, CAN and the Serial port for monitoring. It does not write anything to any storage on the Duo so could not corrupt anything in the serial EEPROM.

You need to quote my full sentence not just clip the part you want.

The full sentence was conditional. “If that happens again”

So IF the same problem happens on the two new boards I get then intentionally (not very likely) or accidentally (most likely) support has been dropped.

Hmm, I can’t quite follow that logic :wink:
Even if that happened there could still be several (probably more likely) other imaginable reasons hence the conclusion that Particle must have dropped support (or that this would be the probable explanation) would still be a fallacy - with or without the condition in place :sunglasses:

After some great help from guohui on the RedBear site who provide a logging app I now have more information and it confirms a problem connecting to the Particle server. Don’t know how to fix it yet but at least I now have an error code.

Here is a log of what is happening.

Cloud Status = 1
0000114461 [app] INFO: Event: cloud_status_connecting
0000114535 [system] INFO: Resolved host device.spark.io to
0000114633 [system] INFO: connected to cloud
0000114633 [system] INFO: Cloud socket connected
0000114634 [system] INFO: Starting handshake: presense_announce=1
0000114634 [comm.sparkprotocol.handshake] INFO: Started: Receive nonce
0000114728 [comm.sparkprotocol.handshake] INFO: Encrypting handshake nonce
0000114774 [comm.sparkprotocol.handshake] INFO: Sending encrypted nonce
0000114775 [comm.sparkprotocol.handshake] INFO: Receive key
0000114873 [comm.sparkprotocol.handshake] ERROR: Unable to receive key -19
0000114874 [system] WARN: Cloud handshake failed, code=-19
0000115124 [system] INFO: Cloud: disconnecting
0000115124 [system] INFO: Cloud: disconnected
Cloud Status = 0
0000115124 [app] INFO: Event: cloud_status_disconnected

How do I fix this “Unable to receive key -19” Error? I think I used the correct fac-dct-r1.bin from the Particle website but if someone has a better link to one I am open to trying it.

For such issue I’d usually expect a rapid cyan blink with a short red burst in between, but you can try this anyway while in DFU Mode

particle keys server
particle keys doctor <yourDeviceID>

Here is what I got. First command seemed to work, second seems to have failed. Did I need to reset between the two commands?

C:\Users\Jim>particle keys server
Found DFU device 2b04:d058
spawning dfu-util -d 2b04:d058 -a 1 -i 0 -s 2082 -D C:\Users\Jim\AppData\Local\particle\node_modules\particle-cli\keys\rsa.pub.der
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Deducing device DFU version from functional descriptor length
Opening DFU capable USB device…
ID 2b04:d058
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #1
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "DCT Flash "
Downloading to address = 0x00000822, size = 512
Download [=========================] 100% 512 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Okay! New keys in place, your device will not restart.

C:\Users\Jim>particle keys doctor xxxxxxxxxxxxxxxxxxxxxxxxxxx
Found DFU device 2b04:d058
Found DFU device 2b04:d058
Error creating keys… Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c “openssl genrsa -out xxxxxxxxxxxxxxxxxxxx_rsa_new.pem 1024”
‘openssl’ is not recognized as an internal or external command,
operable program or batch file.

Make sure your device is in DFU mode (blinking yellow), and that your computer is online.
Error - Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c “openssl genrsa -out xxxxxxxxxxxxxxxxxxxxx_rsa_new.pem 1024”
‘openssl’ is not recognized as an internal or external command,
operable program or batch file.

Nope, you don’t need to reset the device, but you need OpenSSL installed on your system and included in your PATH

1 Like

Ok, will search the web to see how to do that. Thanks.

That did it. Thanks ScruffR. Everything is working again.

You were right, Particle did not have an evil plan to ban all RedBear Duo’s as I had speculated. (Sorry about that)

I now know a lot more about flashing, keys, dft-util, particle CLI, openSLL and how to compile with Arduino plus two backup RedBear Duo’s that should arrive today.

Any theories on how the keys got messed up in the first place?

1 Like