Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] Read Input Voltage from Witty Pi 4 with Bash Script

4 Posts
2 Users
0 Likes
478 Views
(@mmoollllee)
Posts: 33
Eminent Member
Topic starter
 

See this Gist to read Input Voltage via Bash Script. Thought I'm going to share this as it might help someone 🙂

 
Posted : 28/02/2024 6:08 pm
(@admin)
Posts: 512
Member Admin
 

Thanks for the sharing.

 
Posted : 28/02/2024 6:23 pm
(@mmoollllee)
Posts: 33
Eminent Member
Topic starter
 

Don't thank me too soon 😀

It turns out, it doesn't work reliable!?

I'm calling it with the following python code

v = subprocess.run(["/usr/bin/bash", "witty_voltage.sh"], capture_output=True, text=True).stdout.strip()
voltage = v + " Volt"
return voltage

Sometimes it returns "0 Volt" sometimes " Volt" sometimes "13.11 Volt".
Maybe someone can help me out!?

 
Posted : 29/02/2024 10:41 am
(@mmoollllee)
Posts: 33
Eminent Member
Topic starter
 

Got it working. And added a "read scheduled startup" script too 🙂

 
Posted : 10/03/2024 1:19 am
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.