I have half a dozen Pis to reimage right now, so this is timely. Can't wait to give it a shot today.
It gives you the ability to basically control what your Pi does (provisioning included) via an API.
21–30 of 86 posts
I have half a dozen Pis to reimage right now, so this is timely. Can't wait to give it a shot today.
It gives you the ability to basically control what your Pi does (provisioning included) via an API.
Just started using rpi with my underwater robots. Obviously the wifi cuts off when they dive, but doesn't reconnect always when they come back. Will definitely try this out.
On the other hand, I could see this being useful as an additional software package that gets run when the Pi can't find or join its usual network.
My first idea was to put an OLED and a rotary encoder on the box. That way they can do a special dance on the button to enter setup mode, scroll through a list of wifi networks, and then tediously scroll through letters to enter the wifi password. I found a 1" OLED for cheap, and already needed a button for other things, so this was a cheap, effective solution.
But having to tediously type out a password with a knob sounded very user unfriendly.
Then I realized I could bring out a USB port, and they could plug in a USB keyboard! So I worked on that for bit. It's a lot easier to use. And the whole keyboard + tiny OLED idea was kinda fun.
But then I remembered the idea of doing a WiFi AP dance. That's where the device broadcasts as an AP, you connect with your phone, browse to a webpage to tell the device your Wifi network's info, and done! It's a solution that doesn't require an OLED or for me to bring out a USB connection. Cheaper and less mechanical engineering.
To that end I found Mozilla's IoT project which, conveniently, has RasPi compatible code for doing just that dance: https://github.com/mozilla-iot/gateway-wifi-setup (By the way, Mozilla's IoT project is neat and worth checking out).
That setup is quite similar to OP, except it doesn't require a separate app. Its downside is requiring the user to mess with the wifi settings on their phone. Not a huge deal (for my target audience) but can be annoying. (Hence why OP's project uses the Bluetooth connection; Smart!)
I've been tinkering with this on and off for about two weeks. While I wasn't thrilled with the solution, it was at least usable, cheap, and easy. ... then I realized I was dumb.
I have a camera on the device. I could just have them go to a website, punch in their wifi info, encode that as a QR code, and have them show it to the camera... (It'd be a secure website I set up, so no security hygiene problems). Same benefits of being cheap and easy, while being easier to use. Using `pyzbar` to do real-time QR detection I had something working within an hour. Just hold your phone in front of the camera and it'll automatically detect, decode, and setup the wifi settings.
The only downside to this approach is that I can't conveniently display a list of nearby wifi networks; so they have to type their SSID manually.
Figured I'd share my comedy of errors in case someone is looking for ideas for wifi setup solutions. Obviously if you're just setting up a RasPi yourself it's easier to just pop a wpa_supplicant.conf on the SD card. (Though I wish Raspbian also had a way to configure hostname, authorized_keys, and disable ssh password authentication through boot files. Only way to do that today is by mounting the root filesystem which isn't convenient on, e.g., a Mac)
The overlap of people who might want to ssh and people who don't know how to configure their own wireless doesn't seem all that large. On the other hand, I could see this being useful as an additional software package that gets run when the Pi can't find or join its usual network.
I'm building a gift for someone else that uses a RasPi internally, and thus needed a user friendly way for them to configure its WiFi connection. It's been ... quite the adventure (mostly because I'm dumb). My first idea was to put an OLED and a rotary encoder on the box. That way they can do a special dance on the button to enter setup mode, scroll through a list of wifi networks, and then tediously scroll through l…
or create /boot/wpa_supplicant.conf and touch /boot/ssh and it will do the right thing on boot.
Can you seriously put wpa_supplicant.conf in /boot and it’ll work? I have honestly never heard this in 2 years of doing Raspberry Pi, after looking at tons of documentation and web sites. This wouldn’t surprise me, but I feel like it should be much better documented, given that it’s pretty much the first and biggest hurdle to getting things to work on a new image.
The overlap of people who might want to ssh and people who don't know how to configure their own wireless doesn't seem all that large. On the other hand, I could see this being useful as an additional software package that gets run when the Pi can't find or join its usual network.
My hassle is usually: Where do I dig up that keyboard and spare HDMI video source to bootstrap the Pi. Currently the MAME cabinet does that well, but not everyone has a MAME cabinet.
or create /boot/wpa_supplicant.conf and touch /boot/ssh and it will do the right thing on boot.
Can you seriously put wpa_supplicant.conf in /boot and it’ll work? I have honestly never heard this in 2 years of doing Raspberry Pi, after looking at tons of documentation and web sites. This wouldn’t surprise me, but I feel like it should be much better documented, given that it’s pretty much the first and biggest hurdle to getting things to work on a new image.
Long story short:
1. RPi broadcasts via BLE the wifi networks it can see
2. A ReactNative App lets the user choose the wifi network to connect to, pre-selected is the wifi network which the mobile is connected to
3. User enters wifi password
4. App sends it to RPI, still via BLE
5. RPi responds with IP address when successfully connected or with an error, all via BLE.
6. App can now talk to Pi via IP
7. BLE server on Pi shuts down. Done.
Advantage: user never needs to mess with changing to any ad-hoc wifi. Awesome UX.