Strange error while adding a device with the Particle app

boron
Tags: #<Tag:0x00007f1ca2cd87a8>

#1

I have a Boron that was up and running with a 3rd party SIM. As a test I decided to do a factory reset, pull the 3rd party SIM, unclaim, and re-add the device with the Particle app (iphone). The QR code scan and initial connection worked, but the next step failed with the following error message:

image

There is no longer an external SIM and the APN from initial use has been reset. The internal SIM was also released so it could be reclaimed. Has anyone seen this error and gotten past it?


#2

The ext SIM setting is sticky. You need to explicitly tell the device to start using the internal SIM again in code via Cellular.clearCredentials() and Cellular.setActiveSim(INTERNAL_SIM);


#3

Originally I set it with this:

#include "Particle.h"
#include "dct.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
	Cellular.setActiveSim(EXTERNAL_SIM);
	Cellular.setCredentials("m2mxxxxxx.attz");
	// This clears the setup done flag on brand new devices so it won't stay in listening mode
	const uint8_t val = 0x01;
        dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);
	// This is just so you know the operation is complete
	pinMode(D7, OUTPUT);
	digitalWrite(D7, HIGH);
}
void loop() {
}

Then set it back with this before attempting to reset it:

#include "Particle.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
	Cellular.setActiveSim(INTERNAL_SIM);
	Cellular.clearCredentials();
	// This is just so you know the operation is complete
	pinMode(D7, OUTPUT);
	digitalWrite(D7, HIGH);
}
void loop() {
}

One thing that might also be going on, there is no backup firmware already saved on this device, so I can’t honestly say that what the factory reset did. At this point when powering the device on the following sequence of flashes are presented:

  • OTA firmware update mode flashing (for 2 seconds)
  • dfu mode flashing (for 7 seconds)
  • fast white flashing (for 2 seconds)
  • solid white (for 1 second)
  • listening mode flashing

What else can I try at this point?


#4

What firmware have you flashed after your reset code?
Since you are using SEMI_AUTOMATIC in that code the device won’t connect unless you either put it in Safe Mode or flash some code that would allow it to connect.
You can try particle flash --usb tinker in DFU Mode.


#5

I may be stuck since the APN reset firmware was the last item flashed. At this point the device won’t stay in DFU mode and the host computer never detects the USB device. After 7 seconds it proceeds from DFU flashing light to the rest of the cycle - white flash, white solid, blue flash.

Going back to the original symptom, is it possible that, since this is a Boron that was added once before, there is some sticky info on the server side for this device ID? Otherwise, how did it determine that an external sim card was once in use?


#6

That sounds weird. 3rd party SIM setup should not have that side effect.

If you can go into Listening Mode, you should also be able to flash via particel flash --serial tinker

Does your device eventually make it to breathing cyan or magenta?


#7

Some progress!


Still stuck though in the following ways:

  • claim is not working
    image
  • Particle ios app still hits original error related to external sim
  • Boron will not go into DFU mode

#8

Just compiled Doctor.ino and flashed that, connected to Serial with PuTTY, could type commands. Next compiled and flashed the SIM reset program, so now that ran. It is so strange that for all the things that are working, the ios app still complains about an external sim.


#9

Is it possible to refresh/reload the DeviceOS on the Boron?


#10

particle update should be the command that flashes the most recent device OS.
If you want to go to any earlier version you’d need to download the binaries from here


and flash via particle --usb flash <systemBinary>


#11

Thank you. I think that dfu-mode for this Boron is not possible. The hardware button combination starts out promising but after 7 seconds of dfu-mode blinking proceeds into white breathing followed by blue listening. No interrupts on the USB are detected by my laptop. I wonder if Particle would want this one to take a closer look at?


#12

EDIT: Appears I was wrong, seems like you can set active sim before modem is fully on.

Regardless, make sure you have fully followed all the steps in this post by rickkas7: Setting up a Boron with a 3rd-party SIM card

And DFU mode stuff is still strange, sorry that I don’t have any thoughts beyond the earlier ones already mentioned. If you have access to a JTAG programmer you can update the system firmware that way if needed, though.


#13

You may need to refresh your bootloader via particle flash --serial <bootloaderBinary.bin>
DFU Mode is executed via the bootloader and should not just end without external reasons.


#14

This little guy is not happy:

C:\Users\THINKCENTRE\Downloads>particle flash --serial bootloader-0.9.0-boron.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE
sending file: bootloader-0.9.0-boron.bin
(blinks safe mode...)
Error writing firmware: unknown message

I appreciate everyone who is slogging through this with me.