server_status_oled_display
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| server_status_oled_display [2025/03/23 00:20] – kenson | server_status_oled_display [2026/05/06 04:56] (current) – kenson | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Displayinator v1.0 ===== | ===== Displayinator v1.0 ===== | ||
| - | This is a device you can shove into a spare USB connector on say a server rack system to display info like IP/ | + | This is a device you can shove into a spare USB connector on say a server rack system to display info like IP/ |
| {{ : | {{ : | ||
| - | This is a old school project using a ATMEGA32U4. | + | This is a old school project using a ATMEGA32U4. Hindsight being 20/20 I should have chosen a more modern microcontroller as the 2.5K of RAM was a significant limitation requiring excessive use of PROGMEM in places you ordinarily wouldn' |
| + | Notes: | ||
| * The board is a clone of an Arduino Micro, and I2C is connnected to the OLED (SSD1315) and the Accelerometer (MMA8451). | * The board is a clone of an Arduino Micro, and I2C is connnected to the OLED (SSD1315) and the Accelerometer (MMA8451). | ||
| * The OLED's I2C address 0x3C, and I'm using adafruit' | * The OLED's I2C address 0x3C, and I'm using adafruit' | ||
| * The Accelerometer' | * The Accelerometer' | ||
| + | |||
| + | |||
| + | ====== TLDR; ====== | ||
| + | |||
| + | |||
| + | Probe the port. | ||
| + | |||
| + | < | ||
| + | sudo tee ./ | ||
| + | # | ||
| + | set -u | ||
| + | |||
| + | BAUD=115200 | ||
| + | |||
| + | for PORT in / | ||
| + | [ -e " | ||
| + | |||
| + | echo " | ||
| + | echo " | ||
| + | |||
| + | if ! stty -F " | ||
| + | echo "Could not configure $PORT" | ||
| + | continue | ||
| + | fi | ||
| + | |||
| + | # Some Arduino/ | ||
| + | sleep 4 | ||
| + | |||
| + | # Wake / clear any stale output | ||
| + | printf ' | ||
| + | sleep 0.2 | ||
| + | timeout 1 cat " | ||
| + | |||
| + | # Ask version | ||
| + | printf ' | ||
| + | |||
| + | echo " | ||
| + | timeout 2 cat " | ||
| + | echo | ||
| + | done | ||
| + | EOF | ||
| + | chmod +x probe_displayinator.py | ||
| + | ./ | ||
| + | </ | ||
| + | |||
| + | Download the agent: {{ : | ||
| + | < | ||
| + | wget ' | ||
| + | unzip displayinatorhostip.zip | ||
| + | </ | ||
| + | |||
| + | Insert the service to autostart | ||
| + | < | ||
| + | sudo tee / | ||
| + | [Unit] | ||
| + | Description=Displayinator Host IP Sender | ||
| + | Wants=network-online.target | ||
| + | After=network-online.target multi-user.target | ||
| + | |||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | WorkingDirectory=/ | ||
| + | ExecStartPre=/ | ||
| + | ExecStart=/ | ||
| + | StandardOutput=append:/ | ||
| + | StandardError=append:/ | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | EOF | ||
| + | </ | ||
| + | |||
| + | Edit / | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | Start the service. | ||
| + | |||
| + | < | ||
| + | systemctl daemon-reload | ||
| + | systemctl enable --now displayinator.service | ||
| + | systemctl status displayinator.service | ||
| + | </ | ||
| ==== Loading the Arduino Bootloader ==== | ==== Loading the Arduino Bootloader ==== | ||
| Line 18: | Line 103: | ||
| avrdude will complain about older firmware but my recommendation is to ignore it. | avrdude will complain about older firmware but my recommendation is to ignore it. | ||
| - | The TLDR; is the chinese firmware is modified and does some automagic stuff and in general works more reliably than the publicly available open source code version. | + | The [[USBasp flash|TLDR;]] is the chinese firmware is modified and does some automagic stuff and in general works more reliably than the publicly available open source code version. |
| Use zadig to make it (USBasp) use libusb-win32 | Use zadig to make it (USBasp) use libusb-win32 | ||
| - | Copy avrdude to the arduino avrdude location. (You can "Show verbose output during [X] compile [X] upload" | + | Copy avrdude |
| Then from Arduino, select USBasp in Tools-> | Then from Arduino, select USBasp in Tools-> | ||
| Line 42: | Line 127: | ||
| I uses the accelerometer to detect orientation so it should be right side up. | I uses the accelerometer to detect orientation so it should be right side up. | ||
| - | The USB serial is nominally 115200, and the commands it takes are | + | The USB serial is nominally 115200. |
| + | |||
| + | ==== Command structure ==== | ||
| + | |||
| + | The command protocol is simple: | ||
| + | * Commands are prepended with an ' | ||
| + | * Key-Value pairs are prepended with a ' | ||
| + | * You can also indicate not to store values in EEPROM by putting a caret ' | ||
| + | |||
| + | ==== Commands ==== | ||
| !LIST which displays the stored key-value pairs | !LIST which displays the stored key-value pairs | ||
| Line 75: | Line 169: | ||
| </ | </ | ||
| - | Everything else is checked to see if it is a Key-Value pair. A pair is just two, space-delimited, alphanumeric words. E.g. | + | |
| + | ==== KEY VALUE STORAGE ==== | ||
| + | |||
| + | If the line starts with a ' | ||
| + | |||
| + | Note that this ' | ||
| < | < | ||
| - | HAPPY GILMORE | + | @HAPPY GILMORE |
| Space index found at: 5 | Space index found at: 5 | ||
| Key extracted: ' | Key extracted: ' | ||
| Added HAPPY = GILMORE | Added HAPPY = GILMORE | ||
| + | </ | ||
| + | |||
| + | Note only the first space is used as a delimiter, successive spaces are considered part of the Value. | ||
| + | |||
| + | < | ||
| + | @KEY Value cow | ||
| + | KEY Value cow, Space @: 3 | ||
| + | Key extracted: ' | ||
| + | Added KEY = Value cow | ||
| + | </ | ||
| + | |||
| + | KV pairs are normally stored in flash and will be loaded on power on. Sometimes this behavior is undesired, for example rapidly changing information like CPU Load. In this case, a ' | ||
| + | |||
| + | < | ||
| + | @^CPU 48% | ||
| + | ^CPU 48%, Space @: 4 | ||
| + | Key extracted: ' | ||
| + | Updated ^CPU = 48% | ||
| </ | </ | ||
| Line 90: | Line 208: | ||
| * It also likes to reset when you connect via serial so I wait 3 to 5 seconds for it to boot up before poking it. | * It also likes to reset when you connect via serial so I wait 3 to 5 seconds for it to boot up before poking it. | ||
| * Python raises DTR, and for whatever reason it breaks things, so I set ser.dtr = False. | * Python raises DTR, and for whatever reason it breaks things, so I set ser.dtr = False. | ||
| + | * You never know whats in a serial buffer when you connect so send a ' | ||
| ==== TrueNAS ===== | ==== TrueNAS ===== | ||
server_status_oled_display.1742689205.txt.gz · Last modified: 2025/03/23 00:20 by kenson
