pico scripts on github

Various Python Tools that helps handling of the UPS PIco

pico scripts on github

Postby mattwire » Sat Dec 19, 2015 12:13 pm

Hello,

I've created a github repository for my modified versions of the scripts available on the forum here: https://github.com/mattwire/upspico

It includes the following scripts:
    * pico_register_readout.py: Read all registers and output
    * pico_status.py: Output status (voltage, onbattery etc. in the same format as apcaccess so you can use the same scripts to parse the output).
    * picofssd_mail.py: UPS monitoring script. Requires something like nullmailer to allow the system to actually send emails. Monitors the UPS, checks for charging and sends emails on status change.
    * picofu2.py: Firmware updater.

All scripts can be run directly without prefixing python.

The pico_status script is modified from the original so it outputs in "apcaccess" format making parsing very easy. It can also be called and is required by other scripts (eg. picofssd_mail.py) For example:
Code: Select all
TIME     : 2015-12-19 11:07:31
FIRMWARE : 54
STATUS   : ONLINE
BATTV    : 3.45 Volts
RPIV     : 5.06 Volts
ITEMP    : 36 C
A/D1 Voltage : 0.00 V
A/D2 Voltage : 0.00 V


The picofssd_mail.py script is modified extensively to do the following:
* Send email for various ups states.
* Check for line/battery status every 5 seconds.
* Check for charging every 5 seconds.
* Configurable shutdown time based on battery voltage.
mattwire
 
Posts: 6
Joined: Sat Dec 19, 2015 11:27 am

Re: pico scripts on github

Postby dnguyen3985 » Fri Jun 03, 2016 2:47 pm

Thank you for taking your time to share this code, but I seem to have problems configuring the script and having it function.
If it helps im using a Pi Sense HAT and the UPS PIco with the gold reset pin installed.
I just wondered how I am able to setup my gmail account and get this darn thing functioning properly because im having no luck with the other email scripts too!!!

When I try to run this script I have this error:

Code: Select all
Warning (from warnings module):
  File "/home/pi/upspico-master/picofssd_mail.py", line 72
    GPIO.setup(22, GPIO.OUT) # Setup pin 22 as an output
RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
Sendmail exit status 32512
dnguyen3985
 
Posts: 2
Joined: Thu Jun 02, 2016 6:31 pm

Re: pico scripts on github

Postby dnguyen3985 » Tue Jun 07, 2016 8:06 pm

Just an update, I followed the exact instructions on the Github page of the OP and then I followed this guide here: [url]http://iqjar.com/jar/sending-emails-from-the-raspberry-pi/[url].
You don't not have to make any specific changes on the picofssd_mail.py file but when ur following the instructions to you link be sure to make root=youremail@domain.com when you edit the nano /etc/ssmtp/ssmtp.conf file.
dnguyen3985
 
Posts: 2
Joined: Thu Jun 02, 2016 6:31 pm

Re: pico scripts on github

Postby Pimaster » Tue Jun 07, 2016 9:19 pm

Hi,
Thank you so much for your updates.
However please kindly notice that we are working on a completely new approach based on interrupted interaction between PIco and Raspberry Pi, that is going to release this week with the new firmware. This will be based on daemons and will be different form the until now existing pulse train. This approach will be common for the PIco HV1.0, HV1.1 and the new one HV3.0A. This new approach is solving some problems when Raspberry Pi is executing a very high load tasks and has "no time" to generate pulse train, i.e. mass copping files. With this new approach no more such problem will happen.

So, please not spend so much time on this, as it will be changed with the new firmware, with more features, that I'm not able to describe here due to lack of time
Thank you again for your excellent work, just please wait little bit in order to avoid loosing of your time
BR PiM
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
Pimaster
Site Admin
 
Posts: 1618
Joined: Fri Sep 14, 2012 7:50 am

Re: pico scripts on github

Postby pz1 » Wed Jun 29, 2016 10:42 am

Pimaster wrote:Hi,
Thank you so much for your updates.
However please kindly notice that we are working on a completely new approach based on interrupted interaction between PIco and Raspberry Pi, that is going to release this week with the new firmware. This will be based on daemons and will be different form the until now existing pulse train. This approach will be common for the PIco HV1.0, HV1.1 and the new one HV3.0A. This new approach is solving some problems when Raspberry Pi is executing a very high load tasks and has "no time" to generate pulse train, i.e. mass copping files. With this new approach no more such problem will happen.

So, please not spend so much time on this, as it will be changed with the new firmware, with more features, that I'm not able to describe here due to lack of time
Thank you again for your excellent work, just please wait little bit in order to avoid loosing of your time
BR PiM


Please tell me where I can find this new firmware. The download area still has the old flawed 5C version of 25 february 2016.
pz1
 
Posts: 5
Joined: Wed Apr 13, 2016 9:39 am
Location: no

Re: pico scripts on github

Postby Pimaster » Sun Jul 03, 2016 11:34 pm

Hi,
Just released. It is on the 0x60 firmware updates - Top Post. Just the testing version of firmware is called 0xF5.
BR PiM
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
Pimaster
Site Admin
 
Posts: 1618
Joined: Fri Sep 14, 2012 7:50 am


Return to PIco Python and other Tools

Who is online

Users browsing this forum: No registered users and 1 guest