Re: Script RPI Power Pack Hat Pro V1.1 with MeterN [GUIDA]
Inviato: 31/07/2019, 18:11
QUI ad esempio.
Il Forum NON UFFICIALE per raccogliere le novità riguardo ai software 123Solar e MeterN per il monitoraggio energetico e non solo ....
https://www.flanesi.it:443/forum/
Flane ha scritto:Se parliamo di RPINotify arriveranno nel canale RPInotify .....
Codice: Seleziona tutto
con il comando sudo i2cdetect -y -a 1,
ho ricevuto l'indirizzo che nel mio caso è 36
Codice: Seleziona tutto
while True:
def readVoltage(bus):
"This function returns as float the voltage from the Raspi UPS Hat via the provided SMBus object"
address = 0x36
read = bus.read_word_data(address, 2)
swapped = struct.unpack("<H", struct.pack(">H", read))[0]
voltage = swapped * 305.0 /1000000
return voltage
def readCapacity(bus):
"This function returns as a float the remaining capacity of the battery connected to the Raspi UPS Hat via the provided SMBus object"
address = 0x36
read = bus.read_word_data(address, 4)
swapped = struct.unpack("<H", struct.pack(">H", read))[0]
capacity = swapped/256
return capacity
Codice: Seleziona tutto
reqsdm bat_ten
ups_1(15.36*V)
Codice: Seleziona tutto
reqsdm bat_cap
ups_2(62*%)
Codice: Seleziona tutto
pi@raspberrypi:~ $ sudo systemctl status upshat.service
● upshat.service - RPI UPS Hat Service
Loaded: loaded (/etc/systemd/system/upshat.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Flane ha scritto:Il primo link è la versione 1.0 e non 1.1
La 1.0 aveva anche qualche problema che non ricordo più, ma che ne rendeva impossibile l'uso come UPS.
La 1.0 inoltre non funziona con il mio script.
La 2.0 non l'ho mai vista ne provata.