Volumio Debian Buster Beta - Raspi images debugging

The tentative fix was in just setting the right parameters in hostapt.conf

volumio@volumio:~$ cat /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
channel=4
hw_mode=g
wmm_enabled=0
macaddr_acl=0
ignore_broadcast_ssid=0
# Auth
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
ssid=Volumio
rsn_pairwise=CCMP
# Volumio specific
ssid=Volumio
wpa_passphrase=volumio2

This seems to let the hostapd.service start fine, but like you mentioned, also see the errors with dhcpcd.service
Could you check for all failed services on startup with systemctl list-units --failed and then grab the details with systemctl status blah.service?

First a tiny feedback to /etc/hostapd/hostapd.conf. There is the ssid line twice. :wink:

Regarding the hostapd and dhcpd issues I tested a more radically way successfully. Actually I am not very happy to see the way how the hotspot.service is implemented. I would suggest to remove this service and do it just with hostapd.service and dhcpd.service / dnsmasq.service.
I changed the /lib/systemd/system/dhcpd.service to:

[Unit] BindsTo=hostapd.service After=hostapd.service Requires=hostapd.service [Service] Type=forking ExecStart=/usr/sbin/dhcpd KillMode=mixed Restart=no StandardOutput=syslog StandardError=syslog SyslogIdentifier=dhcpd

I also changed the /lib/systemd/system/dnsmasq.service to :

[Unit] BindsTo=hostapd.service After=hostapd.service Requires=hostapd.service [Service] Type=forking ExecStart=/usr/sbin/dnsmasq --address=/#/192.168.211.1 -2 --interface=wlan0 KillMode=mixed Restart=no StandardOutput=syslog StandardError=syslog SyslogIdentifier=dnsmasq

Further it has to add a empty /var/lib/dhcp/dhcpd.leases file.

The /lib/systemd/system/hostapd.service I didn’t change at all.

With systemctl disable hostapd the the hostapd (providing an access point) should not start at boot time as well as the dhcpd service and the dnsmasq service.

I know there is an extra hostapd-edimax solution checked in the hotspot.sh. Could anybody explain it this still necessary on Buster?
The 8192cu is even blacklisted by default: /etc/modprobe.d/blacklist-8192cu.conf

Another point, please could you change in the /bin/firstart.sh:

mkdir /var/log/samba

to

/var/log/samba/cores

Otherwise there is always an error in the journalctl:

Apr 29 16:58:40 volumio nmbd[595]: mkdir failed on directory /var/log/samba/cores: No such file or directory Apr 29 16:58:40 volumio nmbd[595]: Failed to create /var/log/samba/cores for user 0 with mode 0700 Apr 29 16:58:40 volumio nmbd[595]: Unable to setup corepath for nmbd: No such file or directory Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.802926, 0] ../lib/util/debug.c:1063(reopen_logs_internal) Apr 29 16:58:40 volumio nmbd[595]: Unable to open new log file '/var/log/samba/log.nmbd': No such file or directory Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.802926, 0] ../lib/util/debug.c:1063(reopen_logs_internal) Apr 29 16:58:40 volumio nmbd[595]: Unable to open new log file '/var/log/samba/log.nmbd': No such file or directory Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.807944, 0] ../lib/util/debug.c:1063(reopen_logs_internal) Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.807944, 0] ../lib/util/debug.c:1063(reopen_logs_internal) Apr 29 16:58:40 volumio nmbd[595]: Unable to open new log file '/var/log/samba/log.nmbd': No such file or directory Apr 29 16:58:40 volumio nmbd[595]: Unable to open new log file '/var/log/samba/log.nmbd': No such file or directory Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.812337, 0] ../source3/nmbd/asyncdns.c:158(start_async_dns) Apr 29 16:58:40 volumio nmbd[595]: started asyncdns process 660 Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.815455, 0] ../lib/util/become_daemon.c:149(daemon_status) Apr 29 16:58:40 volumio nmbd[595]: daemon_status: STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ... Apr 29 16:58:40 volumio nmbd[595]: [2020/04/29 16:58:40.816990, 0] ../source3/nmbd/nmbd_subnetdb.c:254(create_subnets) Apr 29 16:58:40 volumio nmbd[595]: NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).
However, I don’t know what might be the impact of this change because /var/log is mounted as tmpfs.

Finally, in terms of your question:

After the changes regarding hostapd and dhcpd services I get only one error: xbindkeysrc.service

Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Succeeded. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Service RestartSec=100ms expired, scheduling restart. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Scheduled restart job, restart counter is at 1. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Succeeded. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Service RestartSec=100ms expired, scheduling restart. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Scheduled restart job, restart counter is at 2. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Succeeded. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Service RestartSec=100ms expired, scheduling restart. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Scheduled restart job, restart counter is at 3. Apr 29 16:58:40 volumio systemd[1]: xbindkeysrc.service: Succeeded. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Service RestartSec=100ms expired, scheduling restart. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Scheduled restart job, restart counter is at 4. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Succeeded. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Service RestartSec=100ms expired, scheduling restart. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Scheduled restart job, restart counter is at 5. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Start request repeated too quickly. Apr 29 16:58:41 volumio systemd[1]: xbindkeysrc.service: Failed with result 'start-limit-hit'.
But maybe his is not a new issue: https://github.com/volumio/Build/issues/386

The mentioned way does not work as I already assumed.

@ashthespy Could you add a customized nmbd.service in your next image with two ExecStartPre lines:

[code][Unit]
Description=Samba NMB Daemon
Documentation=man:nmbd(8) man:samba(7) man:smb.conf(5)
Wants=network-online.target
After=network.target network-online.target

[Service]
Type=notify
NotifyAccess=all
PIDFile=/var/run/samba/nmbd.pid
EnvironmentFile=-/etc/default/samba
ExecStartPre=mkdir -p /var/log/samba/cores
ExecStartPre=chmod 700 /var/log/samba/cores
ExecStart=/usr/sbin/nmbd --foreground --no-process-group $NMBDOPTIONS
ExecReload=/bin/kill -HUP $MAINPID
LimitCORE=infinity

[Install]
WantedBy=multi-user.target
[/code]
This avoids all samba based error messages in the journalctl.

Further could you add a ExecStartPre line to the the dhcpd.service:

ExecStartPre=touch /var/lib/dhcp/dhcpd.leases

This avoids dhcpd errors because of missing dhcpd.leases file.

Thanks

FWIW, I have done some tests with the Volumio Buster image 3.0005 (provided by ashthespy at the start of this thread) on Raspberry Pi 4 4GB, Pi 3 Model B V1.2, Pi 2 Model B V1.1 and Pi Model B+ V1.2.

To summerize my changed based on the provided image I have created a small script to run initially after first boot.

#!/bin/bash

# Not need to start automatically after boot
systemctl stop dnsmasq
systemctl disable dnsmasq
systemctl stop hostapd
systemctl disable hostapd

# Not necessary for hotspot, because DHCP and DNS services can be provided by dnsmasq
apt-get purge isc-dhcp-server -y
rm /lib/systemd/system/dhcpd.service

# replace default systemd file for dnsmasq from Raspbian Buster
tee /lib/systemd/system/dnsmasq.service > /dev/null  <<'EOF'
[Unit]
Description=dnsmasq - A lightweight DHCP and caching DNS server
Requires=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
After=network.target
# Added for hotspot function on Volumio
After=hostapd.service
PartOf=hostapd.service

[Service]
Type=forking
PIDFile=/run/dnsmasq/dnsmasq.pid

# Test the config file and refuse starting if it is not valid.
ExecStartPre=/usr/sbin/dnsmasq --test

# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
# wrapper picking up extra configuration files and then execs dnsmasq
# itself, when called with the "systemd-exec" function.
ExecStart=/etc/init.d/dnsmasq systemd-exec

# The systemd-*-resolvconf functions configure (and deconfigure)
# resolvconf to work with the dnsmasq DNS server. They're called like
# this to get correct error handling (ie don't start-resolvconf if the
# dnsmasq daemon fails to start.
ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf

ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
EOF


# add config to use dnsmasy as dhcp and dns server
tee /etc/dnsmasq.conf > /dev/null <<'EOF'
# Only listen on wifi interface
interface=wlan0
# Always return 192.168.211.1 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver
address=/#/192.168.211.1
# DHCP server not active on wired lan interface
no-dhcp-interface=eth0
# IPv4 address range, netmask and lease time
dhcp-range=192.168.211.100,192.168.211.200,255.255.255.0,24h
# DNS server
dhcp-option=option:dns-server,192.168.211.1
expand-hosts
domain=local
# Facility to which dnsmasq will send syslog entries
log-facility=local7
EOF


tee /lib/systemd/system/hostapd.service > /dev/null <<'EOF'

[Unit]
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
After=network.target
# Added for hotspot function on Volumio
Wants=dnsmasq.service

[Service]
Type=forking
PIDFile=/run/hostapd.pid
Restart=on-failure
RestartSec=2
Environment=DAEMON_CONF=/etc/hostapd/hostapd.conf
EnvironmentFile=-/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

[Install]
WantedBy=multi-user.target
EOF

# Remove duplicate ssid
sed -i '0,/^ssid=Volumio.*/{//d;}' /etc/hostapd/hostapd.conf


# set power save off doesn't need a own script 
sed -i '/^ExecStartPre=.*/c ExecStartPre=/sbin/iw dev wlan0 set power_save off' /lib/systemd/system/wireless.service 
# checking with /sbin/iw wlan0 get power_save
rm /bin/wifistart.sh


# To avoid error messages in journalctl
sed -i '/^ExecStart=.*/i ExecStartPre=touch /var/log/mpd.log' /lib/systemd/system/mpd.service
sed -i '/^ExecStart=.*/i ExecStartPre=chown volumio /var/log/mpd.log' /lib/systemd/system/mpd.service
sed -i '/^ExecStart=.*/i ExecStartPre=mkdir -p /var/log/samba/cores' /lib/systemd/system/nmbd.service
sed -i '/^ExecStart=.*/i ExecStartPre=chmod 700 /var/log/samba/cores' /lib/systemd/system/nmbd.service


# Not used in the whole wireless.js file
sed -i '/^var\ dhcpd\ =\ "dhcpd";/d' /volumio/app/plugins/system_controller/network/wireless.js
# Autostart with a hotspot.service is not necessary / not used at all. It will handled by wireless.js
rm /lib/systemd/system/hotspot.service
sed -i '/^var\ starthostapd.*/c var starthostapd = "systemctl start hostapd";' /volumio/app/plugins/system_controller/network/wireless.js 
sed -i '/^var\ stophostapd.*/c var stophostapd = "systemctl stop hostapd";' /volumio/app/plugins/system_controller/network/wireless.js


# hotspot.sh not needed because hostapd 2.8 of Buster shows not problem with RTL8192CU chips on a Raspbeery Pi 2 Model B V1.1
# dmesg
# [   20.806322] rtl8192cu: Chip version 0x11
# [   20.932987] rtl8192cu: Board Type 0
# [   20.933439] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
# [   21.013537] usbcore: registered new interface driver rtl8192cu
# [   22.251550] rtl8192cu: MAC auto ON okay!
# [   22.293138] rtl8192cu: Tx queue select: 0x05
# [   33.773281] rtl8192cu: MAC auto ON okay!
# [   33.802524] rtl8192cu: Tx queue select: 0x05
rm /bin/hotspot.sh

I tested the Pi 4 and Pi 3 just with the integrated wifi chip successfully. The Pi 2 I tested with several wifi usb donglesbased on chipsets: RT3572, RT5372, RT5572 and RT8192CU successfully as well. However sometimes a second boot was required to establish the hotspot. Further tests might be needed. The Pi 2 with RT8192CU runs for several hours successfully wihtout the need of a specific hostapd-edimax binary. So I removed the whole hotspot script and hotspot service (what was obviously implemented to provide different hostapd binarys) and run just the hostapd and dnsmasq services triggered in the wireless.js
Unfortunately, the Pi Model B V1.2 had problems with all my wifi usb dongles but I now am out of time to do some more investigations on it.

Futhermore, I tested the plugins Spotify , Volumio Spotify Connect 2 and Kodi for Buster (Kodi details: https://github.com/Saiyato/volumio-kodi-plugin/issues/13) successfully.
However the maintainer of the Spotify plugin has to adjust the install scipt because of missing lib:

# Spotify plugin
ln -s /usr/lib/arm-linux-gnueabihf/libsox.so /usr/local/lib/libsox.so.2

I would be happy if a new Buster image could be provided for further tests.
Thanks :slight_smile:

You are doing great debugging sessions!

Would you like to help us officially on the repo?

Thanks for the debugging and the script!

Instead of creating the log dir via the service, it might be prudent to have something similar to log2ram run on boot that (re)creates all the log folders and perms. Might be overkill for now, but something to keep in mind!

New build attached in the first post, but I didn’t find time to fully integrate all your hotspot tweaks, so you might have to change your script again, sorry!
Not tested fully - but this should suffice
gist.github.com/ashthespy/13333 … 8462cd7bf2

@michelangelo:

I appreciate your offer and I am willing to help where I can. For me it is not necessary to do this in any officially way.

@ashthespy:

You are absolutly right, for sure there are better ways to solve the log issue. But for now the pre start command should solve the problem.

Thanks, I will have a look the next days. :smiley:

I was requested in another thread to test this Buster-based release on RPi0.

I have available following hardware:

1x RPi0 (No Wifi/BT)
1x RPi0W (With Wifi/BT)
1x Waveshare USB Hat, with Serial2Usb for UART debug waveshare.com/usb-hub-hat.htm
several MT7601U Wireless Adapter (ID 148f:7601), they work fine with Raspbian stretch and buster
2x USB-to-Ethernet Adaptor
1x PCB for playing audio from GPIO (it was an experiment with Sallen-Key filters, it can replace AudioJack playback on RPi0)
several I2S DAC
some bluetooth dongles (4.0, 5.0)

According to the instructions on the first post, these images will not (currently) work out of the box on older arm6l versions (RPi 1, CM1, RPi Zero).

What shall I do to make them working and proceed with testing?

I went into the several post of this thread, I realized latest images should work on RPi0

I’m already flashing latest on SD-card for some test

I’ve done some testing on following setup:

RPi0 (no Wifi/BT)
Waveshare USB HAT, with USB-to-UART onboard waveshare.com/usb-hub-hat.htm
USB-to-Ethernet adaptor
USB WiFi dongle 148f:7601
Hat with I2S amplifiers TFA8200

-Boot process is successful, I can login from UART terminal
-WiFi dongle is recognized properly (on jesse was not)
-USB-to-Ethernet adaptor is recognized properly, IP is assigned via DCHP when connected to the router
-Hotspot is not created when Ethernet cable is not connected
I can’t load UI from web browser when Ethernet cable is connected (unfortunately my router is far from my PC, so I don’t have access to UART when Ethernet is connected)

I’ll manually enable SSH to be able to access remotely when connected to Ethernet

@Darmur - sorry for the ambiguity - no Volumio won’t work on the pi0 yet - the nodeJS version is not the right version for armv6.
However, the base debian system should be all setup and working. I did create a few helpers to get a headless setup up and running, from where we can run a quick script to grab the right node binaries. Similar to Raspbian, if you have a /boot/wpa_supplicant.conf file, it will set up your wireless using that.

Else, let me build a test image with proper node binaries for you later this evening…

perfect, I’ll leave the setup as-it-is for further testing.

In the meanwhile I’ve manually enabled SSH and now I have remote connection via Ethernet. I have internet access as well.

Super, I made a quick script to grab the right nodeJS version for you - so don’t have to build a new image…

gist.github.com/ashthespy/5b86d … 94ec1884cd
let me know if that works :slight_smile:

The UI should then come up with systemctl restart volumio
do check your logs for more issues journalctl -f

The hotspot stuff still needs some tweaking – largely untested but you can try
gist.github.com/ashthespy/13333 … 8462cd7bf2

I’ve tried your script, I get some errors

volumio@volumio:~$ wget https://gist.githubusercontent.com/ashthespy/5b86da9f0144ffa4af7efe94ec1884cd/raw/42733f445bc05d5e513b7cb8713dd1b5d1fda0ec/setupBusterarmv6.sh                                         --2020-05-16 19:14:42--  https://gist.githubusercontent.com/ashthespy/5b86da9f0144ffa4af7efe94ec1884cd/raw/42733f445bc05d5e513b7cb8713dd1b5d1fda0ec/setupBusterarmv6.sh
Resolving gist.githubusercontent.com (gist.githubusercontent.com)... 151.101.36.133
Connecting to gist.githubusercontent.com (gist.githubusercontent.com)|151.101.36.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1190 (1.2K) [text/plain]
Saving to: ‘setupBusterarmv6.sh’

setupBusterarmv6.sh.1                               100%[==================================================================================================================>]   1.16K  --.-KB/s    in 0s

2020-05-16 19:14:43 (2.60 MB/s) - ‘setupBusterarmv6.sh’ saved [1190/1190]

volumio@volumio:~$ chmod a+x setupBusterarmv6.sh
volumio@volumio:~$ sudo ./setupBusterarmv6.sh
Running Volumio Buster 3.006 patch script
Check for pi0/pi1
Proceeding fetchiing node for
Installing Node v12.16.3-linuex-armv6l
Downloading from https://unofficial-builds.nodejs.org/download/release/v12.16.3/node-v12.16.3-linux-armv6l.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.4M  100 20.4M    0     0   937k      0  0:00:22  0:00:22 --:--:-- 1241k
tar:  --strip-components=1 --exclude ./CHANGELOG.md --exclude ./README.md --exclude ./LICENSE -C /usr: Not found in archive
tar: Exiting with failure status due to previous errors
volumio@volumio:~$

I manually executes the step that gives problems, it went fine

volumio@volumio:~$ sudo tar -xf node-v12.16.3-linux-armv6l.tar.gz --strip-components=1 --exclude ./CHANGELOG.md --exclude ./README.md --exclude ./LICENSE -C /usr
volumio@volumio:~$ sudo systemctl restart volumio

After that UI loaded fine with initial setup and also after reboot
rpi0.PNG.jpg

I did some more testing:

  • I can connect to my WiFi network, wpa_supplicat.conf is generated properly, but after reboot connection is lost, it does not connect automatically to the network
  • GPIO Buttons and GPIO Control plugins can be installed but can’t be enabled
  • Spotify plugin works fine
  • Spotify Connect2 plugin can be installed and enabled
  • Rasampling to fixed frequency works fine

Ah, I see the error, will fix it…

Hmm, can you check with journactl for logs to figure out what is happening?

That is expected, as on/off is a native module that will have to be rebuilt for the node version in Buster. It’s trivial, but mundane work that the plugin author has to do…

Nice! Thanks for testing!

here the requested dump from journalctl and ifconfig
dump.zip (30.7 KB)

The hotspot stuff is messing with your WiFI config…
Could you try running these commands that tries to incorporate @mike42’s tweaks?

echo "Stopping running services"
systemctl stop dnsmasq
systemctl disable dnsmasq
systemctl stop hostapd
systemctl disable hostapd

# Hostspot tweaks
echo "Switching from dhscpd to dnsmasq for hotspot"
sudo apt-get purge isc-dhcp-server -y
sudo rm /lib/systemd/system/dhcpd.service
echo "Switching from custom hotspot to hostapd"
sudo rm /lib/systemd/system/hotspot.service
# Switch hostspot to hostapd in back end
sed -i '/^var\ starthostapd.*/c var starthostapd = "systemctl start hostapd";' /volumio/app/plugins/system_controller/network/wireless.js
sed -i '/^var\ stophostapd.*/c var stophostapd = "systemctl stop hostapd";' /volumio/app/plugins/system_controller/network/wireless.js
sudo rm /bin/hotspot.sh
systemctl restart volumio

I’ve applied the sequence with a .sh script, everything was executed properly.

After reboot, WiFi is still not connecting automatically. Attached new dump from journalctl
dump.zip (18.2 KB)