Turn your MAX7219 matrix into a smart display with the power of micropython and deno.
- Plugin support! Extend the features of your smartrix by writing your own plugins.
- An emulator in your terminal, so you don't need the hardware to run this project.
- clock
- game of life
- cpu monitor
- VSCode (optional but recommended)
- esptool
- The micropython binaries for your esp32. You can download these here: https://micropython.org/download/
- Deno
In the next part
<PORT>
is referenced. This is your serial port, where your esp32 is connected to your computer. This information varies across the operating systems, but there are a lot tutorials out there which help you to find out, how your serial port is named.
- Download or clone this repository.
- Download the micropython firmware for your board and place this right beneath this readme file.
- Erase the flash on your esp32 with
esptool.py --port <PORT> erase_flash
- Now flash the firmware with
esptool.py --chip esp32 --port <PORT> write_flash -z 0x1000 esp32.bin
assuming you are in the directory, where you downloaded the firmware from step 2. In this example it is named esp32.bin. - Create a wifi.py file and place it inside the src folder. Paste in the following and replace "ssid" with your SSID (The name of your wifi) and "password" (The password of your wifi):
SSID = 'ssid'
PASS = 'password'
- Copy the code to your esp32 with
rshell -p <PORT> rsync -m src/. /pyboard/
assuming your current directory is the root dir of this repository. - Open up a console and navigate to the path where you extracted this repository
- run
deno run --allow-net --allow-run deno/main.ts --host <host>
wherehost
is the ip of your esp32 board in your network. - You should see someting on your LED matrix! Once you flashed the software to the hardware, no connection to your computer is required anymore.
In addition to deno run --allow-net --allow-run deno/main.ts
you can tweak some settings:
flag | default value | description |
---|---|---|
--host | none | if set, smartrix runs in online mode. Specify the ip address of your esp32. |
--port | 8080 | specifies the tcp port of the esp32. |
--rate | 500 | sets the refresh rate in ms. |
--alwaysUpdate | false | by default, the screen is only updated, if the content to display has changed. If you want to update every tick, set this to true. |
--brightness | 15 | sets the brightness of you matrix module. Range is between 0-15. Has no effect when run in offline mode. |
--rotation | 6 | defines how long one plugin is displayed in ticks. The duration of one tick is defined with the --rate option. If you set a rate of 500 and a rotation of 6, every 3 seconds the plugins rotate. |