To connect to the raspberry pi with ssh the first time, you need to create an empty file named ssh
(without extension) in the root folder of the boot partition of the SD card to allow incoming connexions. To be able to connect with the user pi
password raspberry
, add a file named userconf.txt
:
# for default 'raspberry' password
pi:$6$/4.VdYgDm7RJ0qM1$FwXCeQgDKkqrOU3RIRuDSKpauAbBvP11msq9X58c8Que2l1Dwq3vdJMgiZlQSbEXGaY5esVHGBNbCxKLVNqZW1
# for your own password
pi:$6$<your hashed password>
To generate a more secured password, you can use mkpasswd
for example, and paste the output in the file.
mkpasswd -m sha-512
In Windows, go to the network settings -> Wifi network -> share -> check the box "Allow other network users to connect through this computer's Internet connection" -> select the network adapter corresponding to the raspberry pi (Ethernet) -> validate. Then, connect to the raspberry pi by typing :
Deprecated procedure :
After cloning the project, go to the project directory and install java, maven and the libraries needed by the screen (official site). Then run
./build.sh
It will build the jar that runs the spring boot service which fetches the movies schedules and the C file that displays them on the screen.
Instead of displaying all lines one by one, the C programm will display an image containing all the text. This image is generated by the java program based on a json file and saved in the resources directory.
Run the jar file in the background. It will periodically fetch the movies schedules and display them on the screen by calling the C program.
nohup java -jar app-1.0.0-SNAPSHOT.jar > app.log 2>&1 &
To start the app at boot startup, edit the cron file
crontab -e
and add the following line
@reboot cd /home/pi/lagrange-display && nohup java -jar app-1.0.0-SNAPSHOT.jar > app.log 2>&1 &
You can edit environment variables globally, for example
export FREQUENCY=3600000
You can dynamically load a new schedule by calling a POST endpoint. First authenticate to get the JWT then call the POST endpoint. For instance,
[POST] /api/token
Body :
{
"username": "lagrange",
"password": "lachancla"
}
[POST] /api/movie
Header :
Authorization: Bearer <JWT>
Body:
{
"title":"Cinéma La Grange",
"description":"Programme du cinéma La Grange à Delémont",
"date":"2023-12-15T16:32:22.277Z",
"movies":
[
{
"title": "..."
}
]
}
Install all libraries needed for the monitor (official site).
Go to /c-movie-fetcher
and run
make clean
make
mv ./epd ../../epd
Packages to install :
sudo apt-get update
sudo apt-get install cron
sudo apt-get install jq
sudo apt-get install chromium
sudo apt-get install imagemagick
To run the lagrange-display.sh
script periodically (let's say each 2 hours) and at reboot :
crontab -e
Then add the following lines :
SHELL=/bin/bash
PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/usr/share/maven/bin
@reboot export DISPLAY=:0 && cd /home/pi/lagrange-display && ./lagrange-display.sh > /home/pi/app.log
35 * * * * export DISPLAY=:0 && cd /home/pi/lagrange-display && ./lagrange-display.sh > /home/pi/app.log