Skip to content

Octoeverywhere on Sonic Pad

While Octoeverywhere officially supports the sonic pad, there's a few small issues if you only want to use the pad to host connectors and aren't actively controlling the printers vai the pad.

Enabling root access

On the pad, tap Setup on the top left, then Advanced options -> Root Account.
Scroll to the bottom, check the checkbox, and wait 30 secons for Next Step button.

The account and password will be displayed, in theory it's

root
cxsw-sonic_2023

Ensure the pad is connect to your network Network settings -> Wireless/Wired network, note down the IP address

Connecting via ssh

In terminal/powershell connect with the command

ssh -oHostKeyAlgorithms=+ssh-rsa -oMACs=+hmac-sha1 root@IP_Address

Note

if the account displayed when enabling roo access isn't root, replace root with the actual username

Installing Octoeverywhere

Clone the repo to the correct location

cd /usr/share
git clone https://github.com/QuinnDamerell/OctoPrint-OctoEverywhere octoeverywhere

Depending on which type of printer you would like to connect to, the install command will be slightly different

Printer type Command
Bambu printers ./install.sh -bambu
Remote Klipper/Moonraker printer ./install.sh -companion
Elegoo Centauri Carbon or CC2 ./install.sh -elegoo
PrusaLink printer ./install.sh -prusalink
Printer directly controlled by the Sonic Pad ./install.sh
Installer failed?

If you're trying to install for bambu or elegoo and getting an error like

Installer failed - The OctoEverywhere companion can only be installed on Debian based operating systems.

Stack Trace:
Traceback (most recent call last):
File "/usr/share/octoeverywhere/py_installer/Installer.py", line 27, in Run
    self._RunInternal()
File "/usr/share/octoeverywhere/py_installer/Installer.py", line 144, in _RunInternal
    context.Validate(2)
File "/usr/share/octoeverywhere/py_installer/Context.py", line 210, in Validate
    raise Exception("The OctoEverywhere companion can only be installed on Debian based operating systems.")
Exception: The OctoEverywhere companion can only be installed on Debian based operating systems.
You'll need to modify the installer script slightly. Run the following command:
sed -i 's/if self\.OsType != OsTypes\.Debian:/if self.OsType != OsTypes.Debian and self.OsType != OsTypes.SonicPad:/' py_installer/Context.py
Then run the install command again.

I've already submitted this revision as a PR to the main repo

Checking for overload

When the printer are active and there are streams, check how much RAM is left using the command free it will report something like:

total used free shared buffers cached
Mem: 2030720 1288216 742504 17264 141376
-/+ buffers/cache: 761976 1268744
Swap: 0 0 0

check the buffer/cache to ensure the free column still have enough free RAM left (the unit is in kb)

Local MQTT relay

If you have multiple printers, they might all default to the same port for the relay, run this command to check

grep -H -E 'LocalTcpBrokerServer (listening|failed to start)' /usr/share/.octoeverywhere-*/logs/octoeverywhere.log*
If the most recent timestamp say something like ERROR - LocalTcpBrokerServer failed to start on 0.0.0.0:1883 - [Errno 98] Address already in use then you'll have to configure the ports.

Identify your printer using the command

for f in /usr/share/.octoeverywhere-bambu*/octoeverywhere.conf
do
    echo
    echo "$f"
    grep -E '^(ip_or_hostname|printer_serial_number)[[:space:]]*=' "$f"
done
This'll output something like
/usr/share/.octoeverywhere-bambu-4/octoeverywhere.conf
ip_or_hostname = 192.168.1.17
printer_serial_number = <redacted>

/usr/share/.octoeverywhere-bambu/octoeverywhere.conf
ip_or_hostname = 192.168.1.14
printer_serial_number = <redacted>

Based on this you should be able to identify which config file corresponds to which printer. Set the port for each printer using the command:

sed -i '/^\[mqtt\]/,/^\[/{s/^port[[:space:]]*=.*/port = 1883/;}' /usr/share/.octoeverywhere-bambu/octoeverywhere.conf

*Adjust port number and conf file path as needed

Restart the connector with the command

for s in /etc/init.d/octoeverywhere*
do
    "$s" restart
done

instead of checking logs to see if the relay is open, you can also use the command netstat -lntp 2>/dev/null to check if your specified port is being used, ie for port 1883 you'll see:

tcp     0       0 0.0.0.0:1883   0.0.0.0:*      LISTEN   8158/python3

you can also use the netstat command to ensure you're not assigning the relay to a port that's already being used.

Restrict relay access

If you don't need to have relay access via other devices, ie: home assistant, you can restrict the relay access to only the sonic pad, so only scripts and programs running on the sonic pad can access the relay.

# change 0.0.0.0 to 127.0.0.1 (loopback) 
for f in /usr/share/.octoeverywhere-bambu*/octoeverywhere.conf
do
    sed -i '/^\[mqtt\]/,/^\[/{s/^bind_ip[[:space:]]*=.*/bind_ip = 127.0.0.1/;}' "$f"
done

# restart the services
for s in /etc/init.d/octoeverywhere*
do
    "$s" restart
done