Get power level Artik 710


#1

Hi I have the Artik 710 and it’s powered by a battery and I was wondering how I could use the cw2015 to get the current charge level of the battery.

Thanks!

AJ


#4

I found one resource that tries to suggest using a symbolic link to the cw2015, however this device is not listed on the artik 710.

Do we need to mount specific drivers to use all the i2c devices available?

The original link for this ebook is here.


#5

So I was able to see the cw201x driver with

root@ff4d8ca:/usr/src/app# ls -la /sys/bus/i2c/drivers/cw201x/
total 0
drwxr-xr-x  2 root root    0 Jul 30 19:22 .
drwxr-xr-x 13 root root    0 Jul 30 19:22 ..
lrwxrwxrwx  1 root root    0 Jul 30 19:22 8-0062 -> ../../../../devices/platform/i2c@8/i2c-8/8-0062
--w-------  1 root root 4096 Jul 30 19:22 bind
--w-------  1 root root 4096 Jul 30 19:22 uevent--w-------  1 root root 4096 Jul 30 19:22 unbind

Then I figured out if I change up a bit what the book (quote above) says and do

root@ff4d8ca:/usr/src/app# ls -ls /sys/devices/platform/i2c\@8/i2c-8/8-0062/
total 0
0 -r-------- 1 root root 4096 Jul 30 19:23 charger_status
0 lrwxrwxrwx 1 root root    0 Jul 30 19:23 driver -> ../../../../../bus/i2c/drivers/cw201x0 -r--r--r-- 1 root root 4096 Jul 30 19:23 modalias
0 -r--r--r-- 1 root root 4096 Jul 30 19:23 name
0 lrwxrwxrwx 1 root root    0 Jul 30 19:23 of_node -> ../../../../../firmware/devicetree/base/i2c@8/cw2015@62
0 drwxr-xr-x 2 root root    0 Jul 30 19:23 power0 drwxr-xr-x 4 root root    0 Jul 30 19:23 power_supply
0 lrwxrwxrwx 1 root root    0 Jul 30 19:23 subsystem -> ../../../../../bus/i2c
0 -rw-r--r-- 1 root root 4096 Jul 30 19:23 uevent

Then if i do to get charger status

root@ff4d8ca:/usr/src/app# ls -ls /sys/devices/platform/i2c\@8/i2c-8/8-0062/charger_status0 -r-------- 1 root root 4096 Jul 30 19:23 /sys/devices/platform/i2c@8/i2c-8/8-0062/charger_status

I need to quickly charge some batteries to try this out!