This is a 3D printable PSU cover for the Creality Ender-3 to also contains a Sonoff Basic R3 to command the power by WiFi.
A good option is to flash the Sonoff to use Tasmota instead of the native software. Then you can shutdown the printer when shutting down the linked Octopi by installing the poweroff service.
This object can also be found on Thingiverse. The mock for the Sonoff can be found on Thingiverse too.
power_off and [power-off.service] files can be used to power off the printer when powering off the Raspberry Pi if you installed Tasmota on your sonoff.
ATTENTION: The sonoff needs to be configured without authentication, which is safe, only if the subnetwork you are in is safe. With that setting everybody on the sonoff network can reconfigure the sonoff as well as turn it on/off.
To install this service:
- Install curl:
sudo apt install curl
- Copy power_off to
/usr/local/bin
and set it to executable:sudo curl -L https://github.com/damienmg/ender3_control_box/raw/master/psu_sonoff_cover/power_off -o /usr/local/bin/power_off; sudo chmod +x /usr/local/bin/power_off
, - Copy power-off.service to
/etc/systemd/system
:sudo curl -L https://github.com/damienmg/ender3_control_box/raw/master/psu_sonoff_cover/power-off.service -o /etc/systemd/system/power-off.service
, - Edit
/usr/local/bin/power_off
(e.g. bysudo nano /usr/local/bin/power_off
) and replaceADDR=0.0.0.0
with your Sonoff IP address (e.g. byADDR=192.168.42.42
), and - Setup the service with
systemctl enable power-off
.