wifi-connect
wifi-connect copied to clipboard
Error: Cannot start HTTP server on '192.168.42.1:80': address in use
I am running WiFi-Connect 4.3.1 on a Beaglebone Black Wireless (arm7l) using the latest Buster image for Beaglebone (kernel 4.19.94-ti-r42).
I installed Wifi-Connect and am trying to start it up.
Error:
root@beaglebone:/home/debian# wifi-connect
WiFi device: wlan0
Access points: ["GHHA 2.4", "DTH018.F2262H-2.4G", "GHHA-EXT"]
Starting access point...
Access point 'WiFi Connect' created
Starting HTTP server on 192.168.42.1:80
Error: Cannot start HTTP server on '192.168.42.1:80': address in use
root@beaglebone:/home/debian#
dnsmasq: failed to bind DHCP server socket: Address already in use
Note that despite this error, my laptop is able to find the WiFi network that's been created - it just cannot connect successfully.
What I've tried:
-
connmanctl disable wifi
ANDsystemctl disable dnsmasq
-> changes error to 'Creating the captive portal failed'. -
connmanctl disable wifi
-> 'Creating the captive portal failed'. -
systemctl disable dnsmasq
-> original error. - Change port from 80 to 81 -> original error.
- Change IP to various numbers inside and outside the 192.168.42.* range -> original error.
- Disable device's tether -> tether already disabled.
- Disable Cloud9 IDE and bonescript -> original error.
- Scan local IP addresses using nmap:
nmap -sP 192.168.42.*
-> 256 IP addresses (0 hosts up) scanned... - Change port:
wifi-connect -o 8001
-> Starting HTTP server! BUTdnsmasq: failed to bind DHCP server socket: Address already in use
.
I cannot seem to find the right way to get the thing to start! I'd greatly appreciate any help.
What's running:
netstat -tupln
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1022/nginx: master
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1022/nginx: master
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1888/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 934/sshd
tcp6 0 0 :::8080 :::* LISTEN 1022/nginx: master
tcp6 0 0 :::80 :::* LISTEN 1022/nginx: master
tcp6 0 0 :::53 :::* LISTEN 1888/dnsmasq
tcp6 0 0 :::22 :::* LISTEN 934/sshd
tcp6 0 0 :::3000 :::* LISTEN 1/init
tcp6 0 0 :::1880 :::* LISTEN 1/init
udp 0 0 0.0.0.0:5353 0.0.0.0:* 810/avahi-daemon: r
udp 0 0 0.0.0.0:36616 0.0.0.0:* 810/avahi-daemon: r
udp 0 0 0.0.0.0:53 0.0.0.0:* 1888/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 1888/dnsmasq
udp6 0 0 :::34535 :::* 810/avahi-daemon: r
udp6 0 0 :::5353 :::* 810/avahi-daemon: r
udp6 0 0 :::53 :::* 1888/dnsmasq
Can you please try running it with sudo
?
@majorz I ran it again with sudo, but I get the same result as with #9, i.e. that the HTTP server is started, but dnsmasq 'failed to bind DHCP server socket: Address already in use'.
I've added the results of netstat -tupln
above in case it's helpful.
Let's see whether stopping the other dnsmasq instance that shows in the netstat output will solve this: sudo systemctl stop dnsmasq
. And then double check that it is no longer running with netstat again.
BTW, you can use multi-line formatting with triple quotes "```":
Line 1
Line 2
Ah, I see you figured the block quoting.
@majorz I just ran:
root@beaglebone:/home/debian# sudo systemctl stop dnsmasq
root@beaglebone:/home/debian# sudo wifi-connect
Deleting already created by WiFi Connect access point connection profile: "WiFi Connect"
WiFi device: wlan0
Access points: [...]
Starting access point...
Access point 'WiFi Connect' created
Starting HTTP server on 192.168.42.1:80
Error: Cannot start HTTP server on '192.168.42.1:80': address in use
It seems that this time it can't start the HTTP server. Before, it was starting the HTTP server but failing at the next step.
@majorz
I then tried running the same thing but changing the port:
root@beaglebone:/home/debian# sudo wifi-connect -o 8001
Deleting already created by WiFi Connect access point connection profile: "WiFi Connect"
WiFi device: wlan0
Access points: [...]
Starting access point...
Access point 'WiFi Connect' created
Starting HTTP server on 192.168.42.1:8001
dnsmasq: failed to create listening socket for 192.168.42.1: Address already in use
OK something new happened: my PC now detects the network 'Wifi Connect' and I was able to connect to it for the first time and bring up the network selection page. This hasn't happened before - last night, it was trying and trying but wouldn't connect.
I'm still getting this 'failed to create listening socket' and I don't know what the implications of that are.
same issue here. Any solutions yet?
same issue here. Any solutions yet?
@kennyparsons afraid not... the system seems to work but it isn't stable and I'm still getting error messages.
I found a solution at #232 :
sudo apt install dnsmasq
sudo systemctl stop dnsmasq
sudo ./wifi-connect
it's work on Armbian_21.08.1_Orangepizero_buster_current_5.10.60.img.xz.
Access point 'WiFi Connect' created Starting HTTP server on 192.168.42.1:8001
dnsmasq: failed to create listening socket for 192.168.42.1: Address already in use
For me it started working after a reboot.
I found a solution at #232 :
sudo apt install dnsmasq sudo systemctl stop dnsmasq sudo ./wifi-connect
it's work on Armbian_21.08.1_Orangepizero_buster_current_5.10.60.img.xz.
For anyone encountering this error in 2023, this solution worked for me. You have to install the dnsmasq package, yet have it disabled.
You can disable it from starting on boot with "systemctl disable dnsmasq"