Difference between revisions of "How to do things with the beaglebone"

From Steak Wiki
Jump to navigationJump to search
 
Line 6: Line 6:
 
  echo "hello" > /dev/tty0
 
  echo "hello" > /dev/tty0
 
to output to your ssh session, try  
 
to output to your ssh session, try  
  echo "hello> > /dev/tty</small>
+
  echo "hello" > /dev/tty</small>
 +
 
 +
These are serial output or char devices (as opposed to block which would be HDDs/flash (see a unix book)).
 +
 
 +
Access the char devices in /sys/dev/char
 +
These will be the same devices as in /dev
 +
but if you ls -l on /sys/dev/char you can get the path to the control / metadata of
 +
a given device. Such as you would expect to see when flashing a LED on/off via sys/fs.
 +
ref: https://elinux.org/EBC_Exercise_17_Switching_a_GPIO_to_an_LED#Setup and
 +
https://elinux.org/EBC_Exercise_17_Switching_a_GPIO_to_an_LED#Checking_.2Fsys.2Fclass.2Fleds
 +
 
 +
Going to /sys/dev/char is intuitive, and more so than /sys/class/whatever. But /sys/class has things
 +
that dev does not have, so you must remember /sys/dev/char and /sys/class for starters. This will get
 +
you access to hw control, afaik.
 +
 
 
====Output Video to TFT====
 
====Output Video to TFT====
 
<small>Download video from somewhere.
 
<small>Download video from somewhere.

Latest revision as of 04:23, 24 November 2022

Pocket Beagle

Output Text to TFT

This assumes you have the game boy tft shield. Although others that are supported and detected will likely work similarly.

echo "hello" > /dev/tty0

to output to your ssh session, try

echo "hello" > /dev/tty

These are serial output or char devices (as opposed to block which would be HDDs/flash (see a unix book)).

Access the char devices in /sys/dev/char These will be the same devices as in /dev but if you ls -l on /sys/dev/char you can get the path to the control / metadata of a given device. Such as you would expect to see when flashing a LED on/off via sys/fs. ref: https://elinux.org/EBC_Exercise_17_Switching_a_GPIO_to_an_LED#Setup and https://elinux.org/EBC_Exercise_17_Switching_a_GPIO_to_an_LED#Checking_.2Fsys.2Fclass.2Fleds

Going to /sys/dev/char is intuitive, and more so than /sys/class/whatever. But /sys/class has things that dev does not have, so you must remember /sys/dev/char and /sys/class for starters. This will get you access to hw control, afaik.

Output Video to TFT

Download video from somewhere. Resize/scale to small enough resolution (NOTE: this resolution is 128x96, from book Ffmpeg Basics by Korbel)

ffmpeg -i video.mp4 -s sqcif outputsmall.mp4
mplayer -loop 0 -vo fbdev2 outputsmall.mp4

Video should output direct on /dev/tty0

Framebuffer settings:

cd /sys
find . -print | grep fb0

There should be an fb0 (graphics) and fbcon (text console) e.g.

root@beaglebone:/sys/class/graphics# ls
fb0  fbcon

ref: https://unix.stackexchange.com/questions/342815/how-to-send-ffmpeg-output-to-framebuffer