New product - when does first firmware flash happen

I am working through the process of creating a product.

I’m having a little trouble connecting all the dots, partly because Particle seems to have a few ways to do the same thing. (web IDE/Console, CLI, workbench).

For my question let’s say I’m using the web console, with a “low volume” product, which means ~30 or at least <50.

Also, it’s a two-legged setup with a web server-based application.

Here’s what I think the basic steps would be for production:

  1. I’ve developed my device firmware, have it ready to go and then locally saved a .bin file.
    – I may or may not have customized the SoftAP for user device setup
  2. I’ve created my OAuth client that enables my web server-based application (two-legged) to create new customers
    – my server-based application is programmed to create users, obtain device claim codes, and hand them off to a device
  3. I’ve defined my Product with Particle, using the Particle console
  4. I’ve added my firmware (.bin) file to the product in the Particle console firmware section

Now, I think that’s “all I have to do” to be in production?

Next, I open up a virgin box of Photons (or P1/P0, Argon, or other WiFi device) and…

  1. In the Particle console I add the device to the product using the device’s serial number on the label/barcode

  2. I pop a Photon (or P1/P0 or Argon) into the hardware.

Now, at this point I could ship the product - untested.

  1. The customer creates an account in the web server application, and then proceeds to set up the product
  2. The customer powers the product, then connects to the Photon’s WiFi SoftAP, at which point the claim code is sent to the Photon via the JavaScript API
  3. The customer enters in local WiFi parameters, the Photon connects, the firmware is downloaded automatically (OTA) and the customer is off and running

Now, here are my questions.

A. Have I outlined one possible process? Would this be the simplest for a low-volume setup?

B. Is the firmware download in step 9 as I described it? Is that “reliable”? I guess if there is a problem, they could put the device in listening mode and repeat the process?

C. How would I insert a testing step?
(i). Seems that I would connect it to the USB port of my computer, then go through the Particle CLI with a “particle setup” to set WiFi and claim, particle flash to flash it, and then test it, Particle device remove to unclaimed it before shipment to a customer

Thank you!

I would suggest you flash via wire your photon/P1 whilst in the factory and claim it and then setup wifi. We do this and have a setup handshake with our own web app console. We always run ‘burn-in’ for a day and have an initial test checklist. The last step before shipping is to remove factory wifi credentials.

For low volume products it makes sense to spend time in the factory to ensure everything is working before shipping.

We don’t give customers any visibility of a particle account and manage everything through the product model and using the console. This may not suit your product architecture.

There are some new features from device OS 1.2.0 to enable better control over OTA flashes that might be worth you exploring.

Thank you Armor!

Okay, to make sure I have a process, using your suggestions, I’d do the following:

  1. I’ve developed firmware, then saved it locally (.bin)
    – I’d add a SoftAP customization to my firmware to allow customer WiFi changes

  2. I’ve created my OAuth client for two-legged authentication, then added that to my web server-based application

  3. I’ve defined my Product with Particle, using the Particle console

  4. I’ve added firmware to the product in the Particle console firmware section (optional)

  5. I add new Photons to the product in the Particle Console using the device’s serial number

  6. Set up Particle device using Particle CLI. (“particle setup”)
    this claims the device under my account, and sets up WiFi

  7. I load my firmware on the new Photon using Particle CLI
    put the device in DFU mode with the mode/setup buttons, then “particle flash --usb myfirmware.bin”

  8. Test hardware with my application

  9. Unclaim device with Particle CLI to allow another customer to claim it. ("particle device remove ")

  10. Ship to the customer

  11. The customer creates an account in the web server application, and then proceeds to set up the product

  12. The customer powers the product, then connects to the Photon’s WiFi SoftAP, at which point the claim code is sent to the Photon via the JavaScript API

  13. The customer enters in local WiFi parameters, the Photon connects, the firmware is downloaded automatically (OTA) and the customer is off and running

In particular, are steps 6-9 correct? Does “particle device remove” also clear the credentials, or, is there something else I need to do there?

bump - can someone who has the experience confirm the process I’ve laid out in this thread (message 3)?

In particular, I want to verify steps 6-9 to temporarily claim - flash - test - unclaim a Photon that I would ship to a customer.

If there’s any comments about a better process, I’d also appreciate. I want to get the thumbs up from someone who knows before I invest too much time on trial and error.