Help with setting up Wifi Connect

Hopefully this is an ok place for this…

I installed Wifi Connect on my raspberry pi Zero W using the instructions found on the github page. After following the installation instructions, when I run wifi connect with “sudo wifi-connect” and access point is successfully created but I get an error:

Error: Cannot start HTTP server on ‘192.168.42.1:80’: address in use
dnsmasq: failed to create listening socket for 192.168.42.1: Address already in use.

Not sure if I did/didn’t do something that I should have? Any help is greatly appreciated!
wifiConnect github: https://github.com/balena-io/wifi-connect

Hi @swagasaurus_rex, and welcome to the balenaCloud forum!

Can you describe a little more about what you are running wifi-connect on? Is this a balenaOS device, or Raspbian/Debian/some other linux flavor? Are you running other containers locally?

Hi! thank you so much for the response. I am running wifi-connect on a raspberry pi zero W with the raspbian OS with no other additional conatiners or anything to my knowledge. My project is a python datalogger that receives data via RF and stores it in a database. I am not running any of this project while trying to get wifi-connect to work. To install wifi-connect I ran the following command

bash <(curl -L https://github.com/balena-io/wifi-connect/raw/master/scripts/raspbian-install.sh)

and followed the onscreen instructions from there.

Hey, that error is coming from something else on your raspbian os listening on port 80, you can probably run netstat -l to list the ports that processes are listening on and then you’ll need to stop whichever process is using port 80 - probably either apache or nginx that you’ve installed on raspbian

ahhh yes, that would make sense. Thank you! do you know if it is possible to run wifi-connect on a port other than 80? and would I need to change anything on my smartphone end?

Hey,

It looks like it is, but I am not an expert on the code: https://github.com/balena-io/wifi-connect/blob/4be6dd3297195f1e7145fb50bc6e064fb40845ee/src/config.rs#L82

It’s a command line arg, to the main wifi connect binary.

Thanks for all of the help so far. I have tried changing the port number which got rid of the error message that I was getting. However, I still get the message “dnsmasq: failed to create listening socket for ~whatever ip i put in~: Address already in use”

The default is 192.168.42.1
I have tried: 192.168.2.20, 192.168.1.11, 1.1.1.1, 192.168.0.0 and a few others and everything gives me the same message. Any ideas?

Hi, what is the precise Raspbian version you are using? I tried out both latest Stretch and Buster releases and everything is working correctly.

Can you please paste also the output of nmcli --version here.

Thanks,
Zahari

Hi Zahari!

The output of the nmcli --version command is:

nmcli tool, version 1.6.2

I am working on this project for a professor and I am not sure if updating the version will compromise any of the software already on the pi.

Thanks,
Jake

Hi Jake,

nmcli at 1.6.2 means that you are running Raspbian Stretch, so this should be fine.

Can you try the following - install wifi-connect first on a freshly flashed Raspbian? Try out how it is working for you. And afterwards install the additional software you are using and try again. It looks like the OS on the device is not working as expected, so this is why I suggest installing things from scratch.

Thanks,
Zahari

I get the same error. After a few hours, I do not see a solution.

(.venv) pi@picroft:~ $ sudo wifi-connect
Deleting already created by WiFi Connect access point connection profile: “WiFi Connect”
WiFi device: wlan0
Access points: [“QBPDC”]
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

dnsmasq: failed to create listening socket for 192.168.42.1: Address already in use