Shutdown from device screen?

I’m bothered by the lack of a shutdown button on the screen. I haven’t been able to find where the display is run from to look at adding one. Has anyone poked at this yet?

1 Like

I don’t if it’s the answer you are waiting for, but there is a button to cancel your print at any time.

I see that button. I mean the equivalent of the power icon in the upper-right corner of Mainsail and choosing the Shutdown option or running ‘poweroff’ via ssh. I’m looking to have it do an orderly shut down of the Debian OS rather than just killing power to it, which seems likely to mess something up if done regularly.

Ok, you’re right.
There’s no such button on the screen but you have it if you use the web browser on your smartphone.
I agree, that it’s not the same thing, just a workaround.

Yup, that’s what I’ve been doing.

1 Like

The problem is that the display software is from MKS and not open source. This makes customization impossible. Unfortunately, we have already complained about this problem elsewhere. Whether Sovol lets MKS change it, depends on how many problems still arise with it. Perhaps a list should be made.

It’s a good idea.
You should open a new thread about this.

Maybe I can just make a usb-connected button that triggers a shutdown… that could be a fun little project.

Yes, but how to reach the display if the software is not open.

I wouldn’t need to reach the display, just need a physical button connected to one of the USB ports either as a HID device or a serial device and the associated config/script listening to it in linux then triggering a shutdown or poweroff command. It’s overkill, but I have an arduino nano around here someplace I could probably use for it.

A kind of “sudo halt” triggered by a hard button connected to a USB port?

Yeah, but rather than having to connect it to an open shell, I think I’m going to remap ctrl-alt-del from reboot to poweroff and just have it send that. I ordered an arduino pro micro instead of using the nano because it has a HID mode.

1 Like

@sovol3d
Don’t you think it will be important to add a shutdown button on the display of the SV06 ACE ?

So just plugging in a usb keyboard and sending ctrl+alt+del didn’t work, I guess because there isn’t a getty listening on that, which I should’ve thought of. While looking into how to make something listen on that, I instead discovered that /dev/input/event0 is connected to the touchscreen. I can’t mess with what’s on the screen, but I can snoop events from it… so I came up with this python script. If I tap the -15 on the temperature graph 5 times in under 3 seconds, it triggers a shutdown. It doesn’t have to be on that screen, it’s just that little zone of the screen for the tapping.

I had to apt-get install python3-evdev

I set this to run by adding this before the “exit 0” in /etc/rc.local:
/root/readscreen-poweroff &

The script at /root/readscreen-poweroff is:

#!/usr/bin/python3

import evdev
from evdev import InputDevice, ecodes, categorize
from datetime import datetime
from os import system
from time import sleep

touchscreen = InputDevice('/dev/input/event0')

timestart = datetime.now()
n = 0
x = -1
y = -1
# Read events from the touchscreen
try:
    for event in touchscreen.read_loop():
        if event.type == ecodes.EV_ABS:
            if event.code == ecodes.ABS_X:
                x = event.value
            elif event.code == ecodes.ABS_Y:
                y = event.value

        elif event.type == ecodes.EV_KEY:
            if( event.code == ecodes.BTN_TOUCH and event.value != 1 ):
                if( y < 30 and x >= 350 and x <= 400 ):
                    n += 1

                if( n >= 5 and (datetime.now() - timestart).seconds <= 3 ):
                    system("/usr/sbin/poweroff")
                    n = 0

                if( n == 0 or (datetime.now() - timestart).seconds > 3 ):
                  n = 0
                  timestart = datetime.now()
         
                # print("Touch at:", x, y)

except KeyboardInterrupt:
    print("Exiting...")
finally:
    touchscreen.close()

Not a perfect solution, but it’s a good enough hack for me until there’s something better.

3 Likes

Thanks all for sharing! I will give feedback the R&D

3 Likes