Anyone manage to get the API working?

Hi,

I am not sure how to get started on the python API?
I used - pip3 install sixfab-power-python-api to install the module and then used pip3 install sixfab-power-python-api -U to upgrade as I was getting a “No module named ‘power_api’” Issue.
However, now I can’t seen to run any example as they all give out

File “”, line 1, in
File “/home/pi/.local/lib/python3.7/site-packages/power_api/power_api.py”, line 102, in get_input_temp
raw[PROTOCOL_HEADER_SIZE : COMMAND_SIZE_FOR_INT32 - 2], “big”
TypeError: ‘int’ object is not subscriptable

Problems. Any help and guidance will be appreciated.
Cheers!

I have same problem as you. Let me k ow if you manage to figure it out and I’ll do the same

Out of curiosity do you have a touchscreen attached to your i2c pins? I do and when I disconnect the touchscreen and ssh into the pi instead, it all works perfectly. How can I find out what to do to fix it? I2c addressing?

Hi,

Check this issue in Github. Other people are experiencing the same thing.

Some things to do
1)Upgrade sixfab
pip3 install sixfab-power-python-api -U
2) Add error handling - one of the users on that posts suggested using this


3) Stop this service and see if it works
sudo systemctl stop pms_agent.service

Support by sixfab is really bad. I remember I bought a few of the quectel EC25 4G module hats and they didnt give any help/reply to my emails lol. I might have to move to Witty Pi 3 to set my pi to sleep like I had previously configured.

Will do my best to keep you updated on what I can find!

it works for me after doing the suggested updates above. I had to run it as root though.