Move UI to Go #42

Closed
opened 2020-08-27 14:22:05 +00:00 by kemonine · 8 comments
Owner

The main UI for switching albums, reboot, poweroff, debug info needs to be re-written in Go.

Comments are a bit of a stream of consciouness as @kemonine works through the problem.

Current theory of operation

  • Go tcell/tview/cview main UI
  • UI spawns fim and handles ctrl-c or similar for killing FIM and entering config UI
  • Config ui has options for above and wifi config
  • Monit needs to be updated to monitor for the UI process and NOT fim, ui should handle ensuring fim is active and online
  • FIM should be re-worked to have a smaller fimrc (since it won't have access to the keyboard driect, that's the UI's job)
  • FIM should be re-worked so the UI handles the timeout for the slideshow via config / online changes
The main UI for switching albums, reboot, poweroff, debug info needs to be re-written in Go. Comments are a bit of a stream of consciouness as @kemonine works through the problem. Current theory of operation - Go tcell/tview/cview main UI - UI spawns fim and handles ctrl-c or similar for killing FIM and entering config UI - Config ui has options for above and wifi config - Monit needs to be updated to monitor for the UI process and NOT fim, ui should handle ensuring fim is active and online - FIM should be re-worked to have a smaller fimrc (since it won't have access to the keyboard driect, that's the UI's job) - FIM should be re-worked so the UI handles the timeout for the slideshow via config / online changes
kemonine added the
enhancement
help wanted
labels 2020-08-27 14:22:10 +00:00
kemonine added this to the Future milestone 2020-08-27 14:22:12 +00:00
Author
Owner
apt install build-essential
git clone --depth 1 https://github.com/raspberrypi/firmware
cd firmware
cp -rv opt/vc /opt
cd ..
git clone https://github.com/raspberrypi/userland
cd userland
./buildme --aarch64
cd ..
git clone https://github.com/raysan5/raylib.git
cd raylib/src
make PLATFORM=PLATFORM_RPI
make PLATFORM=PLATFORM_RPI install
cd ../examples
make PLATFORM=PLATFORM_RPI
``` apt install build-essential git clone --depth 1 https://github.com/raspberrypi/firmware cd firmware cp -rv opt/vc /opt cd .. git clone https://github.com/raspberrypi/userland cd userland ./buildme --aarch64 cd .. git clone https://github.com/raysan5/raylib.git cd raylib/src make PLATFORM=PLATFORM_RPI make PLATFORM=PLATFORM_RPI install cd ../examples make PLATFORM=PLATFORM_RPI ```
Author
Owner
https://github.com/veandco/go-sdl2
Author
Owner

Use framebuffer + joystick/buttons

Need to figure out how to leverage framebuffer as a UI ; there appear to be go libs but they are not clear on how to work with the fb for text.

https://github.com/warthog618/gpio
https://github.com/warthog618/gpiod
https://www.adafruit.com/product/512
https://www.adafruit.com/product/504
https://www.adafruit.com/product/4697
Use framebuffer + joystick/buttons Need to figure out how to leverage framebuffer as a UI ; there appear to be go libs but they are not clear on how to work with the fb for text. https://github.com/warthog618/gpio https://github.com/warthog618/gpiod https://www.adafruit.com/product/512 https://www.adafruit.com/product/504 https://www.adafruit.com/product/4697
Author
Owner
chvt 1
exec </dev/tty1 >/dev/tty1 2>/dev/tty1
ALBUM_PATH=`cat /etc/default/fim_album`
# options inspiration: https://www.raspberrypi.org/forums/viewtopic.php?t=196043
tput civis
``` chvt 1 exec </dev/tty1 >/dev/tty1 2>/dev/tty1 ALBUM_PATH=`cat /etc/default/fim_album` # options inspiration: https://www.raspberrypi.org/forums/viewtopic.php?t=196043 tput civis ```
kemonine modified the milestone from Future to Initial Stable Deployment 2020-08-28 16:46:00 +00:00
Author
Owner
apt install fonts-ubuntu-console
root@piframe:/home/ubuntu# cat /etc/default/console-setup
# CONFIGURATION FILE FOR SETUPCON

# Consult the console-setup(5) manual page.

ACTIVE_CONSOLES="/dev/tty[1-6]"

CHARMAP="UTF-8"

CODESET="Uni2"
#FONTFACE="UbuntuMono-R"
FONT="UbuntuMono-R-8x16.psf"
FONTSIZE="36x72"

VIDEOMODE=

# The following is an example how to use a braille font
# FONT='lat9w-08.psf.gz brl-8x8.psf'

update-initramfs -u
systemctl reboot


echo 2 > /sys/class/graphics/fbcon/rotate_all 
mkdir /etc/systemd/system/getty@tty1.service.d/
/etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/tank/scratch/tview/test.local
StandardInput=tty
StandardOutput=tty
systemctl daemon-reload; systemctl restart getty@tty1.service
``` apt install fonts-ubuntu-console root@piframe:/home/ubuntu# cat /etc/default/console-setup # CONFIGURATION FILE FOR SETUPCON # Consult the console-setup(5) manual page. ACTIVE_CONSOLES="/dev/tty[1-6]" CHARMAP="UTF-8" CODESET="Uni2" #FONTFACE="UbuntuMono-R" FONT="UbuntuMono-R-8x16.psf" FONTSIZE="36x72" VIDEOMODE= # The following is an example how to use a braille font # FONT='lat9w-08.psf.gz brl-8x8.psf' update-initramfs -u systemctl reboot echo 2 > /sys/class/graphics/fbcon/rotate_all mkdir /etc/systemd/system/getty@tty1.service.d/ /etc/systemd/system/getty@tty1.service.d/override.conf [Service] ExecStart= ExecStart=-/tank/scratch/tview/test.local StandardInput=tty StandardOutput=tty systemctl daemon-reload; systemctl restart getty@tty1.service ```
Author
Owner
# CONFIGURATION FILE FOR SETUPCON

# Consult the console-setup(5) manual page.

ACTIVE_CONSOLES="/dev/tty[1-6]"

CHARMAP="UTF-8"

CODESET="Uni2"
FONTFACE="Terminus"
FONTSIZE="32x16"

VIDEOMODE=

# The following is an example how to use a braille font
# FONT='lat9w-08.psf.gz brl-8x8.psf'
``` # CONFIGURATION FILE FOR SETUPCON # Consult the console-setup(5) manual page. ACTIVE_CONSOLES="/dev/tty[1-6]" CHARMAP="UTF-8" CODESET="Uni2" FONTFACE="Terminus" FONTSIZE="32x16" VIDEOMODE= # The following is an example how to use a braille font # FONT='lat9w-08.psf.gz brl-8x8.psf' ```
Author
Owner

/boot/firmware/cmdline.txt
fbcon=rotate:2

/boot/firmware/cmdline.txt fbcon=rotate:2
Author
Owner

Initial release of piframe go ui has been pushed to all appropriate repos

Initial release of piframe go ui has been pushed to all appropriate repos
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: PiFrame/piframe#42
No description provided.