Is this possible: call a Zynthian-UI modal with command line through ssh

As usual, they are troubles to get these cheap chinese 3.5 inch touch LCD to work correctly:

So here, my touch interface is swapped,

They are no knobs, so it’s quiet impossible using touchscreen to access the admin->touchscreen calibration tool.

I have tried to open the touchscreen calibration modal from the command line.

Using these commands, with or without a running zynthian-ui:

root@zynthian:/zynthian/zynthian-ui# DISPLAY=:0 python3 -c '
import zyngui as zyngui;
import zyngui.zynthian_gui_touchscreen_calibration as zynthian_gui_touchscreen_calibration ;
zynthian_gui_touchscreen_calibration
'

doesn’t have any effect. While

root@zynthian:/zynthian/zynthian-ui# DISPLAY=:0 python3 -c '
import zyngui as zyngui; 
import zyngui.zynthian_gui_touchscreen_calibration as zynthian_gui_touchscreen_calibration ;
zynthian_gui_touchscreen_calibration.show
'

Here it complains about: “AttributeError: module ‘zyngui.zynthian_gui_touchscreen_calibration’ has no attribute ‘show’”

You can plug a computer keyboard in then use key binding to drive the device. Or you can enable VNC via webconf and drive it from a mouse / keyboard.

I have tried with the mouse plugged in, or via VNC but it’s erratic too. :frowning:
Even if I manage to highlight the needed item, the onclik action always activate the first item in the list (eg: New layer and not admin menu, ZY instrument and not LinuxSampler, Arpeggio and not bass, Arpeggio1 and not arpeggio6 …)

I’ve tried pretty much every mechanism I can think of (mouse,keyboard,arduino encoder, stylus, mouse wheel) but the selected item returns to the top of the list at the first opportunity and will select it if any press is detected.

I’m not sure what you are describing. Will you give a simple, step-by-step example of just one of these failing procedures?

Sorry.

I was troubleshooting screen issue recently and plugged a mouse in.

I also couldn’t get Zynthian to register mouse clicks properly until I started to click and hold for a second,

Then it correctly registers the press for the selected menu item.

I am not seeing the erratic mouse / first selection behalf described. Will someone experiencing this please post their config details?

Thank you Brian for investigating.

I’ve modified the topic title and reformatted the first post.
Cause, in fact, it’s a more general python tip I would lIke to learn :wink:

We already have an active discussion about these cheap displays

Cheers

Hi @le51

Anything is possible… nothing is easy!!! :wink:

There are a lot of things going on within the Zynthian software with various classes, inheritance, etc. It relies heavily on its shell environment. Cherry-picking individual parts of the code to run, although possible is rather challenging and I doubt the effort in working out what can / can’t / should / shouldn’t be done is worth our time investigating. What might be more useful is being able to run Zynthian normally and triggering navigation via remote commands. This is partially implemented via CUIA:

		"80": "SCREEN_MAIN",
		"81": "SCREEN_ADMIN",
		"82": "SCREEN_AUDIO_MIXER",
		"83": "SCREEN_SNAPSHOT",
		"84": "SCREEN_AUDIO_RECORDER",
		"85": "SCREEN_MIDI_RECORDER",
		"86": "SCREEN_ALSA_MIXER",
		"87": "SCREEN_STEPSEQ",
		"88": "SCREEN_BANK",
		"89": "SCREEN_PRESET",

As you can see, not all screens are implemented and not the calibration that you wanted. You could submit a feature request to add more screens or maybe implement something more generic, e.g. SHOW_SCREEN .

For this particular use-case we might want to consider a mechanism for accessing the calibration screen when other controls are absent. I still favour use of VNC to do a one-time configuration. As requesting above (and maybe needs to be requested in other thread) I haven’t seen the behaviour that has triggered this request so maybe a bug report detailing that would be useful to facilitate investigation.

I worry that we may be trying to fix the wrong thing here. Accessing screens via ssh may have other benefits but I am not sure if the benefit warrants the effort to implement.

Thanks again,
It’s mostly for learning&debugging purpose here…

I’m still discovering python

Regarding the touch screen calibration tool modal: it’s a nice feature to be able to launch it via the web interface or via the command line when everything is a big mess on touch screen.

I will consider opening a [NFR] but I would be much more satisfied if I learn how to code it by myself :wink:

I tend to do both. Raise a request / bug so the detail is recorded then I may assign to myself if I am working on a solution (or make a note in the ticket). The process of reporting it focuses the mind and draws out detail. It also ensures the issue is recorded.

The easiest way of calling zynthian UI modals & screens from command line is using OSC CUIA like this:

# send_osc 1370 /CUIA/SCREEN_MAIN

as explained in the wiki:

https://wiki.zynthian.org/index.php/Accessing_Zynthian_from_your_computer#CUIA:_Callable_User_Interface_Actions

Regarding the CUIA list, you can try the wiki’s list :

https://wiki.zynthian.org/index.php/Zynthian_UI_Users_Guide#CUIA:_Callable_UI_Actions

but it’s not updated to the last, specially if you are using the testing branch. In this case, you will find the updated list of CUIA in the source code:

Enjoy!