Skip to content

Installation

captncode edited this page Dec 14, 2020 · 6 revisions

Set up a Raspberry Pi 2 or later. This has been tested on a Raspberry Pi 3B+ running Raspberry Pi OS Lite (32-bit).

Verify it is on the network.

Log in and configure the system:

sudo raspi-config
Choose Interfacing Options -> SPI -> Yes  to enable SPI interface
Choose System Options -> Password  to change the default password for user pi
Choose System Options -> Hostname  to change the system hostname
Choose Localisation Options -> Locale  to set up your locale
Choose Localisation Options -> Timezone  to set up your timezone

Shut down the system:

sudo shutdown -h now

Remove power from the system and install a Waveshare E-Paper display with HAT. The currently supported versions can be found here: https://github.com/eXoCooLd/Waveshare.EPaperDisplay

Power the system up and log back in.

Install libgdiplus and fontconfig packages:

sudo apt update
sudo apt-get libgdiplus
sudo apt-get fontconfig

The tzdata package is also required but automatically installed with Raspberry PI OS Lite.

Update/Upgrade to the latest versions of all packages:

sudo apt upgrade

Copy any desired TrueType or OpenType fonts to /usr/local/share/fonts.

Update the font cache after installing any font:

sudo fc-cache

You can verify font installation using fc-list. If the iotdisplay service is running, it will need to be stopped and restarted (or the system rebooted) in order to use any new font.

Deploy the project to the Raspberry Pi into its own folder such as /usr/local/iotdisplay. If the Console App is desired, it can be deployed to the same folder as the Web App.
See https://docs.microsoft.com/en-us/dotnet/iot/deployment

Create a folder for the service to store its state files such as /home/iotdisplay. /tmp will not work as the folder is flushed after reboot.

Update the appsettings.json file with the desired settings including state folder and display type driver name. The display types can be found here https://github.com/eXoCooLd/Waveshare.EPaperDisplay/blob/master/Waveshare/Devices/EPaperDisplayType.cs

Test the web app by running:

sudo /usr/local/iotdisplay/IoTDisplay.WebApp

Your E-Paper screen should flash black and white while it is starting.

See if it is running by opening a browser to http://[host name]:5000/swagger/index.html

Back on the Raspberry Pi, stop the web app with Ctrl-C

Set up WebApp to run as a service:

Create the following as a file in /etc/systemd/system/multi-user.target.wants named iotdisplay.service

[Unit]
Description=IoT Display service

[Service]
ExecStart=/usr/local/iotdisplay/IoTDisplay.WebApp
WorkingDirectory=/usr/local/iotdisplay/
User=root
Group=root
Restart=on-failure
SyslogIdentifier=iotdisplay

[Install]
WantedBy=multi-user.target

Make sure the paths above match the path the project was deployed to.

Set up to start automatically:

sudo systemctl enable iotdisplay

Start the web app:

sudo systemctl start iotdisplay

Watch the E-Paper screen to make sure it flashes black and white. Test the web app one more time in a browser.

Hopefully success!

Clone this wiki locally