This Python script provides a simple wrapper for sending messages to a Vestaboard display. Vestaboard is an analog mechanical display board that can show messages across six rows, each containing 22 characters. This script offers easy integration with Vestaboard's local API to control what is displayed on the board.
The script supports:
- Sending text messages to the Vestaboard.
- Justification options for text (
left
,center
,right
). - Building a dynamic matrix for center justified messages automatically computing the padding required on all sides.
- Background colors (solid or gradient).
- Simple CLI options for flexibility.
- Message Display: Display any message within a 6x22 matrix on your Vestaboard.
- Justification Options: Supports left, center, and right justification for the text.
- Gradient Background: Display a gradient background across the board.
- Debugging: Enable debugging to see detailed logs of actions.
- Python 3.x
requests
library (pip install requests
)
All characters that can be shown on a Vestaboard are encoded by an integer character code. These include letters, digits, punctuation, and color chips. You must save the character codes in a character_codes.json
file for the script to function properly.
- Clone or download this repository to your local machine.
git clone https://github.com/booyasatoshi/vestaboard
- Ensure you have Python 3.x installed on your system.
- Install the redquirements with:
pip install -r requirements.txt
The script can be executed with the following command-line arguments:
--message
: The message to be displayed on the Vestaboard.--color
: The color for the background fill. Valid options arered
,orange
,yellow
,green
,blue
,violet
,white
, andblack
.--justify
: Text justification on the board. Options:left
,center
,right
. Default isleft
.--gradient
: Specify the start and end colors for a gradient background (e.g.,--gradient red blue
).--debug
: Enable debug output.
- Make sure your Vestaboard IP address is correctly set in the
BASE_URL
variable inmain.py
. - Ensure the local API key is valid and correctly defined in the .env file using the format:
VBOARD_API="ZDkXXXXXXXXXXXXXXXXXXXX"
- If spaces between words are being filled, ensure that the code is properly leaving
0
values for spaces to allow the background to show through.
- You will not be able to connect to the board on the local network and send messages until you obtain an enablement token.
- The board will print out an API key every time you make a POST request using the enablement token given to you by Vestaboard:
curl -X POST -H "X-Vestaboard-Local-Api-Enablement-Token: YOUR_API_ENABLEMENT_TOKEN" http://vestaboard.local:7000/local-api/enablement
- Without an API key generated by the Board
- Make sure the Vestaboard's local API is enabled as described in the Vestaboard Local API Documentation.
Feel free to contribute to this project by opening issues or submitting pull requests. All contributions are welcome!
This project is licensed under the GNU General Public License (GPL). The GPL ensures that the software remains free and open-source, allowing users to modify, distribute, and use it freely. However, any modifications or derivative works must also be licensed under the GPL and include the source code, ensuring that improvements to the software are shared with the community. This fosters collaboration and encourages transparency and innovation.