Disable hostapd and dnsmasq across reboot

I have a Raspberry Pi 3 running GoPiGo 3.0.3. I would like the robot to boot and connect to my local WiFi and not start up its own WiFi access point. I have found the scripts to switch back and forth manually, but the changed settings do not survive a reboot. The wpa_supplicant service is disabled and hostapd/dnsmasq re-enabled with every reboot. How do I preserve the wpa_supplicant configuration as the default WiFi?

3 Likes

I also ran into that. Suggest popping a note off to support@modrobotics.com

IIRC, the prior GoPiGo OS version succeded, but the latest did not. It’s been a while since, so I could be totally crazy.

2 Likes

There is a special command/script that you can run that makes the switchover (either way) persistent.

I usually run it on every GoPiGo OS I run, unless there’s a special reason for it to be autonomous, (like my updated remote camera robot project).

2 Likes

I found it.

It took most of the day to find, but here it is:

2 Likes

Actually, I’d already found that service, and it was also recommended by modrobotics.com support. Unfortunately, disabling it didn’t work. I can switch to local WiFi, disable start_as_access_point, hostapd, and dnsmasq, and enable wpa_supplicant for auto start, and during the boot process something in systemd still turns off wpa_supplicant and turns on hostapd and dnsmasq, even with start_as_access_point disabled. It joins local WiFi for a couple of seconds, then reverts back to access point mode. Everyone is stumped at this point.

3 Likes

I’ve been away from this for awhile so would you mind reminding me what your configuration is, the OS and version you are using, what version of Pi, etc., etc., etc.

[Oops! I just found it, Pi-3, GPGOS 3.0.3, etc.]

Is this on a GoPiGo robot? Do you know the version? (i.e. Color of PCB, (red/green ), number of connector pins (26/40) on the GPG board itself, etc.) If it’s a GoPiGo 3, I may be able to help.

Since I’m not clairvoyant, and I don’t have eyes on the back of my head, (:wink: :rofl:), if I send you a cloud upload link, is it possible for you to send me an image copy of your entire filesystem?

This way I can examine it personally, in detail, to try and replicate and solve your issue.

What say ye?

1 Like

Yes, this is on a GoPiGo robot. The following is from my /var/log/syslog file, demonstrating that the system comes up with local WiFi enabled, as expected. Then systemd appears to start the access point mode directly, enabling hostapd and dnsmasq. The start_as_access_point service remains disabled and never starts.

Jan 16 22:13:17 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:13:31 pi30 systemd-timesyncd[381]: Synchronized to time server for the first time 45.33.103.94:123 (2.debian.pool.ntp.org).
Jan 16 22:13:31 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
Jan 16 22:13:31 pi30 env[997]: WiFi_led_status.sh: connection_status = -1
Jan 16 22:13:31 pi30 env[997]: WiFi_led_status.sh: No Access Point
Jan 16 22:13:31 pi30 env[997]: xxxxxxxxxx
Jan 16 22:13:31 pi30 env[997]: WiFi_led_status.sh: Yellow
Jan 16 22:13:33 pi30 env[997]: WiFi_led_status.sh, ssid: pi30
Jan 16 22:13:33 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:13:34 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
Jan 16 22:13:34 pi30 env[997]: WiFi_led_status.sh: connection_status = -1
Jan 16 22:13:34 pi30 env[997]: WiFi_led_status.sh: No Access Point
.....
Jan 16 22:13:36 pi30 jupyter[826]: [I 22:13:36.728 LabApp] JupyterLab extension loaded from /home/jupyter/.local/lib/python3.7/site-packages/jupyterlab
Jan 16 22:13:36 pi30 jupyter[826]: [I 22:13:36.729 LabApp] JupyterLab application directory is /home/jupyter/.local/share/jupyter/lab
Jan 16 22:13:36 pi30 jupyter[826]: [I 22:13:36.749 LabApp] Serving notebooks from local directory: /home/jupyter
Jan 16 22:13:36 pi30 jupyter[826]: [I 22:13:36.750 LabApp] The Jupyter Notebook is running at:
Jan 16 22:13:36 pi30 jupyter[826]: [I 22:13:36.750 LabApp] http://pi30:8090/
Jan 16 22:13:36 pi30 jupyter[826]: [I 22:13:36.750 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Jan 16 22:13:36 pi30 jupyter[826]: [W 22:13:36.773 LabApp] No web browser found: could not locate runnable browser.
.....
Jan 16 22:13:40 pi30 systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Jan 16 22:13:40 pi30 hostapd[1783]: Configuration file: /etc/hostapd/hostapd.conf
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: carrier lost
Jan 16 22:13:40 pi30 hostapd[1783]: wlan0: Could not connect to kernel driver
Jan 16 22:13:40 pi30 hostapd[1783]: Using interface wlan0 with hwaddr b8:27:eb:a5:14:93 and ssid "pi30"
Jan 16 22:13:40 pi30 hostapd[1783]: wlan0: interface state UNINITIALIZED->ENABLED
Jan 16 22:13:40 pi30 hostapd[1783]: wlan0: AP-ENABLED
Jan 16 22:13:40 pi30 systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Jan 16 22:13:40 pi30 avahi-daemon[453]: Withdrawing address record for 10.89.1.168 on wlan0.
Jan 16 22:13:40 pi30 avahi-daemon[453]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 10.89.1.168.
Jan 16 22:13:40 pi30 avahi-daemon[453]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: deleting route to 10.89.1.0/24
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: deleting default route via 10.89.1.254
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: carrier acquired
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: confile file changed, expiring leases
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: IAID eb:a5:14:93
Jan 16 22:13:40 pi30 dhcpcd[844]: wlan0: probing address 10.10.10.10/24
Jan 16 22:13:40 pi30 systemd[1]: Stopping Raise network interfaces...
Jan 16 22:13:40 pi30 systemd[1]: networking.service: Succeeded.
Jan 16 22:13:40 pi30 systemd[1]: Stopped Raise network interfaces.
Jan 16 22:13:40 pi30 systemd[1]: Starting Raise network interfaces...
Jan 16 22:13:40 pi30 systemd[1]: Started Raise network interfaces.
Jan 16 22:13:40 pi30 systemd[1]: Reloading.
Jan 16 22:13:41 pi30 dhcpcd[844]: wlan0: carrier lost
Jan 16 22:13:41 pi30 kernel: [ 53.217866] ieee80211 phy0: brcmf_vif_set_mgmt_ie: vndr ie set error : -52
Jan 16 22:13:41 pi30 dhcpcd[844]: wlan0: carrier acquired
Jan 16 22:13:41 pi30 dhcpcd[844]: wlan0: IAID eb:a5:14:93
Jan 16 22:13:41 pi30 dhcpcd[844]: wlan0: probing address 10.10.10.10/24
Jan 16 22:13:41 pi30 dhcpcd[844]: wlan0: carrier lost
Jan 16 22:13:41 pi30 systemd[1]: Stopping dhcpcd on all interfaces...
Jan 16 22:13:41 pi30 dhcpcd[1942]: sending signal TERM to pid 844
Jan 16 22:13:41 pi30 dhcpcd[1942]: waiting for pid 844 to exit
Jan 16 22:13:41 pi30 dhcpcd[1942]: sending signal TERM to pid 844
Jan 16 22:13:41 pi30 dhcpcd[1942]: waiting for pid 844 to exit
Jan 16 22:13:41 pi30 dhcpcd[844]: received SIGTERM, stopping
Jan 16 22:13:41 pi30 dhcpcd[844]: wlan0: removing interface
Jan 16 22:13:41 pi30 dhcpcd[844]: eth0: removing interface
Jan 16 22:13:42 pi30 dhcpcd[844]: dhcpcd exited
Jan 16 22:13:42 pi30 env[997]: WiFi_led_status.sh, ssid: pi30
Jan 16 22:13:42 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:13:42 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
Jan 16 22:13:42 pi30 env[997]: WiFi_led_status.sh: connection_status = -1
Jan 16 22:13:42 pi30 env[997]: WiFi_led_status.sh: No Access Point
Jan 16 22:13:42 pi30 env[997]: no Wifi Connection detected: OFF
Jan 16 22:13:42 pi30 systemd[1]: dhcpcd.service: Succeeded.
Jan 16 22:13:42 pi30 systemd[1]: Stopped dhcpcd on all interfaces.
Jan 16 22:13:42 pi30 systemd[1]: Starting dhcpcd on all interfaces...
Jan 16 22:13:42 pi30 dhcpcd[1976]: dev: loaded udev
Jan 16 22:13:42 pi30 dhcpcd[1976]: forked to background, child pid 1978
Jan 16 22:13:42 pi30 systemd[1]: Started dhcpcd on all interfaces.
Jan 16 22:13:42 pi30 dhcpcd[1978]: wlan0: connected to Access Point `'
Jan 16 22:13:42 pi30 dhcpcd[1978]: DUID 00:01:00:01:26:60:d3:bd:dc:a6:32:2d:d2:ae
Jan 16 22:13:42 pi30 dhcpcd[1978]: eth0: IAID eb:f0:41:c6
Jan 16 22:13:42 pi30 dhcpcd[1978]: eth0: adding address fe80::f935:3e98:71e7:2b8d
Jan 16 22:13:42 pi30 dhcpcd[1978]: ipv6_addaddr1: Operation not supported
Jan 16 22:13:42 pi30 dhcpcd[1978]: wlan0: waiting for carrier
Jan 16 22:13:43 pi30 kernel: [ 54.624981] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
Jan 16 22:13:43 pi30 systemd[1]: Reloading.
Jan 16 22:13:43 pi30 dhcpcd[1978]: eth0: rebinding lease of 10.89.1.150
Jan 16 22:13:43 pi30 dhcpcd[1978]: eth0: leased 10.89.1.150 for infinity
Jan 16 22:13:43 pi30 dhcpcd[1978]: eth0: adding route to 10.89.1.0/24
Jan 16 22:13:43 pi30 dhcpcd[1978]: eth0: adding default route via 10.89.1.254
Jan 16 22:13:43 pi30 dhcpcd[1978]: eth0: soliciting an IPv6 router
Jan 16 22:13:43 pi30 dhcpcd[1978]: ipv6nd_startrs1: Address family not supported by protocol
Jan 16 22:13:43 pi30 systemd[1]: Reloading.
Jan 16 22:13:44 pi30 systemd[1]: systemd-hostnamed.service: Succeeded.
Jan 16 22:13:44 pi30 systemd[1]: Reloading.
Jan 16 22:13:45 pi30 env[997]: WiFi_led_status.sh, ssid: pi30
Jan 16 22:13:45 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:13:45 pi30 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jan 16 22:13:45 pi30 dnsmasq[2067]: dnsmasq: syntax check OK.
Jan 16 22:13:46 pi30 dnsmasq[2091]: started, version 2.80 cachesize 150
Jan 16 22:13:46 pi30 dnsmasq[2091]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Jan 16 22:13:46 pi30 dnsmasq[2091]: warning: interface wlan0 does not currently exist
Jan 16 22:13:46 pi30 dnsmasq[2091]: warning: ignoring resolv-file flag because no-resolv is set
Jan 16 22:13:46 pi30 dnsmasq-dhcp[2091]: DHCP, IP range 10.10.10.11 -- 10.10.10.254, lease time 2h
Jan 16 22:13:46 pi30 dnsmasq[2091]: using nameserver 8.8.4.4#53
Jan 16 22:13:46 pi30 dnsmasq[2091]: using nameserver 8.8.8.8#53
Jan 16 22:13:46 pi30 dnsmasq[2091]: read /etc/hosts - 9 addresses
Jan 16 22:13:46 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
Jan 16 22:13:46 pi30 env[997]: WiFi_led_status.sh: connection_status = -1
Jan 16 22:13:46 pi30 env[997]: WiFi_led_status.sh: No Access Point
Jan 16 22:13:46 pi30 env[997]: no Wifi Connection detected: OFF
Jan 16 22:13:46 pi30 dnsmasq[2094]: Too few arguments.
Jan 16 22:13:46 pi30 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Jan 16 22:13:46 pi30 systemd[1]: Reached target Host and Network Name Lookups.
Jan 16 22:13:46 pi30 systemd[1]: Reloading.
Jan 16 22:13:47 pi30 systemd[1]: Reloading.
Jan 16 22:13:48 pi30 systemd[1]: Reloading.
Jan 16 22:13:48 pi30 env[997]: WiFi_led_status.sh, ssid: pi30
Jan 16 22:13:48 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:13:49 pi30 systemd[1]: Stopping Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Jan 16 22:13:49 pi30 systemd[1]: hostapd.service: Succeeded.
Jan 16 22:13:49 pi30 systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Jan 16 22:13:49 pi30 systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Jan 16 22:13:49 pi30 hostapd[2231]: Configuration file: /etc/hostapd/hostapd.conf
Jan 16 22:13:49 pi30 hostapd[2231]: wlan0: Could not connect to kernel driver
Jan 16 22:13:49 pi30 hostapd[2231]: Using interface wlan0 with hwaddr b8:27:eb:a5:14:93 and ssid "pi30"
Jan 16 22:13:49 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
Jan 16 22:13:49 pi30 env[997]: WiFi_led_status.sh: connection_status = -1
Jan 16 22:13:49 pi30 env[997]: WiFi_led_status.sh: No Access Point
Jan 16 22:13:49 pi30 hostapd[2231]: wlan0: interface state UNINITIALIZED->ENABLED
Jan 16 22:13:49 pi30 hostapd[2231]: wlan0: AP-ENABLED
Jan 16 22:13:49 pi30 env[997]: no Wifi Connection detected: OFF
Jan 16 22:13:49 pi30 dhcpcd[1978]: wlan0: carrier acquired
Jan 16 22:13:49 pi30 systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Jan 16 22:13:49 pi30 dhcpcd[1978]: wlan0: IAID eb:a5:14:93
Jan 16 22:13:49 pi30 dhcpcd[1978]: wlan0: adding address fe80::a348:e8e3:3081:52dc
Jan 16 22:13:49 pi30 dhcpcd[1978]: ipv6_addaddr1: Operation not supported
Jan 16 22:13:49 pi30 dhcpcd[1978]: wlan0: probing address 10.10.10.10/24
Jan 16 22:13:49 pi30 systemd[1]: Reloading.
Jan 16 22:13:50 pi30 dhcpcd[1978]: wlan0: soliciting an IPv6 router
Jan 16 22:13:50 pi30 dhcpcd[1978]: ipv6nd_startrs1: Address family not supported by protocol
Jan 16 22:13:50 pi30 systemd[1]: Stopping WPA supplicant...
Jan 16 22:13:50 pi30 systemd[1]: wpa_supplicant.service: Succeeded.
Jan 16 22:13:50 pi30 systemd[1]: Stopped WPA supplicant.
Jan 16 22:13:52 pi30 env[997]: WiFi_led_status.sh, ssid: pi30
Jan 16 22:13:52 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:13:52 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
Jan 16 22:13:52 pi30 env[997]: WiFi_led_status.sh: connection_status = -1
Jan 16 22:13:52 pi30 env[997]: WiFi_led_status.sh: WiFi Broadcasting SSID: pi30
Jan 16 22:13:53 pi30 env[997]: WARNING: Could not obtain IP address for interface wlan0. Using 0.0.0.0 for
Jan 16 22:13:53 pi30 env[997]: the source address, which is probably not what you want.
Jan 16 22:13:53 pi30 env[997]: Either configure wlan0 with an IP address, or manually specify the address
Jan 16 22:13:53 pi30 env[997]: with the --arpspa option.
Jan 16 22:13:53 pi30 kernel: [ 65.314808] device wlan0 entered promiscuous mode
Jan 16 22:13:54 pi30 dhcpcd[1978]: wlan0: using static address 10.10.10.10/24
Jan 16 22:13:54 pi30 avahi-daemon[453]: Joining mDNS multicast group on interface wlan0.IPv4 with address 10.10.10.10.
Jan 16 22:13:54 pi30 dhcpcd[1978]: wlan0: adding route to 10.10.10.0/24
Jan 16 22:13:54 pi30 avahi-daemon[453]: New relevant interface wlan0.IPv4 for mDNS.
Jan 16 22:13:54 pi30 avahi-daemon[453]: Registering new address record for 10.10.10.10 on wlan0.IPv4.
Jan 16 22:13:57 pi30 kernel: [ 69.062830] device wlan0 left promiscuous mode
<b>Jan 16 22:13:57 pi30 env[997]: WiFi_led_status.sh: turn LED GREEN
Jan 16 22:13:57 pi30 env[997]: WiFi_led_status.sh: WiFi Not connected to a device
Jan 16 22:13:59 pi30 env[997]: WiFi_led_status.sh, ssid: pi30
Jan 16 22:13:59 pi30 env[997]: wifi_led_statu.sh: ssid_check is pi30
Jan 16 22:14:00 pi30 env[997]: WiFi_led_status.sh: Detected Robot: GoPiGo3
2 Likes

I am THOROUGHLY confused - it makes no sense to me except that maybe you have a bad download or are using a low quality SD card.[1]

I, myself, have beaten that OS to a pulp in testing and I never experienced anything like that, (as I remember).

Right now, my 'bot, (Charlie), is completely disassembled because I accidentally broke the bottom plate. (Which I am experimenting with repair methods.

Have you tried a fresh re-download to a different SD card?

Can you use the backup feature and create a zipped copy of your current filesystem?

You can upload it here:

. . . and I will take a look at it on my own 'bot, though it won’t be done immediately.

Notes:

  1. The later versions of the Raspberry Pi, (version 3 and later), are extremely sensitive to the quality of the SD card being used.
     
    Bargain brand cards just won’t cut it. I recommend cards from SanDisk, Toshiba, and (believe it or not), Micro Center.
     
    Cards from Kingston, PNY, and other no-name brands are usually a problem waiting to happen.
     
    If possible, try to get “application rated” cards that are rated A1 or better.
1 Like

So in the end, the only way to stop the access point from restarting was to rename the /opt/Sam_Dev/access_point_on_off.sh script. Never could figure out what was running it, but disabling services (as recommended by documentation) wasn’t enough. Thank you to Nicole from tech support!

2 Likes