hi,
anyone know how to added small LCD Display/screen 16x2 (or other/ similar like qnap) for information used space disk or other information.
thanks
hi,
anyone know how to added small LCD Display/screen 16x2 (or other/ similar like qnap) for information used space disk or other information.
thanks
my hardware:
please help
hi, thank you for your replay, by the way
that tutorial is for i2c raspberry, my motherboard dont have, i mean LCD that connect to usb.
Itâs not that hard, to pull stats via ssh. I am using this:
that awesome, yes i want wimilar like this, but my problem is, i dont have GPIO like Raspberry to connected OLed, what should i do? have you tutorial how to connected that oled to my device?
thank you so much for your time
I think the idea is, âget a Raspberry Pi and connect it to the appropriate display.â TrueNAS doesnât directly support displaying system stats on a LCD/OLED display, and it also doesnât support installing software in the base OS. Iâm not saying thereâs no way to do it, but I donât think youâre going to find a simple step-by-step guide.
Edit: You could enable developer mode on your NAS, and then this guide would get you close:
âŚbut your changes would still be lost with any updates, and your system would be unsupported in terms of bug reports.
WOW, thank you, that is what i need, thank you so much
There are even more simple ways âŚ
Here is the repo:
Eh, maybe. That repoâs awfully light on details (it takes a good bit of digging to even find what device itâs for). Youâll need to translate German to English or whatever other language you prefer. And it wonât work with 25.04 or later, as the REST API is going away. But advantage is, you donât need developer mode on the NAS.
Edit: If I were trying something like this, Iâd probably run it on a Pi Zero, grabbing data from TrueNAS via its API, and then putting it onto whatever display I was using, whether that little I2C OLED unit, a 1602 text LCD, or whatever. The downside to this approach is that it would need to connect to the NAS via the network, so its network address already needs to be known.
i just found, i dont know its work or not on truenas, its using MQTT
Iâm building a small tool to add in my case 5.25" free slot cover, i have made just some quick test but for me result are promising.
Iâm using a 2⏠pico PI with a 2⏠16x2 lcd (with l2c interface), so really cheap and easy/fast to assemble.
Iâm using this library, because other for me not working and donât know why.
Basically i have upload to the pico a micro python script that show data received by a bash script via USB like a slideshow⌠for the moment i have mapped only âhw monitor infoâ, but the goal is to map more info as possible.
If you are interested i will share more info when i can!
awesome, plase share, that will be great.
thanks for your replay
It could probably be made to, but itâd take a good bit of adaptation.
Edit: Broadly speaking, there are two possible paths:
On the former, itâd be great if there were a USB display you could plug in and send text to using something like echo "foo bar baz" > /dev/ttyUSB0
. In that case, the first method would be fairly trivialâwrite or adapt a script to collect the values you want, and send them directly out to the display. But based on the existence of lcdproc
, it doesnât appear they work that way. So the first option means you need to install lcdproc
, which means putting your NAS into developer mode, which in turn puts it into an unsupported state.
The suggestions here, then, including the link you just shared, are mainly dealing with the second method: connect the display to some other computing device (whether a Raspberry Pi, an ESP, an Arduino, or something else), get the reporting data onto that device, and use it to manage the display. That means your display device gets at least a little more expensive,[1] because itâs now âcomputer + display.â But it also means that the job of putting information on the display, which would have required additional software to be installed on your NAS, is now handled by a different device. No mods to your NAS, no developer mode, no unsupported system. Depending on the details of how itâs implemented, perhaps no changes needed to your NAS at all.
tl;dr: there are lots of ways to do this, but AFAIK all of them will require a good bit of custom coding on your part; Iâm not aware of any sort of prepackaged solution to do this.
Not necessarily a lot more expensive, though; ESPs, for example, are very cheap. âŠď¸
Those are just the results of a quick test, i neither know if the approach is correct⌠so hopefully with sharing i will take some tip/int in the right direction
Following the guide i mentioned above, i managed to control the lcd with the pico; is well explained, donât think will be need add anything more.
After the setup, i upload a script main.py
into the pico, so everytime is connected he will put itself listening to standard input
import machine
import utime
import sys
import select
from pico_i2c_lcd import I2cLcd
PIN_SDA = 8
PIN_SCL = 9
FREQ = 400000
ADDR = 0x27
ROW = 2
COL = 16
i2c = machine.I2C(0, sda=machine.Pin(PIN_SDA), scl=machine.Pin(PIN_SCL), freq=FREQ)
lcd = I2cLcd(i2c, ADDR, ROW, COL)
counter = 0
lcd.clear()
message = "Waiting data"
lcd.putstr(message)
while True:
if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
message = sys.stdin.readline().strip()
try:
label, value = message.split(":", 1)
lcd.clear()
lcd.move_to(0, 0)
lcd.putstr(label)
lcd.move_to(0, 1)
lcd.putstr(value)
except ValueError:
pass
counter = 0
utime.sleep(4.0)
else:
#lcd.move_to(0, 1)
#message = " "
#lcd.putstr(message)
lcd.clear()
lcd.move_to(0, 1)
if (counter == 0):
lcd.putstr("")
counter = counter +1
elif (counter == 1):
lcd.putstr(".")
counter = counter +1
elif (counter == 2):
lcd.putstr("..")
counter = counter +1
elif (counter >= 3):
lcd.putstr("...")
counter = 0
utime.sleep(2.5)
Then I connected the pico to TN and intercepted the port with sudo dmesg | grep tty
:
truenas% sudo dmesg | grep tty
[3971062.471806] cdc_acm 1-8:1.0: ttyACM0: USB ACM device
ttyACM0
is what i need and use in the bash above:
#!/bin/bash
# CHANGE IT
SERIAL_PORT="/dev/ttyACM0"
send_message() {
MESSAGE="$1"
echo "$MESSAGE" > "$SERIAL_PORT"
sleep 4
}
while true; do
# CPU TEMP
cpu_temp=$(sensors | grep "Core 0" | awk '{print $3}')
cpu_temp_cleaned=$(echo "$cpu_temp" | tr -d '°C')
message="CPU Temp:${cpu_temp_cleaned} C"
send_message "$message"
# CPU USAGE
cpu_usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}')
message="CPU Usage:$cpu_usage%"
send_message "$message"
# RAM
total_ram=$(free -m | grep Mem | awk '{print $2}')
message="Total RAM:$total_ram MB"
send_message "$message"
# RAM used
ram_used=$(free -m | grep Mem | awk '{print $3}')
message="RAM Used:$ram_used MB"
send_message "$message"
done
from shell i run the script and data are displayed.
As i say
Consider writing the script in Python using the API client (GitHub - truenas/api_client) if youâre planning to use the API anyway (which is what midclt
does)âPython makes it a lot easier to parse the output in order to send the desired information to the display. You can do something like:
info=c.call("system.info")
print(f"Installed RAM: {info['physmem']}")
print(f"ECC: {info['ecc_memory']}")
print(f"Uptime: {info['uptime']}")
print(f"Load Avg: {info['loadavg']}")
Presumably youâd want to reaplce the print
statements with output to serial, but the concept is the same.
100% agree. I was already considering that⌠but at the end i used a bash script more for âcuriosityâ to use bash is some pratical way one time in my life Gonna go back a step, better now than later.
Thanks for the confirm!
Another option would be RainMeter (https://www.rainmeter.net/). You would need a small script that periodically writes the information you need to a text file and then set up a rainmeter skin to grab the information from the text file.
I have lots of these passive skins on my desk top that just update me on the status of my backups, local weather, main computer cpu usage, disk space (including mapped network drives), etc.
Iâm dumb, or this software Is just for Win machine?
I likewise donât see any way in which RainMeter does anything to address OPâs request.