Boron breathing cyan but not actually connected

Hey guys, I recently unclaimed and reclaimed my boron because I wanted to setup a mesh network and change ownership accounts at the same time. After some struggles I’ve got it setup and it is breathing Cyan. When I flash the code in the Web IDE it says flash successful, but the code never actually gets flashed, and the console says the device is offline. It fails the diagnostic tests and says to troubleshoot connectivity. Meanwhile it is breathing cyan the whole time. Any ideas?
Thanks,
Alex

How do you know it’s not flashed? Do the lights not change when flashing? If it’s really not flashing can you flash over serial fine? (writing to Serial is a good way to confirm code is running)

I’m not sure it’s needed, but when switching it around did you do a factory reset?

The lights don’t change when it’s flashed and the variables don’t show up in the console, so it doesn’t seem like it’s running any code.

I’ve never flashed over serial before, will take me some time to figure out. Same goes for a factory reset it doesn’t look that straightforward, but is probably necessary.

I do the factory reset until it blinks rapid white and try to add the boron again, it goes all the way through the setup until it gets to the point where it creates the mesh network locally and it just sits there. I let it “create the network” for an hour and nothing.

I try to connect the Boron through USB to reflash the firmware, but the CLI doesn’t see it. “Could not identify device: No serial port identified” Anybody know how to get it to see the Boron? I’m running windows 10, I installed node.js and the CLI installer.

Are you trying with the app or the command line? I’ve had better luck with the command line. Look at particle mesh (https://docs.particle.io/reference/developer-tools/cli/#particle-mesh-create).

I’m trying to get the command line to work. Can’t get it to recognize the boron is connected.

Does the device appear in DevMgr at all? (as what in which category?)
Can you try a different USB cable and/or port?
Try reinstalling the drivers via the this (make sure to tick the “uninstall old drivers” option) https://binaries.particle.io/drivers/windows/particle_drivers.exe

I was actually about to respond, I figured out it was a bad cable the whole time.:man_facepalming:

I've been able to reset and flash the the firmware:

particle flash --usb hybrid-0.9.0-boron.bin

But when I go to add through the app it still gets hung up at the creating local mesh step. See screenshot:


I might leave it like this overnight, but it doesnt seem to be doing anything.

I'm a little confused about the best way to add the Boron through CLI. Add device function seems to only add the device, not the sim as well.

When I call the setup function, it doesn't go anywhere past this:

C:\Users\atheodossiou>particle setup


| '_ \ __ _ _ __| |() | | ___
| |
) |/ _` | '
| __| |/ | |/ _
| /| (| | | | || | (| | /
|| _,|| _||_
|_|_
|
https://particle.io

Setup is easy! Let's get started...
It appears as though you are already logged in as theo886@gmail.com
? 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 just added the boron through the app without creating a mesh network just to see if I could get anything to work. It went through the setup fine and added the boron to my account.
The web IDE says it flashed my code successfully.
image
But it hasnt, running diagnostics in the consol shows that there are connection issues. But through all of this the Boron is breathing Cyan.

No luck through the CLI either:

C:\Users\atheodossiou>particle flash Theo_Boron tinker
attempting to flash firmware to your device Theo_Boron
Flash device failed: Timed out.

I always suggest to use system-part1 instead of hybrid
And I’d also suggest flashing your firmware (or Tinker) via --usb

particle flash --usb system-part1-boron.bin -v
particle flash --usb tinker -v

After being able to flash tinker when in safe mode. I’ve figured out that it is something that is in my code that locks up the Boron. When I flashed my code back on it goes back to connectivity issues.
I believe I had firmware version 0.8 before I reclaimed the boron and it automatically updated the firmware to 0.9 that first time. My code worked fine on 0.8 but there must be something in it that 0.9 disagrees with. Same results with hybrid or system-part1 0.9.

I then put it in listening mode and was able to add it again and create a mesh network!
Thank you so much for your help Scruff and Ken!!

1 Like

If you can show your code, we might see something.
You can also try 1.1.0 (or even 1.2.0beta)

That would be great if you want to check it out.

Here’s the link: https://go.particle.io/shared_apps/5cbd79710edb2c0020cd190f
I’ve done a pretty good job at commenting so it should be straight forward. I’m running this in my camper van, theres: in/out temp sensors, a 4 digit display, heater controls, and a UART connection to get information from my lithium battery manager.

I currently have the boron out of the van so its not connected to any of the sensors etc, that may be causing it to get hung up somewhere. Though nothing jumps out to me why it would. I already tried disabling the UART section of code, but that does not seem to be the culprit.

I figured it out… I’ve got a button on an analog pin and I used a low threshold (buttonval> 100) to determine if it’s pressed. With the button disconnected that pin reads around 250 so my code was stuck in the while loop that counts how long the button is pressed. I moved the threshold to 500 and I’m good now… of course it was something simple… Thanks for your help.

1 Like

Just out of interest, why do you analogRead() at all?
A-pins can also be read via digitalRead().

BTW, spinning in a loop to measure time is not really best practice. Better would be to store the millis() time of the first press and then - after the debounc period - compare the release time to that stored value.
Maybe via an interrupt or by use of the clickButton library.
Do you have an external pull-resistor? If not, you may want to set pinMode(A0, INPUT_PULLUP) to avoid a floating pin issue like you experienced above.

Another point I noticed

        thermistorVal = analogRead(thermistorPin); 
        thermistorR = 10000/(4095/thermistorVal-1);
        T0 = thermistorR/10000;     // (R/Ro)
        T0 = log(T0);              // ln(R/Ro)
        T0 /= 3950;               // 1/B * ln(R/Ro)
        T0 += 1.0/(25+273.15);      // + (1/To)
        T0 = 1.0/T0;                 // Invert
        T0 = (T0-273.15)*(9/5)+32;  // convert to F

in these steps you are losing some precision due to the order of execution and “rounding” on the way. Divisions should always be kept to a minimum (or avoided completely if possible) and perforemed last.
I’d simplify the formular as far as possible and keep the elaborate calculation specification in a comment.

2 Likes

Scruff thanks for the good advice. I’m pretty green at coding, I couldn’t get the pin to work as a digital- so I said screw it and did it that way (and then it screwed me)…at some point I will fix that.
That is a good call on the on comparing millis() rather than keeping it in a loop.
Also agreed on the temperature calc! I will simplify that.

Thank you for taking the time and giving me some great feedback!

1 Like