Hello,
I'm new to OctoPrint and Raspberry Pi and was working with Windows only till now.
First of all I'm very impressed about functionality out of the box. Installation, controlling the printer, connecting a webcam and VPN access via Android-App, everything is working out of the box.
I'm searching for a solution since hours but didn't manage to find the solution.
My goal is to be able to switch on/off the printer and the LED-Light. I found 2 very old RC sockets in the cellar and bought a cheap 433 MHz transmitter/receiver (β¬ 2,50) to control them. I'm aware that using a relais or a sonoff are better options but currently I want to get it run!
What I was able to to:
Install the sender and temporarly receiver to the PI via GPIO
Via Putty:
Installed WiringPi
Installed 433Utils
Via ./RFSniffer I found out that each socket is using only 1 code with 6 digits for on/off. (When the socket is connected to power it's generally off.)
Via ./codesend I was able to switch them on/off via the sniffed code.
At this point the descriptions I found ended or were outdated and didn't work with plugins in OctoPrint (e.g. System Command Editor). That means I were not able to manage to transfer those functions or commands from the command mode to the web interface of OctoPrint.
How can I manage to:
Be able to send the command ( /433Utils/RPi_utils/codesend 123456 ) to switch on/off one the sockets?
If possible add a button (green/red) counts and shows that the status is on or off? ( I know that the switching process is not in control because the receiver (socket) gives no feedback).
I'm not sure if this is manageable via programming or plugin so I used "General" as category.
My equipment:
Sovol SV01
Raspberry Pi 4 with latest Octoprint Version
Logitech C310 webcam
FS1000A transmitter, using GPIO17
I hope my Englisch is good enough to understand what I want to do.
Typically in the Python world, the projects tend to fight with each over over their dependencies. This one requires a particular version of whatever and that one requires a different version.
So you'll see instructions which include virtualenv to create a new "code space", if you will. OctoPrint runs from a virtual environment called ~/oprint. When you do any pip install ... types of commands you're expected to have first:
source ~/oprint/bin/activate
# Do stuff
deactivate
...so that you'll be installing the new stuff within that folder structure. Technically, the new stuff lands here: ls -lt ~/oprint/lib/python2.7/site-packages.
The pip freeze command will report back what is currently installed at your level. So if you haven't activated that virtual environment as described before and run pip freeze you're going to see what's installed for Python 2 at the global level. Repeat that using pip3 freeze and you'll see what's installed for the Python 3 platform at the global level.
Next, activate the virtual environment and repeat the pip freeze command. You should see octoprint of course.