Skip to content
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

Access Point has shutdown #17

Open
crazyman143 opened this issue Jan 24, 2019 · 10 comments
Open

Access Point has shutdown #17

crazyman143 opened this issue Jan 24, 2019 · 10 comments

Comments

@crazyman143
Copy link

crazyman143 commented Jan 24, 2019

Hi here,

I am trying to run your script for my plug on an Ubuntu 18 computer. Is it compatible, or does it have to be Raspian?

The issue seems to be a problem controlling wlan0, as I'm getting the "Access point has shutdown" message immediately after it attempts to start its SSID. I used sudo and also tried running directly as root.

root@ubuntu:/home/usre/Desktop/TuyOTA-master# ./tuyota.pl -s 'xxx' -p 'xxx'
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 6270
***** Access Point has Shutdown *****
DHCP Discover 00:10:18:bb:13:f1 10.44.57.226
Shutting down...
Setting up IP Address 192.168.4.2 for Final Stages
Getting interface into stable state
RTNETLINK answers: Cannot assign requested address
Done
Setting up wifi scan
Setting up listener for FinalStage
wlan0     Interface doesn't support scanning : Device or resource busy

Shutting down...
Getting interface into stable state
RTNETLINK answers: Cannot assign requested address
Done
Finished
Exiting....
Shutting down...
@SynAckFin
Copy link
Owner

You might have something else controlling the wlan0 interface. Have a look to see if wpa_supplicant is running.

@crazyman143
Copy link
Author

crazyman143 commented Jan 25, 2019

I wasn't able to follow the part of the walkthrough about adding denyinterfaces wlan0 to the dhcpcd.conf (file doesn't exist) but I did run systemctl stop wpa_supplicant to turn it off first.

@SynAckFin
Copy link
Owner

That doesn't doesn't always stop wpa_supplicant. If you run the following:
ps -fu root | grep wpa_supplicant
and it finds any processes then wpa_supplicant is running.

@crazyman143
Copy link
Author

I checked that too but the only thing returned is, I believe, the grep process itself:

root@ubuntu:~# ps -fu root | grep wpa_supplicant
root      4953  4277  0 13:32 pts/2    00:00:00 grep --color=auto wpa_supplicant

Also, when I run the script, I checked syslog and the following is recorded:

Jan 24 13:38:06 ubuntu wpa_supplicant[4864]: wlan0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-53 noise=9999 txrate=1000
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Withdrawing address record for 10.44.57.1 on wlan0.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 10.44.57.1.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jan 25 13:38:01 ubuntu kernel: [ 4477.587467] iwlwifi 0000:02:00.0: Radio type=0x1-0x3-0x1
Jan 25 13:38:01 ubuntu kernel: [ 4477.821931] iwlwifi 0000:02:00.0: Radio type=0x1-0x3-0x1
Jan 25 13:38:01 ubuntu kernel: [ 4477.904523] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Joining mDNS multicast group on interface wlan0.IPv4 with address 10.44.57.1.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: New relevant interface wlan0.IPv4 for mDNS.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Registering new address record for 10.44.57.1 on wlan0.IPv4.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 10.44.57.1.
Jan 25 13:38:01 ubuntu kernel: [ 4477.932544] iwlwifi 0000:02:00.0: Radio type=0x1-0x3-0x1
Jan 25 13:38:01 ubuntu kernel: [ 4478.169625] iwlwifi 0000:02:00.0: Radio type=0x1-0x3-0x1
Jan 25 13:38:01 ubuntu kernel: [ 4478.252932] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Withdrawing address record for 10.44.57.1 on wlan0.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Joining mDNS multicast group on interface wlan0.IPv4 with address 10.44.57.1.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: New relevant interface wlan0.IPv4 for mDNS.
Jan 25 13:38:01 ubuntu avahi-daemon[579]: Registering new address record for 10.44.57.1 on wlan0.IPv4.

I noticed that wpa_supplicant shows up in there, so maybe it really is running still? If so, I'm not sure on how to kill it. Sorry, I'm probably just being a n00b here.

@SynAckFin
Copy link
Owner

wpa_supplicant is probably being spawned by another process. The access point will fail to start as long as this is happening.
An alternative to tuyota that may work better for you is tuya-convert try it out.

@crazyman143
Copy link
Author

Thanks for the suggestion, but I have a different set of issues with them. Also tried yours on kali linux and with a new wifi adapter, but still can't get past the same issue.

@sylvandb
Copy link

ubuntu uses networkmanager. it is probably trying to take control. You can tell networkmanager to ignore wlan0 (but I don't remember how).

I was successful on ubuntu 18.04 using a previous version of the script that worked with networkmanager, but that version wouldn't work on systems without networkmanager. Maybe we need both :)

@crazyman143
Copy link
Author

crazyman143 commented Feb 10, 2019

I ended up procuring a raspberry pi. I installed a fresh copy of Raspian, and I still am running into the same issue. I followed the walkthrough to the letter. I tried a handful of USB wifi adapters with the pi as well. I'm really not sure what else to try.

@SynAckFin
Copy link
Owner

How long after starting is it before the ***** Access Point has Shutdown ***** message appears?

Run the following command, with your device switched on, and let me know what the output is.

nc -u -l -k -p 6666 | strings

Try running the following (in the tuyota directory) and paste the output here:

hostapd hostapd.conf

@NdK73
Copy link

NdK73 commented Aug 25, 2019

I think I have the same issue.
nc shows two other devices, but not the one I'm trying to flash (Digoo NX-SP202).
Flashing one of the other two devices works.
I'd say that if nc does not report the device, flashing will fail... But the reverse is not always true: my Teckin SP22 shows up in nc, but flashing fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants