A kid-friendly touch-controlled library media player on the Raspberry Pi
- Raspberry Pi 3 Model A+ running Raspbian Stretch
- Pimoroni HyperPixel 4.0 Touch Screen
- Adafruit Mini External USB Stereo Speaker
- Node.js v14.x (LTS):
https://github.com/nodesource/distributions/blob/master/README.md#debinstall - Yarn 1.22.x:
https://yarnpkg.com/lang/en/docs/install/#debian-stable
Important on Raspberry Pi: Executeyarn config set child-concurrency 1
before executingyarn install
.
Otherwise the SDCard will get hammered by 5 parallel build processes and the system will overload!
- .NET Core 3.1 SDK for Linux: dotnet-core-3.1
- Raspbian Stretch Packages (additional to Raspbian Lite)
omxplayer
for media playbackchromium-browser
for the Web UI- An X desktop environment (I used LXDE) with autologin enabled.
- .NET Core 3.1 Runtime for Linux (ARM32): dotnet-core-3.1
-
Fork/Clone
-
Install dependencies with
yarn install
-
Create the SQLite database and tables with
npm run initdb
(ornpm run initdb:prod
) -
Fill the library SQLite database with
npm run scan
(ornpm run scan:prod
)
This will executeknex seed:run --env development
to seed the database with the contents of themedia
folder. -
Fire up the server with
npm start
-
Start the front-end with
DISPLAY=:0 chromium-browser --kiosk http://localhost:3000
Go to the joybox2
folder and install client App dependencies with:
$ yarn install
If your IDE doesn't automatically install your .NET NuGet Dependencies, you can manually install them with:
$ dotnet restore
Start a watched .NET Core build in the background from the command-line with:
$ dotnet watch run
watch : Started
Hosting environment: Development
Content root path: C:\Users\simon\git\joybox2\joybox2
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
In a new terminal window start a watched nuxt dev server build with:
$ yarn dev
Then open http://localhost:3000 in your browser to view your App served directly from Nuxt.js dev server and will proxy all Server requests to ServiceStack Server running on https://localhost:5001.
Most of the REST API & DB backend code is based on the examples in https://github.com/mjhea0/node-koa-api.
It was of great help to have such a nice template to implement my own requirements.
Volume control with amixer
amixer cset numid=3,iface=MIXER,name='PCM Playback Volume' 10%
Playback control with omxplayer
omxplayer -o alsa media/one_love.mp3
Other omxplayer options
-l --pos n Start position (hh:mm:ss)
--no-osd Do not display status information on screen
--no-keys Disable keyboard input (prevents hangs for certain TTYs)