Obviously, since the software driving the WiFi LED can tell four of those, the answer lies in finding the source code for the wifi service. I figured it out on Raspbian For Robots, but since I keep my GoPiGo OS card in “unaltered” state, it is a royal pain to get connected every time.
In R4R the antena_wifi.service runs this file every 10 seconds to set the LED based on the bot autodetect code and
iwgetid --scheme
returning the SSID of a network connection:
more ../Dexter/GoPiGo3/Install/antenna_wifi.sh
# 1 Detect if we are on a GoPiGo3
# 2 Detect if we have Wifi connection
# 3 Throw a yellow-orangey LED or turn it off
# If detected_robot exists and it contains GoPiGo3, or
# if it doesn't exist at all on standalone Raspbian
if [ -f "/home/pi/Dexter/detected_robot.txt" ] && grep -q GoPiGo3 /home/pi/Dexter/detected_robot.txt || [ ! -f "/home/pi/Dexter/detected_robot.txt" ]
then
if iwgetid --scheme
then
python -c "import gopigo3;GPG=gopigo3.GoPiGo3();GPG.set_led(GPG.LED_WIFI,3,1,3)"
else
python -c "import gopigo3;GPG=gopigo3.GoPiGo3();GPG.set_led(GPG.LED_WIFI,0,0,0)"
fi
fi
On R4R, autodetect source is here (I’m pretty sure it is also in the gopigo3 python site packages):
$ find …/Dexter auto_detect_robot.py | grep auto_detect