guild icon
Toit
#Captive Portal + Artemis
Thread channel in help
bpmct
bpmct 05/03/2025 10:48 PM
I am hoping to run a fleet of devices that I can hand to friends and they can initialize on their own wifi after plugging in via a captive portal.

From there, I'd love to push updates. Architectually, I'm still getting my footing here so I was wondering if anybody had any pointers on whether this is possible today/things to look our for or any recommendations on how to do this... I am assuming I could register it on my WiFi, and then have some "fallback" captive portal if the connection fails... seems the safest because it'd also allow people to move their devices but unsure what this means in practice or whether artemis supports this
bpmct
bpmct 05/03/2025 10:51 PM
I see https://github.com/kasperl/toit-zygote/tree/main so should I have connections blank in artemis and rely on the captive portal code to register itself?
Contribute to kasperl/toit-zygote development by creating an account on GitHub.
bpmct
bpmct 05/03/2025 11:06 PM
I just discovered https://github.com/kasperl/toit-zygote/pull/2/files. Would you like help completing this?
GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.
Discord embed media
Discord embed media
Discord embed media
floitsch
floitsch 05/06/2025 07:13 AM
Yes. Toit zygote is the demo project for captive portals.
I think we have ways to make it work nicely with Artemis but I don't have that in my head at the moment. I will try to look things up and come back to you (don't hesitate to ping).
We are always interested in contributions and feedback (positive and negative).
floitsch
floitsch 05/06/2025 09:54 AM
Also of note: I'm planning to write some demo projects for Artemis soon, and I will likely put "captive portal" high on the list. So hopefully we will have some code for this soon.
floitsch
floitsch 05/06/2025 09:55 AM
The way to write this is to have a WiFi connection without SSID/password.
That means that Artemis uses the credentials that are stored in flash (using open ... --save: https://libs.toit.io/net/wifi/library-summary#open(4%2C0%2C0%2Cname%2Cpassword%2Csave%2Cssid))
👍1
floitsch
floitsch 05/06/2025 09:56 AM
A container (maybe triggered by a pin?) can then start the captive portal and call the open function. Once the credentials are set, Artemis should be able to connect to the network.
bpmct
bpmct 05/06/2025 03:24 PM
I actually got this working last night by simply passing no connections to Artemis and handling WiFi connection and setting entirely in the application logic.

I’ll submit a PR in a few days with some of my captive portal findings, even just with the goal of documenting what I discovered. What I’m doing is currently pretty jank, but it does also support launching the portal if the connection fails (e.g. no ssid, invalid password) as well as some other fallback scenarios that zygote didn't seem to handle (or I simply didn't understand).

More than happy to work with you to de-jank it and get it into zygote. Or even a pkg someone could import. Finishing up some other validation work now in the meantime
(edited)
bpmct
bpmct 05/06/2025 03:27 PM
I was very pleased to learn passing no connections to artemis not only worked, but also artemis picked up and communicates on the existing network set via the app logic.
floitsch
floitsch 05/06/2025 03:38 PM
Nice.
We would definitely appreciate any improvements to the zygote code.
👍1
10 messages in total