Argon Wifi Setup via normal serial?

Is there a command I can run from normal serial to prompt the wifi setup or auto-set the wifi credentials?

I want to write my own python script that manages setup, but how do I prompt setup or do a direct set from serial?

You can try the legacy feature and press “w” once you have a serial connection.
It was there in the past, but no idea whether that still exists :see_no_evil:

Yes, the w command in listening mode still works on the P2. That’s actually what particle serial wifi in the Particle CLI does to configure the Wi-Fi.

1 Like

Can I trigger the listening mode from the serial?

Yes, connect to the USB serial port at 28800 baud and the device will go into listening mode.

Keep in mind this is not the recommended way to set Wi-Fi credentials - we recommend using one of the methods here instead, but it should work.

1 Like

I now see why this isn't recommended. The device isn't claimed in the process. Is there a way to pull the device id over serial also?

I'm sure there is a way to do it via Particle CLI and Python, but what I found works well when commissioning devices is using a 2D barcode scanner to just scan the code on the Boron. That way, I didn't need to do any CLI commands in Python to get the Serial number of Device ID. The 2D barcode scanner makes for quick work! This is what I use: 2D QR Barcode

Here is an early version of a Python script I use to commission a device I reference in a post sometime back.

Basically this script will:

  1. Add a device to a product
  2. Claim the device to an admin account
  3. Add notes and change the device name
  4. Add it to my SQL backend
  5. Flash my user application firmware via Hex file

I was using this for cellular based devices so I never added the WiFi step. Are you initiating Particle CLI commands from the Python script to setup WiFi then? If so, you mind sharing a code snippet of that as I may want to add that to the Python script in the future.

You can send "i" for identify to retrieve the device ID.

Or use CLI particle serial identify

1 Like

For products, we do not recommend claiming devices. It's no longer necessary and creates an extra step during device onboarding.

If you do have one of the rare cases where you need to claim devices, we recommend that you claim them at the same time you add them to your product. As long as you claim to a team member account, the device does not have to be online.

The exception is if you are using two-legged shadow customers, you will need to claim when the device first comes online. But we recommend that you don't use shadow customers as it also adds unnecessary complexity in the vast majority of cases.

1 Like

So there is no automated way of doing this other than one by one by one with USB and a webapp?

This really sucks.. there needs to be a better way, I'm looking at using 300+ of these per customer and I will have to hire someone just to set these up...

Maybe at the scale of 300 devices per customer that you mention, it could be cheaper or faster to develop a small firmware that you flash on these devices via USB that will setCredentials() on the device.
Or even a particular version of the product's firmware after you added all the devices to the product, as this flashing can be done via the product's API.

Then you can proceed to flash the final firmware of the product since the wifi settings are remembered by the device.


1 Like

@gusgonnet, that's a good idea. I was thinking something similar.

If you can use setCredentials() from application firmware, you are already connecting a USB cable for the commissioning step and using a Python script to commission. Then you could just use Serial.Available(), Serial.Read() and Serial.Write() to handshake between a Python script and the application firmware to send it the info over serial. This way you don't need to generate new application code for each WiFi SSID you want to configure. I effectively do this already for some non-particle devices in order to write a device serial number and other device configuration data to EEPROM through the Python script while commissioning. This way it's always the same application firmware for all devices.

Obviously doing just the set WiFi step in Python, is completely unnecessary. The value is doing ALL steps when commissioning a new device in the same Python script. This way commissioning a device from out of the box is just a matter of plugging it in via serial, running the python script, scan it in via a 2D barcode and you are done. Just an idea...

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.