Feature Request: I2C control of Charger & Read of temp

Uninterruptible Power intelligent Supply Module
Post Reply
microlan
Posts: 6
Joined: Sun Jan 11, 2015 9:28 am

Feature Request: I2C control of Charger & Read of temp

Post by microlan » Sun Jan 11, 2015 10: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

diogoaz
Posts: 5
Joined: Mon Mar 24, 2014 2:18 pm

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

Post by diogoaz » Wed Jan 14, 2015 5: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

Kyriacos
Posts: 10
Joined: Mon Jan 12, 2015 3:10 pm
Location: United Kingdom

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

Post by Kyriacos » Wed Jan 14, 2015 6:52 pm

Me2 cause reading trough Serial is way too slow!

diogoaz
Posts: 5
Joined: Mon Mar 24, 2014 2:18 pm

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

Post by diogoaz » Wed Jan 14, 2015 8: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...

Kyriacos
Posts: 10
Joined: Mon Jan 12, 2015 3:10 pm
Location: United Kingdom

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

Post by Kyriacos » Thu Jan 15, 2015 1: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

microlan
Posts: 6
Joined: Sun Jan 11, 2015 9:28 am

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

Post by microlan » Thu Jan 15, 2015 4: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)

diogoaz
Posts: 5
Joined: Mon Mar 24, 2014 2:18 pm

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

Post by diogoaz » Thu Jan 15, 2015 7: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

microlan
Posts: 6
Joined: Sun Jan 11, 2015 9:28 am

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

Post by microlan » Thu Jan 15, 2015 11: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).

Post Reply