I wouldnemiah wrote:This also seems like a generic feature that would benefit a lot of people (and myself!). I thought there would have already been a solution out there. I'm also working on a headless "box" that needs to be deployed by end users on their own wifi.
I'd be happy to give this ago, I'm more software/firmware orientated and not an expert on the Pi or Linux but it seems achievable.
Who would like to collaborate?
Code: Select all
#!/bin/bash echo "SSID:" read ssid echo "PSK:" read psk NUM=`wpa_cli add_network | tail -n 1` echo $NUM wpa_cli set_network $NUM ssid '"'$ssid'"' echo $ssid wpa_cli set_network $NUM psk '"'$psk'"' echo $psk wpa_cli set_network $NUM priority 5 wpa_cli enable_network $NUM wpa_cli save_config
Using BLE is another option. It does not address security or ease of use, necessarily.Douglas6 wrote:I'm interested in knowing why you think you 'went down the wrong path'? Either you want a Bluetooth getty connection, or you don't. It's up to you. A simple Bluetooth serial connection is a different use case.
Encrypted or not is determined by the one making the connection. The Pi is capable of both.
Code: Select all
Waiting for connection on RFCOMM channel 1 ('Accepted connection from ', ('AC:C3:3A:78:14:D9', 1)) Found ssid : Sbose_2.4GHz Bhrigs RTAC58U_2.4G ! Waiting for SSID... ssid received Bhrigs Waiting for PSK... psk received rekha123 mv wifi.conf /etc/wpa_supplicant/wpa_supplicant.conf - 0 ifdown: unknown interface wlan0 sudo ifdown wlan0 - 256 ifup: unknown interface wlan0 sudo ifup wlan0 - 256 wlan0 IEEE 802.11 ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=31 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on iwconfig wlan0 - 0 wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether b8:27:eb:13:75:0d txqueuelen 1000 (Ethernet) RX packets 90 bytes 19197 (18.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 67 bytes 12293 (12.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ifconfig wlan0 - 0 ip address: <Not Set> Finished configuration Waiting for connection on RFCOMM channel 1