Argon: what is the process to set the wifi credentials via BLE?

Hi all,

Can someone describe the process to set wifi credentials via BLE on an Argon?

Maybe if we have that “on paper” we can collectively think about fixing this issue for those who want to have Argons in their products.

Potential candidates to have this info: @will @rickkas7 @jensck_particle

Thank you everyone!
Gustavo.

2 Likes

do you mean a custom mechanism in your own app? If so, the following may be useful for reference.

FW:

And accompanying web app:

1 Like

Hi Cliff,

I see, let me investigate a bit your approach. Thank you for posting about it!
Gustavo.
PS: for future reference, previous discussions related to simpleIoT can be found here, here, here and here.

Cliff,

I have an Argon running with your firmware.
When I am scanning with your .org site, what am I supposed to see in the “wants to pair” menu?
The argon name?
This line: const BleUuid serviceUuid(“5c1b9a0d-b5be-4a40-8f7a-66b36d0a5176”);?

Thanks!

oh, I opened the dev tools on Chrome and observed a GATT server error not connected, so I reloaded the page and that went away.
I started connecting to all those I saw and then once connected the unknown device became an Argon:

I guess the Argon name cannot be obtained somehow via this mechanism without connecting first or am I doing something wrong?
Thanks again
Gustavo.

Below is what it looks like on my Android phone.

I’ve not dug into if we can make the name appear as Argon, or something prettier – likely possible.

In the scan box, I think we can also filter and only display BLE devices of a certain type.

A side note – the siot Go frontend is going through a major overhaul in the feature-ui2-orgs branch to add auth, user, and org support. In the process we switched from elm-bootstrap to elm-ui for the frontend UI toolkit. I hope to merge this to master this week. The BT web UI will need ported to the new framework.

One more note for anyone doing webbt development – browsers only let you use webbt apis from secure HTTPS or localhost sites. If you are running the browser on your development machine this works OK. For debugging on phones, this is a little more difficult. One solution is to set up a secure http server (mkcert + caddy), copy certs to phone, etc. However an easier way is to port forward to your phone, and then just access localhost from phone:

2 Likes

ok, thank you for the insights.
Now, do you have a trick to identify the argon when the scan comes back with 10 devices or more? How do we know which one in the list is the Argon?

Thanks again,
Gustavo.

In order to see the device name before connecting to it you need to advertise the name.
But you need to consider the very limited space (32byte) the advertisement data can hold.
If you expose a 128bit UUID a fair amount is already gone so your name cannot be any longer that 15 characters otherwise it will be ignored.

For gain back some space for a longer name you can advertise a shortened Service UUID (2 or 4 byte).

thanks

For advertising a short name, one does something like this?


const BleUuid serviceUuid("argon");

BleAdvertisingData data;
data.appendServiceUUID(serviceUuid);
BLE.advertise(&data);

thanks

rather something like this

BleAdvertisingData data;
data.appendLocalName("argon");
BLE.advertise(&data);

https://docs.particle.io/reference/device-os/firmware/argon/#appendlocalname-

2 Likes

This may complement what @cbrake has developed above:

1 Like

related topic: