Hello everyone,
I’m trying to run the rtl8188eus in AP mode.
I was able to run the hostapd and I already see the AP, but when I’m trying to connect with the phone I’m hanging in IP obtaining.
I’ve found that the IP was not assigned for the phone.
service dnsmasq status
returns
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2023-02-07 15:05:15 UTC; 4min 55s ago
Process: 542 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
Process: 553 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
Process: 593 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
Process: 658 ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf (code=exited, status=0/SUCCESS)
Main PID: 589 (code=exited, status=0/SUCCESS)
Feb 07 15:05:12 XXXXXXX dnsmasq-dhcp[589]: DHCP, IP range 192.168.40.2 -- 19
Feb 07 15:05:12 XXXXXXX dnsmasq[589]: reading /etc/resolv.conf
Feb 07 15:05:12 XXXXXXX dnsmasq[589]: using nameserver 8.8.8.8#53
Feb 07 15:05:12 XXXXXXX dnsmasq[589]: using nameserver 8.8.4.4#53
Feb 07 15:05:12 XXXXXXX dnsmasq[589]: read /etc/hosts - 5 addresses
Feb 07 15:05:13 XXXXXXX systemd[1]: Started dnsmasq - A lightweight DHCP and
Feb 07 15:05:15 XXXXXXX systemd[1]: Stopping dnsmasq - A lightweight DHCP an
Feb 07 15:05:15 XXXXXXX dnsmasq[589]: exiting on receipt of SIGTERM
Feb 07 15:05:15 XXXXXXX systemd[1]: dnsmasq.service: Succeeded.
Feb 07 15:05:15 XXXXXXX systemd[1]: Stopped dnsmasq - A lightweight DHCP and
If I start or restart the service manually, the dnsmasq works fine and I can connect with a phone.
How can I start the service automatically after reboot?
I use
4.19.173-bone-rt-r60
dnsmasq v 2.8
Thank you in advance
Regards,
Anton
the service is probably not enabled, try
systemctl enable dnsmasq.service
Thank you for reply.
The service is unmasked and enabled
cadmin@XXXXXXX:~$ systemctl list-unit-files | grep enabled
autovt@.service enabled
avahi-daemon.service enabled
bb-symlinks.service enabled
bluetooth.service enabled
console-setup.service enabled
cron.service enabled
dbus-fi.w1.wpa_supplicant1.service enabled
dbus-org.bluez.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.timesync1.service enabled
dnsmasq.service enabled
UPD:
I also tried to modify the dnsmasq.conf. Inside I left only
interface=wlan0
dhcp-range=wlan0,192.168.40.2,192.168.40.10,4h
But makes no difference. The dnsmasq does not starts automatically.
Regards,
Atnon
OK in that case is dnsmasq starting before the interface is available and then exiting because there is nothing for it to do ?
Probably need to check further back in the logs to see what is causing dnsmasq to fail
But obviously restarting/starting manually the interface is then available so everything works.
Could you suggest how can I do it?
I would really appreciate your advice.
I assume you have a serial console, or can ssh into the device.
Starting from a fresh boot, without manually restarting or starting dnsmasq
at the console if you type
journalctl -u dnsmasq
You should get a list of all relevant messages for dnsmasq.
Lets see what that has to say.
Now I got your point 
Here is the output (I don’t know why PuTTY does not able to copy whole line, only part) :
Feb 07 15:05:10 mum-XXXXXXX systemd[1]: Starting dnsmasq - A lightweight DHCP an
Feb 07 15:05:11 mum-XXXXXXX dnsmasq[544]: dnsmasq: syntax check OK.
Feb 07 15:05:12 mum-XXXXXXX dnsmasq[593]: started, version 2.80 cachesize 150
Feb 07 15:05:12 mum-XXXXXXX dnsmasq[593]: compile time options: IPv6 GNU-getopt
Feb 07 15:05:12 mum-XXXXXXX dnsmasq-dhcp[593]: DHCP, IP range 192.168.40.2 -- 19
Feb 07 15:05:12 mum-XXXXXXX dnsmasq[593]: reading /etc/resolv.conf
Feb 07 15:05:12 mum-XXXXXXX dnsmasq[593]: using nameserver 8.8.8.8#53
Feb 07 15:05:12 mum-XXXXXXX dnsmasq[593]: using nameserver 8.8.4.4#53
Feb 07 15:05:12 mum-XXXXXXX dnsmasq[593]: read /etc/hosts - 5 addresses
Feb 07 15:05:13 mum-XXXXXXX systemd[1]: Started dnsmasq - A lightweight DHCP and
Feb 07 15:05:15 mum-XXXXXXX systemd[1]: Stopping dnsmasq - A lightweight DHCP an
Feb 07 15:05:15 mum-XXXXXXX dnsmasq[593]: exiting on receipt of SIGTERM
Feb 07 15:05:15 mum-XXXXXXX systemd[1]: dnsmasq.service: Succeeded.
Feb 07 15:05:15 mum-XXXXXXX systemd[1]: Stopped dnsmasq - A lightweight DHCP and
It looks like the service was stopped by who has stopped it
UPD:
Before playing with dnsmasq I’ve removed connmam. Both of them used the same socket port (53)
That is strange. It certainly looks like dnsmasq had no issues starting at all.
What version OS are you running, my guess is pretty old if you have connman?
I’m using Debian 10.13. But I have to stay on this version, otherwise it will a lot more work 
Connman I removed already due to conflict with dnsmasq
There’s a chance it’s a race condition… dnsmasq fires, but wlan0 is not up yet, still loading kernel modules…
https://www.reddit.com/r/debian/comments/typsco/systemctl_starting_dnsmasq_too_soon_before_all/
Regards,
Thank you very much for reply,
I also thought that there is something wrong with the timing.
But that means that if I remove WiFi dongle from the board and try to restart the dnsmasq, it should be also failed correct?
But in my case without dongle after manual reset the dnsmasq works just fine,
Is there any way how can I point, that dnsmasq hast to be started after hostapd?
I think there is a race conditions between hostapd and dnsmasq
dnsmasq can be running before hostapd, back in Debian Buster days, we did it like this:
Sorry that script is a little messy, but it worked…
Today Debian Bookworm’s version of systemd added new triggers (and using systemd-networkd) so we could drop all the extra stuff and just do:
So we went from Debian Buster, with a bunch of scripts to trigger hostapd, dnsmasq, SoftAp0, etc…
To Debian Bullseye, where everything is event driven thru udev and systemd.
Regards,
I tried different combinations:
wlan0 is presented and start dnsmasq manually - works
wlan0 and hostapd are not running and restarting dnsmasq manually - also works.
It looks like during startup someone switches the dnsmasq off
Starting Advanced IEEE 802…/WPA/WPA2/EAP Authenticator...
Starting Advanced key-value store...
[ OK ] Started Permit User Sessions.
[ OK ] Started Serial Getty on ttyS0.
[ OK ] Started Getty on tty1.
[ OK ] Started Advanced key-value store.
[ OK ] Started OpenBSD Secure Shell server.
[ OK ] Started dnsmasq - A lightw…t DHCP and caching DNS server.
[ OK ] Reached target Host and Network Name Lookups.
Starting A high performanc… and a reverse proxy server...
[ OK ] Started A high performance…er and a reverse proxy server.
[ OK ] Found device /dev/ttyGS0.
Stopping dnsmasq - A light…DHCP and caching DNS server...
[ OK ] Started Serial Getty on ttyGS0.
[ OK ] Reached target Login Prompts.
[ OK ] Started Advanced IEEE 802.…1X/WPA/WPA2/EAP Authenticator.
[ OK ] Stopped dnsmasq - A lightw…t DHCP and caching DNS server.
Regards,