From 681e57c4d51c231e8a71f68886cf70ba4d28422c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=B2=E5=B1=8E=E5=B0=86=E5=86=9B?= <37292630+wlmh110@users.noreply.github.com> Date: Sat, 27 Feb 2021 11:41:33 +0800 Subject: [PATCH] Created PiSugar WiFi config (markdown) --- PiSugar-WiFi-config.md | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 PiSugar-WiFi-config.md diff --git a/PiSugar-WiFi-config.md b/PiSugar-WiFi-config.md new file mode 100644 index 0000000..5255034 --- /dev/null +++ b/PiSugar-WiFi-config.md @@ -0,0 +1,55 @@ +# pisugar-wifi-config + +![PR build on master](https://github.com/PiSugar/pisugar-wifi-config/workflows/PR%20build%20on%20master/badge.svg) + +PiSugar BLE wifi config tool. This is a BLE GATT server to config raspberry pi wifi. + +Wifi configuration is not an easy job with raspberry pi. When you bring pi to an unfamiliar place, +having no keyboard, no display, it is not possible to reconfigure the rpi's wifi. + +`pisugar-wifi-config` makes it easy to talk to rpi via BLE and setup the wifi configuration. Your rpi +could be discovered by BLE advertisement, then configurated by pushing a simple SSID/password message. + +NOTE 1: Users need to launch `PiSugar` wechat mini program to communicate with `pisugar-wifi-config`. +NOTE 2: Only WPA-PSK is supported. + +## Build +Build and package + + sudo bash build.sh + +## Installation +Install bluez + + sudo apt install bluez + +Old bluez in the raspberry repository need to enable experimental features to support GATT. +If you don't want to enable experimental features, compile and install a newer version of +bluez from source. + + sudo sed -e 's|ExecStart=.*|ExecStart=/usr/lib/bluetooth/bluetoothd --experimental|g' + -i /lib/systemd/system/bluetooth.service + sudo systemctl daemon-reload + sudo systemctl restart bluetooth + +Download `pisugar-wifi-config_.deb` from https://github.com/PiSugar/pisugar-wifi-config/releases , and install + + sudo dpkg -i pisugar-wifi-config_.deb + +## Security consideration +GATT server stops advertising after 5 miniutes since lunached. To adjust the advertising duration, +edit `/lib/systemd/system/pisugar-wifi-config.server`, add `-t `, e.g. + + # 600 seconds + sudo sed -e 's|ExecStart=.*|ExecStart=/usr/bin/pisugar-wifi-config -t 600|g' \ + -i /lib/systemd/system/pisugar-wifi-config.service + sudo systemctl daemon-reload + sudo systemctl restart pisugar-wifi-config + +If advertising duration less or equal than 0, GATT server would never stop advertising. + +## Bug report +Report bugs here: https://github.com/PiSugar/pisugar-wifi-config/issues + +## License +GPLv3