How do you watch your battery status?

I am currently hitting :black_circle: - B periodically to watch the reform’s battery status. And I am paranoid to not discharge the batteries deeply.

I have been wondering whether the keyboard firmware could be modified to periodically display / update the battery status.

Or how do you watch your battery status? Am I worrying too much?

1 Like

I do it the same. As I was very busy, I didn’t use the laptop enough and the batteries discharged too deep.
When in use, you can use battery plugins in your favorite DE/WM but when it’s lying around I don’t see much choice other than checking it from time to time.
Maybe the controller can be programmed to hourly show the battery status.
Personally I would be more interested if the drain on tje batterys could be lessened when the laptop is turned off, or is it just in the nature of these type of batteries, anyone knows?

The drain could certainly be slowed down by optimizing the electronics and/or firmware. It has nothing to do with the battery chemistry; LiFePO4 batteries are very good at keeping their charge.

2 Likes

Do you plan to add any features in the future to lower the brightness settings in the bios so that, when it boots, it automatically sets to whatever percentage it is at? With 25% being the lowest setting possible?
That would increase battery life too.

I would really love that in the new MNT Reform device your developing.

If I recall correctly, the display uses the most power on most laptops and/or devices as a whole.

On a more related note, LifePO4 batteries sound very efficient.

@minute maybe it is possible to implement a battery switch somwhere. That way, the user can cut the connection to the batteries without unscrewing the bottom all the time

2 Likes

I wonder whether we could put both the trackball controller and the keyboard controller into deep sleep modes and maybe rewire the circle key in a way to wake it up again? what else does keep running, when the main module is switched off?

1 Like

the battery status does not seem to get exposed in sysfs, at least not via /sys/class/power_supply which most of the status plugins monitor.

How can I access the system controller’s idea of the battery status from linux?

I could provide a kernel patch to do so if someone can point me to the correct docs on how this is supposed to work.

1 Like

The trackball and USB and backlight part of the keyboard are powered by a 5V rail that is already turned off when the laptop is turned off. The first thing to do, before generating any action plans, is to measure all currents flowing in all battery cables, including the monitoring/balancing connections.

The original idea was to make an SPI connection between i.MX and LPC, which physically exists (just take look at the schematics!), but it is not used because I couldn’t get it to work before shipping (couldn’t measure any SPI activity on the lines when poking around with userspace SPI on Linux).

There is a backup solution which is the UART connection between i.MX and LPC:

echo "xUAR1" >/dev/hidraw0

This will enable LPC responses to be output to /dev/ttymxc2. So with screen /dev/ttymxc2 57600 you will get regular strings in this format (~ every 30 seconds):

31 31 31 31 31 31 31 31 mA 0277mV25329  12%

The first 8 columns are cell voltages x10. The last column is the battery gauge. mA and mV are total batterry current and voltage.

turn it off with:

echo "xUAR0" >/dev/hidraw0
2 Likes

Ok, I will have a look at the SPI as well, thank you for adding TPs on those lines :wink:

2 Likes

linux n00b question here, I get a permission error with the echo command, sudo or not. Thanks for any hint.

Two ways to fix that. The first is:

sudo -i
echo "xUAR0" > /dev/hidraw0
exit

The second, neater, way is:

echo "xUAR0" | sudo tee /dev/hidraw0

The first opens a shell as root, which is why you need to exit it. The second doesn’t, so you’re good to go as soon as you hit Enter.

The reason you have to do this rather than just sudo echo "xUAR0" > /dev/hidraw0, which is presumably what you tried the first time, is 'cos there are two commands there: echo and “write that to a file”. You’re running echo as root via sudo, but not “write that to a file” - which runs as your current user.

The second one-liner fixes it 'cos echo runs as your current user but tee - which exists to shove things to both the screen and a file at the same time - runs as root, giving it access.

1 Like

thanks, the first way leads to a root terminal, when typing the command nothing happens. btw i learned how to open a root term, thanks. Nothing happens either for 2nd way.
I probably missed stg here…

What’s the output of ls -l /dev/hidraw0 ?

All that command does is echo something into a file: you won’t see anything happen.

If you want to query the status of the battery, you need:

echo "xUAR1" | sudo tee /dev/hidraw0
screen /dev/ttymxc2 57600

When you’re done watching the numbers scroll past, one line every 30 seconds, press Ctrl+A then type a \ - that’ll close Screen.

Or if all you actually want to do is know how much charge you’ve got left, forget all this faffing around and press the Circle button followed by B to view the battery status on the OLED.

1 Like

Using this “spying” could be another way to do what I suggested here. Shell script based, no need touching the LPC code.