Feature Request: I2C control of Charger & Read of temp

Uninterruptible Power intelligent Supply Module

Feature Request: I2C control of Charger & Read of temp

Postby microlan » Sun Jan 11, 2015 9:04 am

Hello,

Would it be possible to add the Charger status/control and temperature reading to the I2C registers?

I'm actually writing a kernel module to interface to the UPiS for a project and these functions appear to be missing from the I2C registers.

Thanks
Robert
microlan
 
Posts: 6
Joined: Sun Jan 11, 2015 8:28 am

Re: Feature Request: I2C control of Charger & Read of temp

Postby diogoaz » Wed Jan 14, 2015 4:01 pm

I am also very interested in this, mostly in:

- Power check (battery or USB)
- Read temperature

Any updates on this are appreciated.

;)
D.Az
diogoaz
 
Posts: 5
Joined: Mon Mar 24, 2014 1:18 pm

Re: Feature Request: I2C control of Charger & Read of temp

Postby Kyriacos » Wed Jan 14, 2015 5:52 pm

Me2 cause reading trough Serial is way too slow!
Kyriacos
 
Posts: 10
Joined: Mon Jan 12, 2015 2:10 pm
Location: United Kingdom

Re: Feature Request: I2C control of Charger & Read of temp

Postby diogoaz » Wed Jan 14, 2015 7:05 pm

My problem is not being slow, it is already in use by other modules and applications in my raspberry, so I cannot part or share the serial connection with anything else...
diogoaz
 
Posts: 5
Joined: Mon Mar 24, 2014 1:18 pm

Re: Feature Request: I2C control of Charger & Read of temp

Postby Kyriacos » Thu Jan 15, 2015 12:25 am

diogoaz wrote:My problem is not being slow, it is already in use by other modules and applications in my raspberry, so I cannot part or share the serial connection with anything else...


If you going to have some kind of indication in your apps, readings take about 1 -1.5 minute to load. For an application "slow" is still an issue though
Kyriacos
 
Posts: 10
Joined: Mon Jan 12, 2015 2:10 pm
Location: United Kingdom

Re: Feature Request: I2C control of Charger & Read of temp

Postby microlan » Thu Jan 15, 2015 3:43 am

FYI--once I finish the module (actually a hwmon driver, as that seemed to be the best fit in the Linux driver model), I will release it open source for everyone.

Basically for those not familiar with hwmon drivers, the UPiS will instantiate itself in /sys/class/hwmon (ie, hwmon0). In that directory, files will exist that can be read (and some written) to, to send commands and values to/from the UPiS.

For instance:
cat /sys/class/hwmon/hwmon0/in0_input

will output the battery voltage (in millivolts)

cat /sys/class/hwmon/hwmon0/power_state

will output the current power source

echo 5 > /sys/class/hwmon/hwmon0/watchdog_counter

will set the sta_counter to 5 (5 second watchdog countdown until shutdown)
microlan
 
Posts: 6
Joined: Sun Jan 11, 2015 8:28 am

Re: Feature Request: I2C control of Charger & Read of temp

Postby diogoaz » Thu Jan 15, 2015 6:26 pm

That's actually pretty cool, looking forward for it :)

For some reason, the directory /sys/class/hwmon is not created in my RPi... Any ideas on why this happens?

Take care,
D_Az
diogoaz
 
Posts: 5
Joined: Mon Mar 24, 2014 1:18 pm

Re: Feature Request: I2C control of Charger & Read of temp

Postby microlan » Thu Jan 15, 2015 10:42 pm

diogoaz wrote:That's actually pretty cool, looking forward for it :)

For some reason, the directory /sys/class/hwmon is not created in my RPi... Any ideas on why this happens?

Take care,
D_Az


That directory won't be created by the kernel unless a device driver is loaded that supports the hwmon class. (for instance, when I do modprobe UPiS to load my driver, that directory gets created by the kernel).
microlan
 
Posts: 6
Joined: Sun Jan 11, 2015 8:28 am


Return to UPiS

Who is online

Users browsing this forum: No registered users and 2 guests

cron