http://www.domoticz.com/wiki/UPS_Pico
The tutorial is almost complete, I still need to give examples with domoticz switches, selector and blockly
Please if someone tests it and finds errors or wrong information, please advise me

Moderators: leecollings, remb0
Code: Select all
python upspico-and-domoticz.py
Traceback (most recent call last):
File "upspico-and-domoticz.py", line 18, in <module>
idx_PoweringMode = XX
NameError: name 'XX' is not defined
Code: Select all
# change these values
# domoticz = URL to the Domoticz server
# idx_ are the id's of the devices corresponding to the data in domoticz
domoticz = "http://127.0.0.1:8080"
idx_PoweringMode = XX
idx_BatteryVoltage = XX
idx_RpiVoltage = XX
idx_BatteryTemperature = XX
idx_RpiFanTemperature = XX
idx_FirmwareVersion = XX
idx_BatteryActiveSignal = XX
idx_BatteryLevelPercentage = XX
idx_BatteryChargerStatus = XX
# End
Hello Robert,lagus wrote:Mr jfhautenauven,
I owe you an apology.
Your description is correct and superb.
I missed as you probably seen to enter the idx values in the script which device to be updated.
After a re-update and added *ALL* sensors and values that your script reads it works perfectly well.
Again, thank you very much for this excellent guide!
Best,
//Robert
Code: Select all
sudo /etc/init.d/picofssd stop
Code: Select all
sudo i2cdetect -y 1
Code: Select all
sudo python pico_status.py
Code: Select all
***********************************
UPS PIco Firmware: ff
Powering Mode: ERR
BAT Volatge:
Traceback (most recent call last):
File "pico_status.py", line 74, in <module>
print " ","BAT Volatge:", bat_level(),"V"
File "pico_status.py", line 31, in bat_level
return (float(data) / 100) ValueError: could not convert string to
float: ffff
Code: Select all
#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
Code: Select all
sleep 4;hwclock -s &
Script isn't designed for 4.1.18.DutchDomoticz wrote: ↑Friday 24 November 2017 22:41 Back again,
I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:And adding this line:Code: Select all
#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
Things seemed to be OK and I could successfully see the status of the PIco UPS.Code: Select all
sleep 4;hwclock -s &
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".
It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.
I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again![]()
Regards,
Dick
Hi,Siewert308SW wrote: ↑Friday 24 November 2017 22:57Script isn't designed for 4.1.18.DutchDomoticz wrote: ↑Friday 24 November 2017 22:41 Back again,
I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:And adding this line:Code: Select all
#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
Things seemed to be OK and I could successfully see the status of the PIco UPS.Code: Select all
sleep 4;hwclock -s &
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".
It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.
I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again![]()
Regards,
Dick
Maybe i made a typo, haven't looked at the script for a long time, the script should abort on 4.1.18.
You could try to update to the latest kernel and then run the installer again as i tested it on 4.9.
I do have a other unpublished script which you could try also.
picotoolkit.zip
I'm sorry that came back to this old post but I have some trouble with your script. This is what the output is. I als did a new install but that gave the same output.Siewert308SW wrote: ↑Friday 24 November 2017 22:57Script isn't designed for 4.1.18.DutchDomoticz wrote: ↑Friday 24 November 2017 22:41 Back again,
I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:And adding this line:Code: Select all
#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
Things seemed to be OK and I could successfully see the status of the PIco UPS.Code: Select all
sleep 4;hwclock -s &
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".
It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.
I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again![]()
Regards,
Dick
Maybe i made a typo, haven't looked at the script for a long time, the script should abort on 4.1.18.
You could try to update to the latest kernel and then run the installer again as i tested it on 4.9.
I do have a other unpublished script which you could try also.
picotoolkit.zip
[*] PIco HV3.0a UPS Toolkit [*]
[*] Version : 2.0 [*]
[*] Updated : 27 Jan 2018 [*]
[*] Created By : Siewert308SW [*]
[*] GitHub : http://bit.ly/2fkTaGz [*]
[*] Dev Thread : http://bit.ly/2hz7vzT [*]
=================================================================================
1) Install - PIco HV3.0A
2) Remove - PIco HV3.0A
3) Status - PIco HV3.0A
4) Quit
#? 3
____ ___ _ ___ _______ ___ _ _ _ ____ ____
| _ \_ _|___ ___ | | | \ \ / /___ / / _ \ / \ | | | | _ \/ ___|
| |_) | |/ __/ _ \ | |_| |\ \ / / |_ \| | | |/ _ \ | | | | |_) \___ \
| __/| | (_| (_) | | _ | \ V / ___) | |_| / ___ \ | |_| | __/ ___) |
|_| |___\___\___/ |_| |_| \_/ |____(_)___/_/ \_\ \___/|_| |____/
.~~. .~~.
'. \ ' ' / .'
: .~.'~'.~. : _____ _ _ ___ _
: .~.'~'.~. : |_ _|__ ___ | | |/ (_) |_
~ ( ) ( ) ~ | |/ _ \ / _ \| | /| | _|
( : '~'.~.'~' : ) | | (_) | (_) | | \| | |_
~ .~ ( ) ~. ~ |_|\___/ \___/|_|_|\_\_|\__|
( : '~' : )
'~ .~~~. ~'
'~'
::: PIco HV3.0a Status
=================================================================================
**********************************************
* UPS PIco HV3.0A Status *
* Version 6.0 *
**********************************************
- PIco Firmware..........: 38
- PIco Bootloader........: 50
- PIco PCB Version.......: 41
- PIco BAT Version.......: LiPO (ASCII: P)
- PIco BAT Runtime.......: 1 MIN
- PIco rs232 State.......: OFF
- Powering Mode..........: RPi POWERED
- Charger State..........: CHARGING
- Battery Percentage.....: -300 %
- Battery Voltage........: 0.7 V
- RPi Voltage............: 5.3 V
- RPi CPU Temperature....: 70.9 C
- NTC1 Temperature.......: 53 C
- TO-92 Temperature......: 11 C
- PIco FAN Mode..........: AUTOMATIC
- PIco FAN Temp Threshold: 35 C
**********************************************
* Powered by PiModules *
**********************************************
=================================================================================
1) Install - PIco HV3.0A
2) Remove - PIco HV3.0A
3) Status - PIco HV3.0A
4) Quit
#?
Users browsing this forum: No registered users and 1 guest