-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create DHCP Listener socket! #20
Comments
It looks like your pi is running a DHCP server. You need to stop the DHCP server before running the script. |
I killed DHCP - no luck I'm afraid :( The IP is actually assigned to my WLAN0 interface. root@raspberrypi:/home/pi/TuyOTA# ps -ef | grep dhcp
root 497 1 0 21:00 ? 00:00:00 /sbin/dhcpcd -q -b
root 1954 1823 0 21:05 pts/0 00:00:00 grep dhcp
root@raspberrypi:/home/pi/TuyOTA# kill 497
root@raspberrypi:/home/pi/TuyOTA# ./tuyota.pl
Getting interface into stable state
RTNETLINK answers: Cannot assign requested address
Done
Using WiFi device wlan0 for Access Point
Starting Access Point with SSID ZAGDU-789
Giving Access Point IP address 10.44.57.1, pid is 1970
Unable to create DHCP Listener socket! Address already in use at ./tuyota.pl line 188.
Exiting....
Shutting down...
root@raspberrypi:/home/pi/TuyOTA# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet 192.168.1.41/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::8dd6:f30a:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:XX:XX:XX brd ff:ff:ff:ff:ff:ff
inet 192.168.1.143/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
inet 10.44.57.1/24 scope global wlan0
valid_lft forever preferred_lft forever
root@raspberrypi:/home/pi/TuyOTA# |
dhcpcd is the client daemon not the server. You have something listening on port 67. |
It looks like I've got the same issue, though I can't see anything else controlling wlan0.
Did anyone manage to work out what's going on? |
Have you tried running: |
Yes, there was nothing output from the command, it's in the code pasted above |
The lsof command should be run as root (sudo). The error "Address already in use" usually means there is something else bound to the port and lsof should find the process. |
I never got to the bottom of the issue, but I did manage to get the devices flashed using the Tuya-convert script. When I get a bit more time, I'll try to have another look at why I couldn't get this script working. Thanks for all your help |
Ok, I ran the lsof command as root and it looks like dnsmasq is on port 67. So that at least indicates why the script was failing |
Device is a Teckin SP22. I ran the script via SSH. Session hung, so I ran it again locally and receive the following error.
The 192.168.1.12 address is the address of the plug, and can be pinged.
pi@raspberrypi:~/TuyOTA $ sudo ./tuyota.pl -ip 192.168.1.12 -s my_ssid -p my_ssid_password
Getting interface into stable state
RTNETLINK answers: Cannot assign requested address
Done
Using WiFi device wlan0 for Access Point
Starting Access Point with SSID ZAGDU-789
Giving Access Point IP address 10.44.57.1, pid is 1395
Unable to create DHCP Listener socket! Address already in use at ./tuyota.pl line 188.
Exiting....
Shutting down...
Any advice how to get further?
Happy to provide any further details, thanks!
The text was updated successfully, but these errors were encountered: