Add buttons to send comands to pi

What is the problem?

i want to add a button

What did you already try to solve it?

tried plugins

Have you tried running in safe mode?

no

Did running in safe mode solve the problem?

no

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

WRITE HERE

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

i have tried the usb relay plugin i cant get it to work so i am looking for a way of adding a button to the top bar etc to send comands to the pi ie-
to open relay
echo -e '\xA0\x01\x01\xA2' > /dev/ttyUSB0

and to close it
echo -e '\xA0\x01\x00\xA1' > /dev/ttyUSB0

any help would be much apreciated
thanks
martin

i did try adding this to the config yaml with no luck
system:
actions:

  • action: relayonoff
    command: echo -e '\xA0\x01\x01\xA2' > /dev/ttyUSB0
    confirm: false
    name: turn relay on
  • action: relayoff
    command: echo -e '\xA0\x01\x00\xA1' > /dev/ttyUSB0
    confirm: false
    name: turn relay off

sorted it
just added

  • action: relayonoff
    command: sudo echo -e '\xA0\x01\x01\xA2' > /dev/ttyUSB0
    confirm: false
    name: turn relay on
    • action: relayoff
      command: sudo echo -e '\xA0\x01\x00\xA1' > /dev/ttyUSB0
      confirm: false
      name: turn relay off

to the config yaml.

hope it helps someone else

martin

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.