UPiS Status [Python]

Post here your applications done based on UPiS
Share your ideas about new possible applications

UPiS Status [Python]

Postby Kyriacos » Thu Jan 15, 2015 11:13 pm

This is a python script containing some useful functions for monitoring your UPiS status.
For the Advanced users this will be a piece of cake, for new programers it might be useful for their applications.

This is what you get:
TinyGrab Screen Shot 15-01-2015 22.11.16.png
TinyGrab Screen Shot 15-01-2015 22.11.16.png (10.47 KiB) Viewed 4637 times


Source Code:https://github.com/naziris/UPiS-Status

How to set up i²c in Raspbian on the Raspberry Pi: http://raspi.tv/how-to-set-up-i2c-in-raspbian-on-the-raspberry-pi
Last edited by Kyriacos on Sat Jan 17, 2015 1:01 am, edited 1 time in total.
Kyriacos
 
Posts: 10
Joined: Mon Jan 12, 2015 2:10 pm
Location: United Kingdom

Re: UPiS Status [Python]

Postby metaxas4 » Fri Jan 16, 2015 12:58 pm

for new programmers, you have to enable i2c and install python-smbus...
metaxas4
 
Posts: 12
Joined: Tue Dec 09, 2014 1:29 pm

Re: UPiS Status [Python]

Postby Kyriacos » Sat Jan 17, 2015 1:02 am

metaxas4 wrote:for new programmers, you have to enable i2c and install python-smbus...

Thanks for the tip metaxas4, I have also included a related link with instructions ;)
Kyriacos
 
Posts: 10
Joined: Mon Jan 12, 2015 2:10 pm
Location: United Kingdom

Re: UPiS Status [Python]

Postby pi1215 » Sun Feb 01, 2015 6:16 pm

I am new. My problem, I can't execute your script, i have this error:
lsmod
Module Size Used by
i2c_bcm2708 6004 0
i2c_dev 6709 0
snd_bcm2835 21342 0
snd_pcm 93100 1 snd_bcm2835
snd_seq 61097 0
snd_seq_device 7209 1 snd_seq
snd_timer 23007 2 snd_pcm,snd_seq
snd 67211 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
uio_pdrv_genirq 3666 0
uio 9897 1 uio_pdrv_genirq

sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

sudo i2cdetect -y 0
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory

dmesg | grep i2c
[10386.842976] i2c /dev entries driver

Can you help?
pi1215
 
Posts: 2
Joined: Sun Feb 01, 2015 6:05 pm

Re: UPiS Status [Python]

Postby doodieb » Mon Feb 02, 2015 6:36 am

Maybe you are running your Rasp on the latest firmware: The latest firmware implements device tree support. That will have broken things like I2C, SPI, and 1-wire bus.

For fuller details see http://www.raspberrypi.org/forums/viewt ... 58#p675658

Summary
Code: Select all
Add one or more of the following to your /boot/config.txt and reboot.

I2C
Add dtparam=i2c1=on (or dtparam=i2c0=on on old models)

SPI
Add dtparam=spi=on

I2S
Add dtparam=i2s=on

lirc-rpi
Add dtoverlay=lirc-rpi
Add module parameters to the end of the dtoverlay line,
e.g. dtoverlay=lirc-rpi,gpio_in_pin=16,gpio_in_pull=high

w1-gpio
If you require the external pullup
dtoverlay=w1-gpio-pullup,gpiopin=x,pullup=y
otherwise
dtoverlay=w1-gpio-pullup,gpiopin=x
(where x and y are gpios).

Audio card
Add one of the following
dtoverlay=hifiberry-dac
dtoverlay=hifiberry-dacplus
dtoverlay=hifiberry-digi
dtoverlay=iqaudio-dac
dtoverlay=iqaudio-dacplus

heartbeat LED
dtparam=act_led_trigger=heartbeat


Solved the Problem for me
doodieb
 
Posts: 16
Joined: Thu Jan 29, 2015 9:55 pm

Re: UPiS Status [Python]

Postby metaxas4 » Mon Feb 02, 2015 10:25 am

metaxas4
 
Posts: 12
Joined: Tue Dec 09, 2014 1:29 pm

Re: UPiS Status [Python]

Postby pi1215 » Mon Feb 02, 2015 7:35 pm

Sorry, after firmware downgrade:
rpi-update f74b92120e0d469fc5c2dc85b2b5718d877e1cbb

and firware update to UPiS_1.096_beta.hex I can work:

sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 69 6a 6b -- -- -- --
70: -- -- -- -- -- -- -- --
I started your script:
***********************************
* Powering Mode: Raspberry Pi Powering *
* Battery Voltage: 3.75 V *
* RPi Voltage: 4.76 V *
* USB Voltage: 0.05 V *
* EPR Voltage: 0.74 V *
* Current: 00 mA *
* UPiS Firmware: 1.09 *
***********************************
***********************************
* Powering Mode: USB Cable Powering *
* Battery Voltage: 3.73 V *
* RPi Voltage: 4.76 V *
* USB Voltage: 4.84 V *
* EPR Voltage: 0.82 V *
* Current: 651 mA *
* UPiS Firmware: 1.09 *
***********************************
Can you give me more info for the ports?
0x68 - DS1307
0x69 - for ???
0x6a - UPiS Value
0x6b - UPiS Firmware
Give at more values?
pi1215
 
Posts: 2
Joined: Sun Feb 01, 2015 6:05 pm

Re: UPiS Status [Python]

Postby metaxas4 » Tue Feb 03, 2015 10:36 am

clock chip i think.
metaxas4
 
Posts: 12
Joined: Tue Dec 09, 2014 1:29 pm

Re: UPiS Status [Python]

Postby Kyriacos » Tue Feb 03, 2015 11:00 pm

Yeap, 69 is for the RTClock.
Are you facing any kind of problem with the current readings?
Cause with my setup is working properly.
Kyriacos
 
Posts: 10
Joined: Mon Jan 12, 2015 2:10 pm
Location: United Kingdom

Re: UPiS Status [Python]

Postby Pimaster » Fri Feb 06, 2015 7:24 pm

Sorry I missed some posts.

0x69 are copy (so mirror) RTC registers. SO you can read the even if the RTC is used (UU). One feature that somebody request it in the past so we added it.

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: 1593
Joined: Fri Sep 14, 2012 7:50 am

Next

Return to UPiS Users Application

Who is online

Users browsing this forum: No registered users and 1 guest