You dont need this for WP85.
However, you need to fix a file in release 15 and rebuild yocto. That bug is related to a mismatch in naming in the kernel
Thanks for info @asyal. How much ground work has already been done here in terms of figuring this out? I was having a read through this https://source.sierrawireless.com/resources/legato/linuxoverview/ and digging around on the forums a bit.
We can provide you info on exact file you need to change. You will need to rebuild Yocto
Thanks @asyal! Maybe this is worth putting on the MangOH GitHub somewhere since battery monitoring is such a desirable feature.
The idea is WP85 Release 16 will have this fix. So while we wait for it, we can show what needs to be done for battery service to work. However, opening up for Yocto rebuilding is something that a lot of the community doesnt want to do.
If you’re feeling ambitious, this is the change that @asyal was referring to:
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 44420d1e909..71bbaacdd4d 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -139,6 +139,7 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(health),
POWER_SUPPLY_ATTR(present),
POWER_SUPPLY_ATTR(online),
+ POWER_SUPPLY_ATTR(charging_enabled),
POWER_SUPPLY_ATTR(authentic),
POWER_SUPPLY_ATTR(technology),
POWER_SUPPLY_ATTR(cycle_count),
Thanks @dfrey. I’m usually feeling ambitious unless it’s a particularly seg-faulty day. I’ll give this a try and report back.
Hey all,
I’m still struggling to get the LTC2942 working after rebuilding Yocto and making my own firmware image with swicwe
. I was also sure to enable the kernel module for the LTC in my system definition file and in the C code for the MangOH kernel module. I can see the name of the device at /sys/bus/i2c/devices/0-0064/name
but it does not contain a value. The logs also show the system failing to load the LTC:
[ 21.038547] LTC2941 0-0064: ltc2941 read_reg failed!
[ 21.038577] LTC2941 0-0064: Could not read status register
[ 21.038638] LTC2941: probe of 0-0064 failed with error -107
Is this a sign I still have a problem with my kernel or does this look like something else? I’ve also been sure to test this with a charged battery connected.
Cheers!
Try using i2cdetect
to check what devices are visible on the bus. From memory, I think the command is i2cdetect -y -r 0
where 0 is the bus number.
Looks like nothing is present at 0x0064
.
Are there devices on there that you don’t expect? I’m wondering if it’s at another address. I don’t recall if that chip has a configurable address based on pull-up/down resistors.
Do you have a battery connected to your device?
We have a fully charged battery connected.
If you use a release 15 with no yocto changes but load kernel drivers , what do you see? Can you see the LTC device?
These are all accounted for:
- 0x003a:
swimcu
- 0x0068:
bmi160
(accelerometer) - 0x006b:
bq24190
(battery charger) - 0x0076:
bme280
(temperature/pressure/humidity)
Hey @asyal,
I gave this a go and found the exact same results (logs in a gist: https://gist.github.com/nvandoorn/1baaaaa6b0270b2686f1e1590eb090fc).
What happens when you run this on a Red?
Hehe it seems you read my mind. Trying this now.
Tried on the MangOH Red with release 15 of the firmware followed by a custom Yocto image and neither worked (same errors). I was also sure to load all the correct kernel modules for the MangOH Red (I just built these directly https://github.com/mangOH/mangOH/tree/master/linux_kernel_modules).
what revision of mangoh red are you using?