Thank you for your donation!


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


Auto-config wifi setup issues
#11
(10-12-2023, 10:20 PM)TheOldPresbyope Wrote: Umm, have a look at moode/etc/hostapd/hostapd.overwrite.conf in the repo.

Regards,
Kent

Thats some great bug sleuthing!

It never occurred to me to search the code base for the PSK corresponding to password 'moodeaudio'. I did just check and that file contains the only occurrence.

Fix will be in upcoming 8.3.7 :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#12
Queue Queen: another one bites the dust!
Reply
#13
For sure :-)

Try a test. Edit hosted.conf and just remove the PSK so the param is like below

wpa_key_mgmt=WPA-PSK
wpa_psk=
rsn_pairwise=CCMP

In my test the "Moode" network did not show up.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#14
(10-12-2023, 05:57 PM)TheOldPresbyope Wrote: {@avsfan19 

OK, I finally got some time this morning to think about your problem. 

While working with the WiFi station and AP modes should be the same irrespective of the RPi model---assuming it can access an appropriate WiFI transceiver---I ran the following exercises on an RPi2B with an outboard CanaKit USB-WiFi transceiver to try more or less to replicate your situation..

_____

First, let's see what happens with no moodecfg.ini file. Flash a fresh moOde 8.3.6 image to a uSD card using the Raspberry Pi Imager (in which settings I enabled SSH and set the default username and password).

Insert the card in the RPi2B and power up. Wait an insufferably long time (I forgot how slow the RPi2B is plus there's a timeout looking for the Ethernet connection which isn't there) and finally an AP with SSID "Moode" shows up on my laptop as an available WiFi Network.
By default, this AP requires the password "moodeaudio". This is a holdover from the good old days (sorry it isn't better documented) and basically is necessary because the Raspberry Pi Imager has no way to deal with AP-mode parameters in situ.

Connect to this network and now you can open moOde's WebUI at IP address 172.24.1.1.


Opening the Network Configuration panel, one gets the popup notice "An Access Point password needs to be set." which reinforces the new security emphasis. At this point, you can set your desired AP SSID "Speakers" and your selected AP password. Save the Access Point settings and reboot. All should be as you want it.

_____

Referring back to the Network Configuration panel, note that either before or after changing the AP SSID and AP password, the Network SSID setting is "None (Activates AP mode)". That's the same as the default setting in /boot/moodecfg.ini.default so let's try it in our second test.

As before, use Raspberry Pi Imager to flash a fresh image of moOde 8.3.6 to a uSD card. This time though---and before booting the card on the RPi2B---copy over the /boot/moodecfg.ini.default file to boot/moodecfg.ini. Leave wlanssid = "None (activates AP mode)" as is but make the desired AP settings under [Network (apd0)]. Save the file  and then boot the card on the RPi2B. Shazam! After waiting interminably again, your moOde player should have come up in AP mode with the new SSID/pw.

_____

Finally, try again with a fresh image and this time with your moodecfg.ini file which contains the line wlanssid="". Again, after waiting an insufferably long time, the moOde player should come up in AP mode with SSID "Speakers". The only salient difference I notice is that in the WebUI under Network Configuration, the Network SSID setting is "Nothing selected". Easily changed to "None (Activates AP mode)" if it bothers you.

_____

Sorry for the long-winded response but I figured TMI is better than TLI (too little information). Smile

Regards,
Kent

PS - note that Tim's response contained a trivial typo. The file is /var/log/moode_autocfg.log

Woah, thanks so much for the detailed and quick reply! The first option of booting up the Pi with a fresh, un-edited image, then inputting "moodeaudio" as the password worked. Then I was able to configure the AP as needed and set up the WiFi connection. Still not sure why editing the AP network settings in the moodecfg.ini file then pasting to the sd card didn't work for me, as it sounds like it worked ok for you. But regardless, everything seems to be working great now. 

Thanks again to you and Tim for the quick help.
Reply
#15
(10-12-2023, 11:19 PM)Tim Curtis Wrote: For sure :-)

Try a test. Edit hosted.conf and just remove the PSK so the param is like below

wpa_key_mgmt=WPA-PSK
wpa_psk=
rsn_pairwise=CCMP

In my test the "Moode" network did not show up.

True, it didn't start here either but it keeps trying. /var/log/syslog is being flooded with endless repetition of the following:


Code:
...
Oct 13 16:09:37 moode systemd[1]: Starting Access point and authentication server for Wi-Fi and Ethernet...
Oct 13 16:09:37 moode hostapd[28254]: Configuration file: /etc/hostapd/hostapd.conf
Oct 13 16:09:37 moode hostapd[28254]: Line 21: Invalid PSK ''.
Oct 13 16:09:37 moode hostapd[28254]: WPA-PSK enabled, but PSK or passphrase is not configured.
Oct 13 16:09:37 moode hostapd[28254]: 2 errors found in configuration file '/etc/hostapd/hostapd.conf'
Oct 13 16:09:37 moode hostapd[28254]: Failed to set up interface with /etc/hostapd/hostapd.conf
Oct 13 16:09:37 moode hostapd[28254]: Failed to initialize interface
Oct 13 16:09:37 moode systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
Oct 13 16:09:37 moode systemd[1]: hostapd.service: Failed with result 'exit-code'.
Oct 13 16:09:37 moode systemd[1]: Failed to start Access point and authentication server for Wi-Fi and Ethernet.
Oct 13 16:09:39 moode systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 6530.
Oct 13 16:09:39 moode systemd[1]: Stopped Access point and authentication server for Wi-Fi and Ethernet.
...

and "Restart=on-failure" is set in /lib/systemd/system/hostapd.service

Don't know enough about hostapd to know if there's an easy hack or if one has to officially enable/disable the service.

Regards,
Kent
Reply
#16
@avsfan19 


Quote:Woah, thanks so much for the detailed and quick reply! The first option of booting up the Pi with a fresh, un-edited image, then inputting "moodeaudio" as the password worked. Then I was able to configure the AP as needed and set up the WiFi connection. Still not sure why editing the AP network settings in the moodecfg.ini file then pasting to the sd card didn't work for me, as it sounds like it worked ok for you. But regardless, everything seems to be working great now. 

Thanks again to you and Tim for the quick help.

Glad to help but as you can guess from the posts between Tim and me the first option won't be working as of moOde 8.3.7.

I'm not sure either why editing the moodecfg.ini file didn't work for you but I guess we'll kick that can down the road.

Regards,
Kent
Reply


Forum Jump: