I2C Communication with Repetier-Server?
Good Evening,
I'm using Repetier-Server on a Raspberry Pi 4 with a voron2.4 and klipper.
Works good so far!
I have attached a MCP23017 to the Raspberry Pis I2C Bus to expand some buttons and signal LEDs. I can read the buttons and switch the LEDs on and off via a python script.
How can I now communicate with repetier server to initiate actions on button press or show a specific status on the I2C connected LEDs?
How can I execute GCodes?
In principle it should be the same as with GPIO pins action. The difference is the I2C Bus which serves the data, not a specific pin.
Any idea to implement this? Perhaps reading the content of a specific fifo?
Any help would be appreciated
Comments
https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/unixsockets
on how to send api commands. Example is sending a gcode to printer, but same logic can be used to send any command available in the interface as described in api documentation.
https://www.repetier-server.com/startup-configuration/
for possible locations. Filename in database directory is RepetierServer.xml and if you do not have it just use that one in socket doc.
As long as you only want to send something it is enough to send the data to socket and close it. Only when you want to minitor server with it and you need answers or events you must read the answers and match them to send commands or events.
sudo service RepetierServer restart
RepetierServer-extra.xml
should that be.
echo G28 > /var/lib/klipper/sockets/SLUGNAME
echo LIGHTON > /var/lib/klipper/sockets/SLUGNAME