-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The IoTDisplay is a network enabled E-Paper + Raspberry Pi device that can display a variety of information. It sets on your network waiting for commands passed to it via the OpenAPI web app. Although fully OpenAPI compliant, you do not need an OpenAPI enabled client to communicate with the device. Any commands can be sent via the HTTP posting of JSON documents. The displayed screen is kept as a bitmap canvas in memory and its state is stored on the SD card in case of a restart. Commands are sent to the display to update specific areas of the canvas with drawings, images and text. Clock commands are also available. They are automatically rendered on the canvas in memory once a minute.
Any command sent with delay: false (the default) will be rendered on the canvas immediately, then a five-second timer is set to allow for additional commands. At the end of the timer, a bitmap of the canvas is sent to the E-Paper display for viewing. Any command sent with delay: true, such as all clock commands, will be rendered on the canvas immediately but will only be sent to the E-Paper display at five minute intervals. If a non-delayed command is sent during the five minute wait time, the updated canvas, including anything rendered with delay, will be sent to the display at the end of the five-second timer.
This gives you the flexibility to get a near real time display of some information while having the ability to show other information in a less timely manner. Since E-Paper displays have a limited lifetime of display updates, delaying commands that frequently update help extend the life of the display. Also, as most E-Paper displays take several seconds to update, these delays help group changes together so the display spends less time updating and is viewable more of the time.
This project utilizes eXoCooLd's Waveshare.EPaperDisplay drivers. Any display supported by that project is also supported by this project. The display can be used in portrait or landscape mode. The driver name and rotation (0°, 90°, 180°, 270°) are set in the appsettings.json file with 0° being landscape and 180° being landscape flipped.
Since this is written to use an E-Paper display attached to an SPI interface, it will only work on a Raspberry Pi. However, if the driver is set to "none", you can run it on any machine that can run .NET 5 for testing and debugging purposes. The web UI is available regardless of platform, and the current canvas can be viewed within the UI at any time.
The accepted hosts and ports for the web app by default is "http://*:5000;http://localhost:5001" but can be configured using hostsettings.json or by a command line argument including HTTPS URLs if you include a certificate. Commands are to be sent to this URL and the full UI can be seen by navigating a browser to (URL)/swagger/index.html. The UI will list every command, its JSON schema (where applicable), an example, and the option to try them.
Commands can also be sent using the console app. A JSON document is built using command line arguments and sent to the web app via HTTP. Help is available within this app.