txwifi icon indicating copy to clipboard operation
txwifi copied to clipboard

Doesn't seem to re-connect to configured wifi access point on restart (of container) or reboot of pi

Open sethwebster opened this issue 4 years ago • 2 comments

  • I'm submitting a ...

    • [X] bug report
  • What is the current behavior? Everything is up and running ok, and am able to get the wifi access point set. A wpa_supplicant.conf is created in /etc/wpa_supplicant/wpa_supplicant.conf. If I stop the container, the wifi connection to the configured AP is terminated, which makes sense. However, should it use the previous configuration upon starting the container again?

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  1. Follow instructions in the README.MD
  2. curl the api and set a wifi access point.
  3. ping external server to confirm working (ie google.com)
  4. stop the container
  5. restart the container
  6. ping external server, or ifconfig wlan0 and observe no ping is possible and no ip lease exists
  • What is the expected behavior? Previously configured wifi access point is used upon starting the container.

  • What is the motivation / use case for changing the behavior? Use to provide configuration of wifi access point to IOT device and have that configuration persist across restarts.

  • Please tell us about your environment:

    • Device: RP 4B
    • OS: raspbian buster
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

sethwebster avatar Aug 04 '20 04:08 sethwebster

🦗

sethwebster avatar Aug 12 '20 02:08 sethwebster

I am an extreme novice when it comes to Docker, but I got it working like this You will need to mount the container with a volume.

docker volume create vol1

And then run the container like so

docker run -d --privileged --net host \
      -v $(pwd)/wificfg.json:/cfg/wificfg.json \
      --mount source=vol1,target=/etc/wpa_supplicant/ \
      cjimti/iotwifi

adityat90 avatar Sep 05 '20 11:09 adityat90