Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 3.88 KB

README.md

File metadata and controls

80 lines (59 loc) · 3.88 KB

Vestaboard Local API Wrapper Script

Overview

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.

Features

  • 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.

Requirements

  • Python 3.x
  • requests library (pip install requests)

Character Codes

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.

Installation

  1. Clone or download this repository to your local machine.
git clone https://github.com/booyasatoshi/vestaboard
  1. Ensure you have Python 3.x installed on your system.
  2. Install the redquirements with:
   pip install -r requirements.txt

Usage

Command-Line Arguments

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 are red, orange, yellow, green, blue, violet, white, and black.
  • --justify: Text justification on the board. Options: left, center, right. Default is left.
  • --gradient: Specify the start and end colors for a gradient background (e.g., --gradient red blue).
  • --debug: Enable debug output.

Troubleshooting

Common Issues

Error: Failed to Send Message

  • Make sure your Vestaboard IP address is correctly set in the BASE_URL variable in main.py.
  • Ensure the local API key is valid and correctly defined in the .env file using the format:
VBOARD_API="ZDkXXXXXXXXXXXXXXXXXXXX"

Spaces Between Words Not Showing Background Color

  • 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.

Connection Issues

  • 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

Contributing

Feel free to contribute to this project by opening issues or submitting pull requests. All contributions are welcome!

License

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.