Python version of wifi-connect now available

Hello everyone,
We had been using the balena.io wifi-connect (written in Rust), but I needed to make some changes to it and had issues getting rust to cross compile for ARMv6 and 7.

So I wrote a very similar application in Python as an open source project. My entire stack is in python, so it was a logical choice for us. The only feature difference between the two projects is python-wifi-connect allows the user to supply a hidden SSID.

https://github.com/OpenAgricultureFoundation/python-wifi-connect

Thanks,
-rob

4 Likes

Thank you for sharing this project @rbaynes! Python has probably a wider audience than Rust when it comes to changing the source code. :slight_smile:

@rbaynes welcome to the forums, this is great! Do you have a Dockerfile for the project to run it on balenaCloud? I’d be interested to know if you have a start script example too. For example when I added wifi-connect to the balenaDash project, I just needed to add a Dockerfile and start script (example here); if you had something similar it would make it really easy for users to add this to their project and take advantage of the extra features. If you don’t already have one, I’ll add it to my todo list to make one and PR it when I get some time.

Thanks for sharing!

Thanks for looking it over @pdcastro

@chrisys the way we use it is:

  • add the python-wifi-connect as a git submodule of our balena cloud project (also in Python).
  • add this to our Dockerfile.template
# Copy the submodule code to the container:
ADD python-wifi-connect /opt/python-wifi-connect
EXPOSE 80
  • add this to the ENTRYPOINT script run by the Dockerfile.template
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
echo "Setting up wifi connection. Connect to the PFC_EDU-${RESIN_DEVICE_NAME_AT_INIT} access point"
cd /opt/python-wifi-connect
./scripts/run.sh

I’m sorry our balena cloud project is still private so I can’t send you a link, it will be public when we release the next version of our device later this summer.

Thanks! I also just talked to @majorz (the author of our wifi-connect project) who said he’d take a look and review your project too :slight_smile:

Looking forward to seeing your project when it comes out in the summer - we’re always looking for guest posts on our blog as well if you feel like writing about the project when it is time to release.

The next feature for the project is to make it work on a captured portal.

1 Like

@chrisys @majorz I submitted an issue to your wifi-connect asking you to review my project. So you can close that issue any time!

Captive portal support would be amazing! I would love to see that :heart_eyes:

Sure, I have to make some other posts about our next project (on discourse to our community), so I can do the same here.

This is our current v3 version of the device based on a beaglebone black.

The next version will be base on the RPi CM on an updated board we are building. And of course app delivery will be via the balena cloud (thanks for the great product).

Hi @rbaynes,

I’ve been seeing your project and testing it, it seems excellent.

I have even taken some parts of code to include in mine, unfortunately after several days I could not achieve my goal. and I would like to ask you for some help.

What I need to do is put the device connected to the Wi-Fi as a client, at the same time that it is in AP, but once the connection is configured and activated, the AP connection dies.
Do you have knowledge of how to have both connections active? I would greatly appreciate some example. I have also read the NetworkManager documentation a lot but it has not helped me.

Thank you,
att Daniel

Does anyone test this for JETSON TX2 ? Is it working for TX2 ?

Our team hasn’t tested it yet, being a community project, but will give it a try when tomorrow have access to a TX2 device. Are you asking @yyogeshwar because you hit any issues, or just curious?
Will post more tomorrow after a try.

I hit an issues , for normal wifi-connect application

@imrehg got time to test it on jetson tx2 ?

Hi @yyogeshwar,

Are you referring still to the issues you reported in Wifi-connect issues - not showing access point on JETSON TX2? If so, it’ll be easier to continue debugging in that thread rather than in this thread.

@thundron had some further tests for you to try in the most recent message: Wifi-connect issues - not showing access point on JETSON TX2