cjimti / iotwifi

Raspberry Pi (arm) wifi configuration container. Configure and control wifi connectivity with a JSON based REST api.
https://imti.co/iot-wifi/
MIT License
303 stars 124 forks source link

Cannot save connected WIFI information into wpa_supplicant.conf #28

Closed DJNoblesse closed 5 years ago

DJNoblesse commented 5 years ago
  1. run docker container on boot
    # Add below command to ~/.config/lxsession/LXDE-pi/autostart
    docker run --rm --privileged --net host \
    -v /path/to/wificfg.json:/cfg/wificfg.json \
    -v /path/to/wpa_supplicant.conf:/etc/wpa_supplicant/wpa_supplicant.conf \
    cjimti/iotwifi
  2. Try to connect WIFI network
    $ curl -w "\n" -d '{"ssid":"MYSSID","psk":"mypassword"}' \
    -H "Content-Type: application/json" \
    -X POST localhost:8080/connect
  3. check wpa_supplicant.conf (or just reboot and check network status)
    $ sudo docker exec CONTAINER_ID ls -al /etc/wpa_supplicant/

Here is my result of step 3. test_result

cjimti commented 5 years ago

It does not write the wpa_supplicant.conf, it stores the network in the wpa_supplicant network interface. Network configurations should survive a reboot. This is technically not a bug and the intended design.