pi-Stomp > Hacking pi-Stomp

Using the RPi "Official" 7" Touchscreen?

(1/3) > >>

ElRay70K70H:
Has anybody looked at using the official RPI 7" touchscreen instead of the default LCD hat/shield? Is the code that manages the display easily accessible, so it can be modified to run on a different screen?

Randall (Admin):
I haven't.  I'm assuming you mean one like this:
https://www.adafruit.com/product/2718?gclid=Cj0KCQjw4uaUBhC8ARIsANUuDjUZDxhXH0tgXlQYRn1EQCUKkT3u392mCkQDLmW9uPIJsQiC1x9mMHkaAsRlEALw_wcB

that connects to the DSI display port.  I'm 99% sure that would work just fine.  You could use the MOD web UI (via a web browser on the display) to control everything MOD related.

Now would it display the same as the LCD?  No.  An LCD (multiple are supported) connects via SPI (4-wire interface) and is managed by the pi-Stomp code.  There's no "Display App" that you'd need for such things to display on the DSI display.  But, other than a few things like footswitches, analog knobs and system settings, the LCD is basically a mini representation of the MOD UI.  So why not just use the MOD UI?  You would have to do system management via ssh or maybe create a pi-Stomp management app.  Might not be too difficult to create such a thing.



ElRay70K70H:

--- Quote from: Randall (Admin) on June 03, 2022, 04:59:27 PM ---I'm assuming you mean one like ...
--- End quote ---
Yup.  That's the one.
--- Quote from: Randall (Admin) on June 03, 2022, 04:59:27 PM ---... So why not just use the MOD UI? ...
--- End quote ---
Because it's a (relatively) tiny 7" screen. I can connect via HTTPS with a laptop or desktop to hit the full UI, but I was thinking of a small, self-contained unit (like a Pod Bean) with a minimal (colored boxes = buttons) interface:
* Current Pedalboard
* Current Snapshot
* Next/Previous Pedalboard
* Next/Previous Snapshot
* XRUNS
* %CPU
* %RAM
--- Quote from: Randall (Admin) on June 03, 2022, 04:59:27 PM ---You would have to do system management via ssh or maybe create a pi-Stomp management app.  Might not be too difficult to create such a thing.
--- End quote ---
Right.  The hooks have to be there somewhere. I figure I could write a Python UI, or even a minimal version of the stock UI that is just a <table> with a bunch of rectangles that respond to being tapped.

Randall (Admin):
Other than the performance stats, that's less than what the 2.4" LCD shows.  I guess you just want it bigger?

Hooks?  Well kinda.  MOD's API is only partially complete:

https://github.com/moddevices/mod-ui/blob/master/mod/webserver.py#L2146

Their hardware (Mod Dwarf, Mod Duo, etc.) communicates to mod-host/mod-ui via an exclusive web-socket interface.  I could have possibly taken that route, but the software assumes a lot about the hardware and I thus I would have had to fork the code.  I realized I could get most of what I needed from the API, so I just extended it (by appending endpoints) for the extras I needed (plugin parameter get/set, etc.)

From your list, the missing API's are Current Snapshot, XRUNS, %CPU and %RAM.  Current Snapshot has been on my ToDo list for a while, currently, pi-Stomp is able to get the list of Snapshots and change the Snapshot, so when you change pedalboards, it just sets the Snapshot to the first one (index 0).   That works for most situations except when you change the Snapshot via the MOD UI, it doesn't track on the LCD.

Similar to the endpoints I add, it may be possible to add the ones you want (XRUNS, CPU, RAM, etc.).  Realtime polling could become a CPU suck, but if you maybe just polled once/second and got all that data at once, it might not be too bad.

For system management, you could pilfer what is coded here:
https://github.com/TreeFallSound/pi-stomp/blob/master/modalapi/mod.py#L750

FWIW, there is a pi-Stomper that's been working on a re-write of the LCD/Navigation code.  That will make it somewhat easier to support alternative LCD's and add pages, controls, etc.  The existing LCD code and the re-write use the Pillow (PIL fork) module for graphics.  I suppose it's possible that the rendering methods could be altered to render via the DSI port instead of SPI.  In that sense your 7" could be just another LCD subclass.  You probably want touch control though, not encoder.  That wouldn't be a simple subclass since the behavior of touch navigation is very different that encoder (scroll navigation).


ElRay70K70H:

--- Quote from: Randall (Admin) on June 05, 2022, 12:53:55 AM ---Other than the performance stats, that's less than what the 2.4" LCD shows.  I guess you just want it bigger? ...
--- End quote ---
It's a combination of using what I have, and not using the pi-Stomp code.  I started with the Blokas MODEP, but they've fallen behind 1xOS and 2xMOD versions behind, so I'm starting with vanilla MOD-Host and MOD-UI code bases.  Somebody on the Blokas Forums pointed me over here.

This:
--- Code: ---https://github.com/moddevices/mod-ui/blob/master/mod/webserver.py#L2146
--- End code ---
and this:
--- Code: ---https://github.com/TreeFallSound/pi-stomp/blob/master/modalapi/mod.py#L750
--- End code ---
are huge helps.

Thanks.

Navigation

[0] Message Index

[#] Next page

Go to full version