Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Pi Zero W - Access Point not working
#1
The only way I can use my pi when I'm out of the house is to:
1) create a hotspot on my phone with the same SSID as my home network
2) boot my pi
3) connect another device to my hotspot, run fing and look for the ip address of the pi
4) connect to the pi using that ip address.

It's a bit of a faff.  And if the hotspot drops it always gives the pi a different ip address.  Using an access point would in some ways be better (ie I could lose the need for another device).  But I've booted the pi and left it for 5 minutes, a couple of different times, and it never produces an access point.   There's not much configuration for the access point and what I do have looks sensible.  How can I diagnose/fix this?

It's a fully up to date Pi; I'm in the uk (channel 6 selected), it works perfectly in all other ways.
Reply
#2
Your moOde player should drop into AP mode if it can't connect to ethernet or any pre-configured wireless network (I believe).
Post your sensible looking config Smile
----------------
Robert
Reply
#3
(03-16-2024, 09:57 AM)the_bertrum Wrote: Your moOde player should drop into AP mode if it can't connect to ethernet or any pre-configured wireless network (I believe).
Post your sensible looking config Smile


There is practically no config to speak of!  (Unless there's something vital hidden away on a different page).

Router mode: Off 
Network (SSID):  Moode
Channel: 6
Password:  irrelevant - I can't see the network

I have to be careful when playing around because this pi is encased in lego and it's a faff to get to; also, it's using a 200gb sd card; copying all the music over on the Pi's famous crap wifi takes forever (and the Zero W doesn't have ethernet).  So testing any changes requires me to literally leave the house and wander around outside (well, that or displease my family by turning off the wifi!).

Maybe the Access Point is fine and my phone just can't see it.  It's a Pixel 6a.  I *think* I also tried to find it on my Amazon Fire Max 11 tablet.
Reply
#4
You should prolly get a USB to Ethernet adapter for the Zero.
https://www.amazon.com/gp/product/B00RM3...UTF8&psc=1

It's pretty much the only way to troubleshoot AP mode issues. You would plug in the Ethernet cable after the Pi booted and AP mode seemingly failed to start after a few minutes. Then you should be able to SSH in or bring up the WebUI and copy/paste or download the startup log to see whats going on.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(03-16-2024, 05:58 PM)Tim Curtis Wrote: You should prolly get a USB to Ethernet adapter for the Zero.
https://www.amazon.com/gp/product/B00RM3...UTF8&psc=1

It's pretty much the only way to troubleshoot AP mode issues. You would plug in the Ethernet cable after the Pi booted and AP mode seemingly failed to start after a few minutes. Then you should be able to SSH in or bring up the WebUI and copy/paste or download the startup log to see whats going on.

Hmm.   It's a pretty vanilla install. What are the possibilities?  My hardware is broken; there's a bug in MoOde's Access Point code; my phone can't see MoOde Access Points...

Maybe there's something in the logs.   It looks like moode.log might be the place to look but it's already got nothing for yesterday morning when I last had the problem.  I've enabled debug logging and I'll try again tomorrow when I'm next away from my network.
Reply
#6
@Sehnsucht

Maybe it's the result shown in my test case 3) which is tripping you up.

Test 1)

I just loaded moOde 8.3.9 (configured with hostname "zerotest") to a uSD card, stuck it in a Pi Zero W, and booted. Opened the WiFi settings on my Google Pixel 6a phone.

After about 2-1/2 minutes "zerotest" appeared in the Pixel's list of available WiFi access points. Connected the Pixel to it (and, when alerted that this connection had no Internet access, told it to stay connected).

Opened the Chrome browser on the Pixel and gave it the mDNS URL "zerotest.local". Chrome opened the moOde WebUI, fresh as paint.

Test 2) 

Configured the moOde player for a WiFi connection to a non-existent WiFi access point (this to approximate the situation of your player being configured for your home network but started up away from the house). Rebooted. After a rather longer time lapse than before (sorry, I didn't time it), "zerotest" again appeared in my Pixel's list of available WiFi access points. 

I can proceed to connect and open the moOde WebUI to "zerotest.local" as before.

Test 3)

Configured the moOde player for a connection to my Pixel as access point. Rebooted it. Also, disconnected my Pixel from my home WiFi network so it was connected solely to the cellular data network. After about 2+ minutes, the moOde player is connected to my Pixel. This time, however, I am unable to access the moOde WebUI by the mDNS URL "zerotest.local". Why? Because of the way Android treats address space. The phone's IP address (10.115.x.x) and the moOde player's IP address (192.168.x.x) are in different networks, and mDNS does not cross network boundaries.

Just as you did, I can use yet another device to connect to my phone and locate the IP address of the moOde player. This address works fine in the Chrome browser on the Pixel because Android does route IP.

Trying to find the connected moOde player using the Android app "fing" fails because Android fing doesn't think the phone is connected to a WiFi network.

I don't know offhand why Android has assigned the phone an IP address in the 10.115.x.x range when it's running on the cellular data network. Both 10.x.x.x and 192.1668.x.x are in the IETF/IANA reserved IP address blocks for "local communications within a private network".

Regards,
Kent
Reply
#7
(03-16-2024, 06:54 PM)Sehnsucht Wrote:
(03-16-2024, 05:58 PM)Tim Curtis Wrote: You should prolly get a USB to Ethernet adapter for the Zero.
https://www.amazon.com/gp/product/B00RM3...UTF8&psc=1

It's pretty much the only way to troubleshoot AP mode issues. You would plug in the Ethernet cable after the Pi booted and AP mode seemingly failed to start after a few minutes. Then you should be able to SSH in or bring up the WebUI and copy/paste or download the startup log to see whats going on.

Hmm.   It's a pretty vanilla install. What are the possibilities?  My hardware is broken; there's a bug in MoOde's Access Point code; my phone can't see MoOde Access Points...

Maybe there's something in the logs.   It looks like moode.log might be the place to look but it's already got nothing for yesterday morning when I last had the problem.  I've enabled debug logging and I'll try again tomorrow when I'm next away from my network.

The startup log is generated afresh during boot, it's not cumulative. Turning debug logging on won't help with this kind of problem.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#8
(03-16-2024, 08:21 PM)TheOldPresbyope Wrote: @Sehnsucht

Maybe it's the result shown in my test case 3) which is tripping you up.

Test 1)

I just loaded moOde 8.3.9 (configured with hostname "zerotest") to a uSD card, stuck it in a Pi Zero W, and booted. Opened the WiFi settings on my Google Pixel 6a phone.

After about 2-1/2 minutes "zerotest" appeared in the Pixel's list of available WiFi access points. Connected the Pixel to it (and, when alerted that this connection had no Internet access, told it to stay connected).

Opened the Chrome browser on the Pixel and gave it the mDNS URL "zerotest.local". Chrome opened the moOde WebUI, fresh as paint.

Test 2) 

Configured the moOde player for a WiFi connection to a non-existent WiFi access point (this to approximate the situation of your player being configured for your home network but started up away from the house). Rebooted. After a rather longer time lapse than before (sorry, I didn't time it), "zerotest" again appeared in my Pixel's list of available WiFi access points. 

I can proceed to connect and open the moOde WebUI to "zerotest.local" as before.

Test 3)

Configured the moOde player for a connection to my Pixel as access point. Rebooted it. Also, disconnected my Pixel from my home WiFi network so it was connected solely to the cellular data network. After about 2+ minutes, the moOde player is connected to my Pixel. This time, however, I am unable to access the moOde WebUI by the mDNS URL "zerotest.local". Why? Because of the way Android treats address space. The phone's IP address (10.115.x.x) and the moOde player's IP address (192.168.x.x) are in different networks, and mDNS does not cross network boundaries.

Just as you did, I can use yet another device to connect to my phone and locate the IP address of the moOde player. This address works fine in the Chrome browser on the Pixel because Android does route IP.

Trying to find the connected moOde player using the Android app "fing" fails because Android fing doesn't think the phone is connected to a WiFi network.

I don't know offhand why Android has assigned the phone an IP address in the 10.115.x.x range when it's running on the cellular data network. Both 10.x.x.x and 192.1668.x.x are in the IETF/IANA reserved IP address blocks for "local communications within a private network".

Regards,
Kent
Thanks for the detailed response. I'll read it again carefully. A few things immediately though: I believe it's the mobile company giving you the 10.x.x.x ip address. I've seen this for years. I think they just don't want to give you a public ip address. I've heard it suggested that it might even be that all home internet access might end up like this one day. It would stop you from running public facing servers, make it easier to contain piracy, tor usage etc.  And secondly, in none of your scenarios do you have any problem connecting to the pi's access point. I just can't see it at all.  At least you've confirmed Pixel 6As are able to see Pi Access Points.
Reply
#9
(03-16-2024, 09:56 PM)Tim Curtis Wrote:
(03-16-2024, 06:54 PM)Sehnsucht Wrote:
(03-16-2024, 05:58 PM)Tim Curtis Wrote: You should prolly get a USB to Ethernet adapter for the Zero.
https://www.amazon.com/gp/product/B00RM3...UTF8&psc=1

It's pretty much the only way to troubleshoot AP mode issues. You would plug in the Ethernet cable after the Pi booted and AP mode seemingly failed to start after a few minutes. Then you should be able to SSH in or bring up the WebUI and copy/paste or download the startup log to see whats going on.

Hmm.   It's a pretty vanilla install. What are the possibilities?  My hardware is broken; there's a bug in MoOde's Access Point code; my phone can't see MoOde Access Points...

Maybe there's something in the logs.   It looks like moode.log might be the place to look but it's already got nothing for yesterday morning when I last had the problem.  I've enabled debug logging and I'll try again tomorrow when I'm next away from my network.

The startup log is generated afresh during boot, it's not cumulative. Turning debug logging on won't help with this kind of problem.

Maybe they could be kept for a couple of reboots, with .1, .2 etc extensions, to help in situations like this?
Reply
#10
(03-16-2024, 08:21 PM)TheOldPresbyope Wrote: @Sehnsucht

Maybe it's the result shown in my test case 3) which is tripping you up.

Test 1)

I just loaded moOde 8.3.9 (configured with hostname "zerotest") to a uSD card, stuck it in a Pi Zero W, and booted. Opened the WiFi settings on my Google Pixel 6a phone.

After about 2-1/2 minutes "zerotest" appeared in the Pixel's list of available WiFi access points. Connected the Pixel to it (and, when alerted that this connection had no Internet access, told it to stay connected).

Opened the Chrome browser on the Pixel and gave it the mDNS URL "zerotest.local". Chrome opened the moOde WebUI, fresh as paint.

Test 2) 

Configured the moOde player for a WiFi connection to a non-existent WiFi access point (this to approximate the situation of your player being configured for your home network but started up away from the house). Rebooted. After a rather longer time lapse than before (sorry, I didn't time it), "zerotest" again appeared in my Pixel's list of available WiFi access points. 

I can proceed to connect and open the moOde WebUI to "zerotest.local" as before.

Test 3)

Configured the moOde player for a connection to my Pixel as access point. Rebooted it. Also, disconnected my Pixel from my home WiFi network so it was connected solely to the cellular data network. After about 2+ minutes, the moOde player is connected to my Pixel. This time, however, I am unable to access the moOde WebUI by the mDNS URL "zerotest.local". Why? Because of the way Android treats address space. The phone's IP address (10.115.x.x) and the moOde player's IP address (192.168.x.x) are in different networks, and mDNS does not cross network boundaries.

Just as you did, I can use yet another device to connect to my phone and locate the IP address of the moOde player. This address works fine in the Chrome browser on the Pixel because Android does route IP.

Trying to find the connected moOde player using the Android app "fing" fails because Android fing doesn't think the phone is connected to a WiFi network.

I don't know offhand why Android has assigned the phone an IP address in the 10.115.x.x range when it's running on the cellular data network. Both 10.x.x.x and 192.1668.x.x are in the IETF/IANA reserved IP address blocks for "local communications within a private network".

Regards,
Kent

Hmm. So, I figured out a safe way of testing - change the SSID of the pi to a hotspot SSID from my phone (that's not the name of my usual network).  So by turning that hotspot on and off I can simulate going outside away from my network.   I could eventually see the Pi's AP SSID.   I'm not sure why it wasn't working yesterday.   I was literally sat in a cafe with the pi on for at least 10 minutes.  I'll try it outside tomorrow.   (I guess it would be nice if there was an option to more quickly use the AP mode; either you're in a location where the pi can see the access point or not, so it could switch into AP mode immediately really? )
Thanks for your help anyway!

Edit:  Hmm, ok, what I just wrote is almost true.  But I could never get it working from the Pixel 6a.  (I could from the amazon tablet and a chromebook).  Until, that is, I disconnected my Pixel from the mobile network. So... connected to phone network I get a 10.x.x.x address (like in your scenario 3 except I think you're tethering the phone and the pi there, whereas i'm not doing that - i'm attaching the phone to the pi.  I'd like the phone to get allocated the ip address from the pi, not the phone network.  Perhaps that would fix this.  I don't want to have to disconnect from the phone network when I use my pi in AP mode as i'll miss call/s messages!

Why, when I am on my cellular network AND my home wifi, do I see a 192.168.4.x ip address for my phone (in addition to 3 ipv6 numbers), whereas when I'm on my cellular network and MoOde's AP I only have my cellular network's 10.x.x.x address?  What is causing this different behaviour - Android, MoOde or my phone company (Smarty, part of 3)?

Edit: ok, I've solved it.  When you connect to the AP about 5-15 seconds later you get a popup saying "AP has no internet access. tap for options".   If you tap on it you get another popup saying "This network has no internet access. Stay connected?". There's a checkbox with "don't ask again for this network" and a yes/no choice.  If you ignore this, or swipe it away, then you can't communicate with the access point.  If you look at your internet settings in android you see info for your cell connection and the AP.  In the "not working" state they both say connected (well, the AP randomly chooses between "connected" and "connected to device".)  If you tick the checkbox and click yes then the word connected is removed from the call connection entry.  In the working state I can connect to moOde and make calls and send sms; I just have no internet access. This is fine.
Reply


Forum Jump: