GeekFunkLabs / squishbox

Software and design files for a Raspberry Pi sound module enclosure
20 stars 3 forks source link

Installation breaks network connections #18

Open albedozero opened 2 months ago

albedozero commented 2 months ago

Another feedback, by installing the web file uploader, the service wouldn't start because it needed "nmcli":

aoû 07 17:22:22 raspberrypi systemd[1]: Started SquishBox.
aoû 07 17:22:25 raspberrypi squishbox.py[489]: /bin/sh: 1: nmcli: not found
aoû 07 17:22:26 raspberrypi squishbox.py[379]: Traceback (most recent call last):
aoû 07 17:22:26 raspberrypi squishbox.py[379]:   File "/home/pi/squishbox.py", line 1101, in <module>
aoû 07 17:22:26 raspberrypi squishbox.py[379]:     sb = SquishBox()
aoû 07 17:22:26 raspberrypi squishbox.py[379]:   File "/home/pi/squishbox.py", line 123, in __init__
aoû 07 17:22:26 raspberrypi squishbox.py[379]:     self.wifi_state()
aoû 07 17:22:26 raspberrypi squishbox.py[379]:   File "/home/pi/squishbox.py", line 589, in wifi_state
aoû 07 17:22:26 raspberrypi squishbox.py[379]:     state = 'on' if self.shell_cmd("nmcli radio wifi") == 'enabled' else 'off'
aoû 07 17:22:26 raspberrypi squishbox.py[379]:   File "/home/pi/squishbox.py", line 553, in shell_cmd
aoû 07 17:22:26 raspberrypi squishbox.py[379]:     return subprocess.run(cmd, check=True, stdout=subprocess.PIPE, shell=True,
aoû 07 17:22:26 raspberrypi squishbox.py[379]:   File "/usr/lib/python3.9/subprocess.py", line 528, in run
aoû 07 17:22:26 raspberrypi squishbox.py[379]:     raise CalledProcessError(retcode, process.args,
aoû 07 17:22:26 raspberrypi squishbox.py[379]: subprocess.CalledProcessError: Command 'nmcli radio wifi' returned non-zero exit status 127.
aoû 07 17:22:26 raspberrypi systemd[1]: squishbox.service: Main process exited, code=exited, status=1/FAILURE
aoû 07 17:22:26 raspberrypi systemd[1]: squishbox.service: Failed with result 'exit-code'.
aoû 07 17:22:26 raspberrypi systemd[1]: squishbox.service: Consumed 1.387s CPU time.
aoû 07 17:22:26 raspberrypi systemd[1]: squishbox.service: Scheduled restart job, restart counter is at 1.
aoû 07 17:22:26 raspberrypi systemd[1]: Stopped SquishBox.
aoû 07 17:22:26 raspberrypi systemd[1]: squishbox.service: Consumed 1.387s CPU time.

Keep in mind my RPi originally is Raspbian with Pi-Hole (DNS adblocker for my home, and as it happens DCHP too).

I fixed by installing network-manager. It then started. But then when I restarted my RPI. My whole network broke.. Because my RPi is used a DCHP server (giving IPs to everyone), but network-manager took over the /etc/dhcpcd.conf (static IP for the PI), and then it wouldn't get an IPv4 address anymore, and other devices couldn't find RPi. Which drove me crazy. Solution was using network-manager utility to set the same IP/DNS/Subnet configuration as in the /etc/dhcpcd.conf file, by typing: sudo nmtui and visually configuring.

Then after a restart everything now works as expected on startup. Phew ! Thank you.

Originally posted by @Pauldb8 in https://github.com/GeekFunkLabs/squishbox/issues/16#issuecomment-2275084678

albedozero commented 2 months ago

Thanks for noticing this. The installer script installs network-manager so that a user can turn the wifi on/off with the SquishBox. If you're not already using networkmanager that breaks your config. This little shell-script installer can't handle every possible configuration a user might already have on their Pi, but I will add a warning in the installer, (or maybe just skip it for the naked Pi synth) since that has a high potential to break things.