question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stuck at "Starting AP in a screen"

See original GitHub issue

Hey there,

I tried to run start_flash.sh but the script always gets stuck at Starting AP in a screen. I am running a fresh Raspbian Buster Lite on a Raspberry Pi Zero W.

Contents of smarthack-wifi.log

Attempting to stop wpa_supplicant
Configuring AP interface...
RTNETLINK answers: File exists
Starting DNSMASQ server...
Starting AP on wlan0...
Configuration file: hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:d5:5a:06 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: AP-STA-CONNECTED c0:ee:fb:d2:23:77
wlan0: AP-STA-DISCONNECTED c0:ee:fb:d2:23:77
wlan0: AP-STA-CONNECTED c0:ee:fb:d2:23:77
Attempting to stop wpa_supplicant
Configuring AP interface...
RTNETLINK answers: File exists
Starting DNSMASQ server...
Starting AP on wlan0...
Configuration file: hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:d5:5a:06 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: AP-STA-CONNECTED c0:ee:fb:d2:23:77
Attempting to stop wpa_supplicant
Configuring AP interface...
RTNETLINK answers: File exists
Starting DNSMASQ server...
Starting AP on wlan0...
Configuration file: hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:d5:5a:06 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
Attempting to stop wpa_supplicant
Configuring AP interface...
RTNETLINK answers: File exists
Starting DNSMASQ server...
Starting AP on wlan0...
Configuration file: hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:d5:5a:06 and ssid "vtrust-flash"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

Log of ./start_flash.sh

Checking for network interface wlan0... Found.
Checking UDP port 53... Occupied by dnsmasq with PID 477.
Port 53 is needed to resolve DNS queries
Do you wish to terminate dnsmasq? [y/N] Y
Attempting to stop dnsmasq.service
Checking UDP port 67... Available.
Checking TCP port 80... Available.
Checking TCP port 443... Available.
Checking UDP port 6666... Available.
Checking UDP port 6667... Available.
Checking TCP port 1883... Occupied by mosquitto with PID 462.
Port 1883 is needed to run MQTT
Do you wish to terminate mosquitto? [y/N] y
Attempting to stop mosquitto.service
Checking TCP port 8886... Available.
======================================================
  Starting AP in a screen....

Log of bash -x start_flash.sh

Show ++ tput bold + bold='' ++ tput sgr0 + normal='' ++ cut -d . -f 2 ++ screen --version + screen_minor=06 + '[' 06 -gt 5 ']' + screen_with_log='sudo screen -L -Logfile' + . ./config.txt ++ WLAN=wlan0 ++ AP=vtrust-flash ++ GATEWAY=10.42.42.1 + ./stop_flash.sh + pushd scripts + . ./setup_checks.sh ++ . ../config.txt +++ WLAN=wlan0 +++ AP=vtrust-flash +++ GATEWAY=10.42.42.1 ++ check_eula ++ '[' '!' -f eula_accepted ']' ++ check_config ++ iw list ++ grep -q '* AP' ++ echo -n 'Checking for network interface wlan0... ' Checking for network interface wlan0... ++ '[' -e /sys/class/net/wlan0 ']' ++ echo Found. Found. ++ check_port udp 53 'resolve DNS queries' ++ protocol=udp ++ port=53 ++ reason='resolve DNS queries' ++ echo -n 'Checking UDP port 53... ' Checking UDP port 53... +++ sudo ss -Hlnp -A udp 'sport = :53' +++ head -n1 +++ grep -Po '(?<=pid=)(\d+)' ++ process_pid=477 ++ '[' -n 477 ']' +++ ps -p 477 -o comm= ++ process_name=dnsmasq ++ echo 'Occupied by dnsmasq with PID 477.' Occupied by dnsmasq with PID 477. ++ echo 'Port 53 is needed to resolve DNS queries' Port 53 is needed to resolve DNS queries ++ read -p 'Do you wish to terminate dnsmasq? [y/N] ' -n 1 -r Do you wish to terminate dnsmasq? [y/N] y++ echo

++ [[ ! y =~ ^[Yy]$ ]] +++ ps -p 477 -o unit= +++ grep .service +++ grep -Ev ‘^user’ ++ service=dnsmasq.service ++ ‘[’ -n dnsmasq.service ‘]’ ++ echo ‘Attempting to stop dnsmasq.service’ Attempting to stop dnsmasq.service ++ sudo systemctl stop dnsmasq.service ++ sleep 1 ++ check_port udp 67 ‘offer DHCP leases’ ++ protocol=udp ++ port=67 ++ reason=‘offer DHCP leases’ ++ echo -n 'Checking UDP port 67… ’ Checking UDP port 67… +++ sudo ss -Hlnp -A udp ‘sport = :67’ +++ grep -Po ‘(?<=pid=)(\d+)’ +++ head -n1 ++ process_pid= ++ ‘[’ -n ‘’ ‘]’ ++ echo Available. Available. ++ check_port tcp 80 ‘answer HTTP requests’ ++ protocol=tcp ++ port=80 ++ reason=‘answer HTTP requests’ ++ echo -n 'Checking TCP port 80… ’ Checking TCP port 80… +++ grep -Po ‘(?<=pid=)(\d+)’ +++ head -n1 +++ sudo ss -Hlnp -A tcp ‘sport = :80’ ++ process_pid= ++ ‘[’ -n ‘’ ‘]’ ++ echo Available. Available. ++ check_port tcp 443 ‘answer HTTPS requests’ ++ protocol=tcp ++ port=443 ++ reason=‘answer HTTPS requests’ ++ echo -n 'Checking TCP port 443… ’ Checking TCP port 443… +++ sudo ss -Hlnp -A tcp ‘sport = :443’ +++ head -n1 +++ grep -Po ‘(?<=pid=)(\d+)’ ++ process_pid= ++ ‘[’ -n ‘’ ‘]’ ++ echo Available. Available. ++ check_port udp 6666 ‘detect unencrypted Tuya firmware’ ++ protocol=udp ++ port=6666 ++ reason=‘detect unencrypted Tuya firmware’ ++ echo -n 'Checking UDP port 6666… ’ Checking UDP port 6666… +++ head -n1 +++ sudo ss -Hlnp -A udp ‘sport = :6666’ +++ grep -Po ‘(?<=pid=)(\d+)’ ++ process_pid= ++ ‘[’ -n ‘’ ‘]’ ++ echo Available. Available. ++ check_port udp 6667 ‘detect encrypted Tuya firmware’ ++ protocol=udp ++ port=6667 ++ reason=‘detect encrypted Tuya firmware’ ++ echo -n 'Checking UDP port 6667… ’ Checking UDP port 6667… +++ grep -Po ‘(?<=pid=)(\d+)’ +++ sudo ss -Hlnp -A udp ‘sport = :6667’ +++ head -n1 ++ process_pid= ++ ‘[’ -n ‘’ ‘]’ ++ echo Available. Available. ++ check_port tcp 1883 ‘run MQTT’ ++ protocol=tcp ++ port=1883 ++ reason=‘run MQTT’ ++ echo -n 'Checking TCP port 1883… ’ Checking TCP port 1883… +++ sudo ss -Hlnp -A tcp ‘sport = :1883’ +++ grep -Po ‘(?<=pid=)(\d+)’ +++ head -n1 ++ process_pid=462 ++ ‘[’ -n 462 ‘]’ +++ ps -p 462 -o comm= ++ process_name=mosquitto ++ echo ‘Occupied by mosquitto with PID 462.’ Occupied by mosquitto with PID 462. ++ echo ‘Port 1883 is needed to run MQTT’ Port 1883 is needed to run MQTT ++ read -p 'Do you wish to terminate mosquitto? [y/N] ’ -n 1 -r Do you wish to terminate mosquitto? [y/N] y++ echo

++ [[ ! y =~ ^[Yy]$ ]] +++ ps -p 462 -o unit= +++ grep -Ev ‘^user’ +++ grep .service ++ service=mosquitto.service ++ ‘[’ -n mosquitto.service ‘]’ ++ echo ‘Attempting to stop mosquitto.service’ Attempting to stop mosquitto.service ++ sudo systemctl stop mosquitto.service ++ sleep 1 ++ check_port tcp 8886 ‘run MQTTS’ ++ protocol=tcp ++ port=8886 ++ reason=‘run MQTTS’ ++ echo -n 'Checking TCP port 8886… ’ Checking TCP port 8886… +++ sudo ss -Hlnp -A tcp ‘sport = :8886’ +++ grep -Po ‘(?<=pid=)(\d+)’ +++ head -n1 ++ process_pid= ++ ‘[’ -n ‘’ ‘]’ ++ echo Available. Available.

  • echo ====================================================== ======================================================
  • echo -n ’ Starting AP in a screen’ Starting AP in a screen+ sudo screen -L -Logfile smarthack-wifi.log -S smarthack-wifi -m -d ./setup_ap.sh
  • ping -c 1 -W 1 -n 10.42.42.1
  • printf . .+ ping -c 1 -W 1 -n 10.42.42.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
chrizbeecommented, Nov 20, 2019

I am now officially the stupidest person alive. Of all my messing around I’ve forgot that I’m connected to the Pi with SSH… No wonder it’s losing its connection… Sorry for wasting your time.

But wlan0: Could not connect to kernel driver might be a bug with hostapd.

0reactions
gimmelcommented, Jul 19, 2022

I am now officially the stupidest person alive. Of all my messing around I’ve forgot that I’m connected to the Pi with SSH… No wonder it’s losing its connection… Sorry for wasting your time.

That’s exactly what happened to me. I do everything on Raspberries via SSH. Had to buy a keyboard for flashing. Thank you for pointing this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix The Stuck On Loading Screen Error In Apex…
So you're staring at the Apex Legends loading screen, and it doesn't seem to be loading at all? Here's how to fix it....
Read more >
XCode 14.1: Stuck at "Launching Ap…
Hello team, On Xcode 14.1, After building the project and when the simulator launches, it shows blank black screen. Here steps to reproduce:....
Read more >
Tuya Convert Ap Issue : r/homeautomation
Hello, I am trying to flash a Genio bulb from Kmart via ota with esp home. I have followed this tutorial but when...
Read more >
Tuya convert OTA error: screen: command not found
... to start up the AP but i dont see the " vtrust-flash" access point command “./start_flash.sh” error shows “screen: command not found”...
Read more >
Windows 10 forces me to set up a pin, then gets stuck on ...
Go to Troubleshoot. - Choose System Restore. - Choose your last restore point, and follow further on-screen instructions. - Finish the setup.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found