Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"RaspiWiFiConfig setup mode detected" even when not running in AP host mode #217

Open
benwiley4000 opened this issue Sep 21, 2022 · 1 comment

Comments

@benwiley4000
Copy link

I installed RaspiWiFi to be able to easily connect to new networks with an access point. All works smoothly now but I'm not seeing a misleading message on the splash screen instructing me to connect to the access point, even if I'm already connected to a wifi network and there's no access point running from the raspberry pi. It seems we aren't actually detecting which mode we're in, just if RaspiWiFi is installed at all. Would this be a simple fix? I'm wondering if I can modify my existing installation to avoid setting up everything all over again.

@benwiley4000
Copy link
Author

benwiley4000 commented Sep 22, 2022

I found a solution for an existing installation.

Step 1:

sudo nano /etc/rc.local

Step 2:

Apply this diff:

@@ -1,3 +1,8 @@
 if [ "$_IP" ]; then
-  /usr/bin/python3 /home/pi/pikaraoke/app.py --use-vlc >> /var/log/pikaraoke.log 2>&1 &
+  if [ "$(ifconfig | grep "inet 10.0.0.1 ")" ]; then
+    # Host mode; show instructions for connecting to wifi
+    /usr/bin/python3 /home/pi/pikaraoke/app.py --use-vlc >> /var/log/pikaraoke.log 2>&1 &
+  else
+    /usr/bin/python3 /home/pi/pikaraoke/app.py --use-vlc --hide-raspiwifi-instructions >> /var/log/pikaraoke.log 2>&1 &
+  fi
 fi

(You can remove the existing if [ "$_IP" ] block and replace with the following):

if [ "$_IP" ]; then
  if [ "$(ifconfig | grep "inet 10.0.0.1 ")" ]; then
    # Host mode; show instructions for connecting to wifi
    /usr/bin/python3 /home/pi/pikaraoke/app.py --use-vlc >> /var/log/pikaraoke.log 2>&1 &
  else
    /usr/bin/python3 /home/pi/pikaraoke/app.py --use-vlc --hide-raspiwifi-instructions >> /var/log/pikaraoke.log 2>&1 &
  fi
fi

Note that the main difference is the addition of the --hide-raspiwifi-instructions flag (undocumented) in the case that there is no local IP for 10.0.0.1. This IP should only be defined when we're in wifi access point mode.

I chose this method for detecting the wifi mode after asking in the RaspiWiFi repo: jasbur/RaspiWiFi#118 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant