Thank you for your donation!


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


Problem: Wifi Issue
#1
Hello I'm a new member, I've been trying to setup Moodeaudio since the past week but can't seem to get the Wifi working, the ethernet works fine though. I followed the instructions in the setup.txt in Github, but no results. I've also gone through a few posts on the forum regarding WiFi issues and found that my router was using TKIP which I changed to WPA2 AES, but it didn't solve the problem. I thought it was a problem with my router, but using my phone hotspot also didn't work. I have checked the SSID and password multiple times. The AP mode doesn't work either.

Raspberry Pi 2 Model B
WiFi adapter - Leoxsys LEO-NANO150N
Moode 7.0.1

Here's the moode log
Code:
20210119 052256 worker: -- Start
20210119 052257 worker: Successfully daemonized
20210119 052257 worker: Integrity check (passed)
20210119 052258 worker: File check (OK)
20210119 052258 worker: Session loaded
20210119 052258 worker: Debug logging (OFF)
20210119 052258 worker: -- Device
20210119 052258 worker: ALSA cards: (0:b1 | 1:Headphones | 2:empty | 3:empty
20210119 052258 worker: Configured: (0:Pi HDMI 1 | mixer:(HDMI) | alsavol:0)
20210119 052259 worker: ALSA mixer actual (HDMI)
20210119 052259 worker: ALSA HDMI volume set to (0%)
20210119 052259 worker: -- System
20210119 052301 worker: Host     (moode)
20210119 052302 worker: moOde    (7.0.1 2020-12-23)
20210119 052302 worker: RaspiOS  (10.6)
20210119 052302 worker: Kernel   (5.4.77-v7+ #1371)
20210119 052302 worker: Platform (Pi-2B 1GB v1.1)
20210119 052302 worker: ARM arch (armv7l, 32-bit kernel)
20210119 052302 worker: MPD ver  (0.22.3_p0x3)
20210119 052302 worker: CPU gov  (ondemand)
20210119 052302 worker: USB boot not available
20210119 052302 worker: File system not expanded yet
20210119 052302 worker: HDMI port on
20210119 052302 worker: -- Network
20210119 052302 worker: eth0 exists
20210119 052302 worker: eth0 wait 0 for IP address
20210119 052305 worker: eth0 wait 1 for IP address
20210119 052308 worker: eth0 wait 2 for IP address
20210119 052311 worker: eth0 wait 3 for IP address
20210119 052314 worker: eth0 wait 4 for IP address
20210119 052317 worker: eth0 address not assigned
20210119 052317 worker: wlan0 exists
20210119 052317 worker: wifi country (IN)
20210119 052317 worker: wlan0 trying SSID (FTTH-6BA1)
20210119 052318 worker: wlan0 wait 0 for IP address
20210119 052321 worker: wlan0 wait 1 for IP address
20210119 052324 worker: wlan0 wait 2 for IP address
20210119 052327 worker: wlan0 wait 3 for IP address
20210119 052330 worker: wlan0 wait 4 for IP address
20210119 052333 worker: wlan0 no IP addr for SSID (FTTH-6BA1)
20210119 052333 worker: wlan0 AP mode started
20210119 052406 worker: wlan0 wait 0 for IP address
20210119 052409 worker: wlan0 wait 1 for IP address
20210119 052412 worker: wlan0 wait 2 for IP address
20210119 052415 worker: wlan0 unable to start AP mode
20210119 052415 worker: no active network interface
20210119 052415 worker: -- Audio
20210119 052416 worker: MPD conf updated
20210119 052416 worker: ALSA outputs unmuted
20210119 052416 worker: ALSA card number (0)
20210119 052417 worker: Audio output (Pi HDMI 1)
20210119 052417 worker: Audio formats (U8, S16_LE)
20210119 052418 worker: ALSA mixer name (HDMI)
20210119 052418 worker: MPD volume control (software)
20210119 052418 worker: Hdwr volume controller exists
20210119 052418 worker: Max ALSA volume (100%)
20210119 052418 worker: Reset renderer active flags
20210119 052418 worker: -- MPD
20210119 052418 worker: MPD started
20210119 052419 worker: MPD accepting connections
20210119 052419 worker: Configure MPD outputs
20210119 052419 worker: MPD output 1 ALSA default (on)
20210119 052419 worker: MPD output 2 ALSA crossfeed (off)
20210119 052419 worker: MPD output 3 ALSA parametric eq (off)
20210119 052419 worker: MPD output 4 ALSA graphic eq (off)
20210119 052419 worker: MPD output 5 ALSA polarity inversion (off)
20210119 052419 worker: MPD output 6 ALSA bluetooth (off)
20210119 052419 worker: MPD output 7 HTTP stream (off)
20210119 052419 worker: MPD crossfade (off)
20210119 052419 worker: -- Feature availability
20210119 052419 worker: Source select (available)
20210119 052419 worker: Source select (source: MPD)
20210119 052420 worker: Source select (output: Pi HDMI 1)
20210119 052420 worker: Bluetooth (available)
20210119 052420 worker: Airplay renderer (available)
20210119 052420 worker: Spotify renderer (available)
20210119 052420 worker: Squeezelite renderer (available)
20210119 052420 worker: UPnP renderer (available)
20210119 052420 worker: DLNA server (available)
20210119 052420 worker: UPnP browser (available)
20210119 052420 worker: GPIO button handler (available)
20210119 052420 worker: Stream recorder (n/a)
20210119 052420 worker: -- Music sources
20210119 052420 worker: USB sources (none attached)
20210119 052420 worker: NAS and UPnP sources (none configured)
20210119 052420 worker: -- Miscellaneous
20210119 052420 worker: USB volume knob (Off)
20210119 052420 worker: USB auto-mounter (udisks-glue)
20210119 052420 worker: LED0 (On)
20210119 052420 worker: LED1 (On)
20210119 052420 worker: Saved MPD vol level (0)
20210119 052420 worker: Preamp volume level (0)
20210119 052420 worker: MPD volume level (0) restored
20210119 052421 worker: ALSA HDMI volume (100%)
20210119 052421 worker: Auto-play (Off)
20210119 052421 worker: Maintenance interval (3 hrs)
20210119 052421 worker: Screen saver activation (Never)
20210119 052421 worker: Session permissions (OK)
20210119 052421 worker: Watchdog started
20210119 052421 worker: Ready
Reply
#2
@abhiroopd 

Some things in network portion of your log look ok and some don't.

Here's what I mean:


Code:
20210119 052302 worker: -- Network
20210119 052302 worker: eth0 exists
20210119 052302 worker: eth0 wait 0 for IP address
20210119 052305 worker: eth0 wait 1 for IP address
20210119 052308 worker: eth0 wait 2 for IP address
20210119 052311 worker: eth0 wait 3 for IP address
20210119 052314 worker: eth0 wait 4 for IP address
20210119 052317 worker: eth0 address not assigned

OK, so far. The system detected the ethernet adapter but gave up after trying 5 times to get an IP assignment.  This is to be expected if you are disconnected from the ethernet and are configured to use DHCP for IP assignment.


Code:
20210119 052317 worker: wlan0 exists
20210119 052317 worker: wifi country (IN)
20210119 052317 worker: wlan0 trying SSID (FTTH-6BA1)
20210119 052318 worker: wlan0 wait 0 for IP address
20210119 052321 worker: wlan0 wait 1 for IP address
20210119 052324 worker: wlan0 wait 2 for IP address
20210119 052327 worker: wlan0 wait 3 for IP address
20210119 052330 worker: wlan0 wait 4 for IP address
20210119 052333 worker: wlan0 no IP addr for SSID (FTTH-6BA1)

Having failed with ethernet, the system moved on to WiFi. It detected the WiFi adapter and tried to associated with an AP with the SSID "FTTH-6BA1". Not shown for security reasons is the password you gave for this SSID, but it is the one being used. Again, it gave up after trying 5 times to associate and get assigned an IP. This is to be expected if the SSID is wrong or the password wrong or both.

Now, however, something unexpected


Code:
20210119 052333 worker: wlan0 AP mode started
20210119 052406 worker: wlan0 wait 0 for IP address
20210119 052409 worker: wlan0 wait 1 for IP address
20210119 052412 worker: wlan0 wait 2 for IP address
20210119 052415 worker: wlan0 unable to start AP mode
20210119 052415 worker: no active network interface


I don't understand this. What should have appeared is something like


Code:
worker: wlan0 AP mode started
worker: IP addr (172.24.1.1)
worker: Netmask (255.255.255.0)
worker: Gateway (0.0.0.0)
worker: Pri DNS (127.0.0.1)


I don't know the WiFi adapter you are using. Are you sure it can work in AP mode? Many can but some cannot. I don't have one I know doesn't so can't test how that would be reported in the log.

Regards,
Kent
Reply
#3
Thank you so much for your quick and detailed reply.
Well the SSID shouldn't be wrong because I selected it from the list of networks scanned by the WiFi adapter itself. And I have checked the password also multiple times, is there anything else I can do to make sure the correct password is being used when it is attempting to connect with the AP?

And about the WiFi AP mode, on Amazon it says that AP mode is supported - https://www.amazon.in/Leoxsys-Wireless-W...B00ECXY0GQ


But on the Leoxsys website they say - "Note:Software AP function will not work in windows XP,WIN8 or other OSes with current given software. User may use external software to make software AP and use.We do not claim/support with our software Wi-Fi AP function."
Reply
#4
Hey there,

I would try static IP first and in next step change wifi-PW to an easy one, only using digits.
did you set the network region right? should fit the used standard of your router.

good luck.
Reply
#5
I switched from Volumio actually, and it was working fine there, and I just verified the password once again.
When I go to raspi-config, system options -> wireless LAN, I get the following error message: 

Code:
Could not communicate with wpa_supplicant. There was an error running option S1 Wireless LAN

And then I tried the following commands - 

Code:
pi@moode:~ $ sudo killall wpa_supplicant
pi@moode:~ $ sudo wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
Successfully initialized wpa_supplicant
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface
Reply
#6
@abhiroopd 

I see nothing in the product description which suggests this device supports hotspot mode, only that some users got it to connect to a mobile hotspot. The error messages you post reinforce my opinion that it does not.

I note that neither raspi-conf nor the command-line commands you used should be necessary for moOde to function, but their output reinforce my opinion that it isn't compatible.

As for normal WiFi client-mode operation, if the SSID of your AP is being detected and displayed correctly, I suppose there's an outside change that the password expected by the AP contains some unusual character which isn't be passed through correctly by moOde's Network Config screen. Given all the work Tim has done in recent versions I can't imagine there are many problematic characters left. I believe this possibility is what zOr7gA8 is alluding to with his suggestion to "in next step change wifi-PW to an easy one, only using digits."


I don't think there's anything more I can do here. The existing moOde WiFi code works fine with the built-in RPi WiFi adapters and with all the USB-WiFi adapters I have which have been  named explicitly as being Raspberry Pi-compatible.

Regards,
Kent
Reply
#7
Hello, thanks for your help. But I have finally got the WiFi adapter working. SSID, password or static/dynamic IP were definitely not the issue here because those are still unchanged. And as for the Leoxsys LEO-NANO150N being compatible, it worked fine out of the box with Rasberry OS, OSMC, Volumio, and everything else that I tried with the pi (https://elinux.org/RPi_USB_Wi-Fi_Adapters) except for moodeaudio. I googled the error messages and what fixed it for me was this command  - 
Code:
wpa_supplicant -iwlan0 -D wext -c/etc/wpa_supplicant/wpa_supplicant.conf -B dhclient wlan0

But I had to run it every time pi boots, so I added it to rc.local and it completely fixed my problem. 
So could someone please explain me the technical details of what exactly happened, and why these commands fixed the issue.
Also, I have noticed that the booting time has slowed down a bit after this, I have already disabled wait for ethernet in moode, and added the above command as a background process in rc.local.
Thank you so much for this amazing software!!  Smile
Reply
#8
@abhiroopd 

It seems you are going to a lot of effort to do what moOde already does. Specifically, moOde---or, rather the underlying Raspberry Pi OS---starts wpa_supplicant, passing it the already configured wpa_supplicant.conf file, when necessary. I have no idea what has been done to your installation which makes it necessary to start it yourself.

If you are implying that there is some specific wpa_supplicant option/setting which had to be changed for your particular WiFi adapter, then it is up to you to tell us which one it was and why.

Regards,
Kent
Reply
#9
I'm guessing the command that I posted, does something more than just start the wpa_supplicant. The error message that I got was - 
Code:
nl80211: Driver does not support authentication/association or connect commands
This is what led me to use the command that I posted. Probably has something to do with nl80211 not being supported and thus using wext driver. But I'm a noob in networking, so I was hoping somebody could decode what was happening exactly.

And nothing has been done to my installation, I downloaded the latest version of Moodeaudio and wrote to the SD card of my Pi
Reply
#10
(01-20-2021, 06:52 PM)abhiroopd Wrote: I switched from Volumio actually, and it was working fine there, and I just verified the password once again.
When I go to raspi-config, system options -> wireless LAN, I get the following error message: 

Code:
Could not communicate with wpa_supplicant. There was an error running option S1 Wireless LAN

And then I tried the following commands - 

Code:
pi@moode:~ $ sudo killall wpa_supplicant
pi@moode:~ $ sudo wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0
Successfully initialized wpa_supplicant
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface

If you used rasps-config or ssh commands to alter system or network settings then the config that moOde needs to see is prolly broken.

The way to troubleshoot WiFi adapter issues is to first start with a FRESH image then try the following:

1. Plug in Ethernet cable and WiFi adapter.
2. Power up the system
3. Menu, Configure, Network
4. Enter SSID and password then SAVE
5. Power off
6. Unplug Ethernet cable
7. Power up the system
8. Wait several minutes for system startup and either successful WiFi connection, AP mode startup or no WiFi
9. Plug in Ethernet cable

Then connect via SSH and do the following

1. Check syslog for wlan related errors

Code:
cat /var/log/syslog | grep wlan

2. Verify that the moOde generated wpa_supplicant.conf file is valid. It should look like below with your SSID and a numeric WPA pre-shared key. This key should exactly match the output of the following command:

Code:
wpa_passphrase "SSID" "password"

Code:
pi@rp3:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
       ssid="xxxxxxxx"
       scan_ssid=1
       psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: