Connected but No Data

I have confirmed, that on a clean install I get the same error message as before. [Errno 98]
I willing to help in any way I can, my Linux skills are a bit rusty though.

Hi,

Could you share the logs of the power_request service? This service is responsible for sending data to the power software.

Hi Kev,

from the description given for Errno 98, it looks like something else on your system is already using port 6060 (the port that the power server tries to connect to).

In your terminal can you enter:
sudo lsof -i -P -n
To list what ports are being used on your system.

Besides the trouble that you’re facing with Errno 98, I’ve also found that the fix above is slightly outdated, the up to date version is:

# create user power, add power to the groups: sudo, i2c, video
sudo adduser power
sudo adduser power sudo
sudo adduser power i2c
sudo adduser power video

# edit /etc/sudoers and at the end of the file insert a line with the following content: "power ALL=(ALL) NOPASSWD:ALL".
echo "power ALL=(ALL) NOPASSWD:ALL"|sudo EDITOR='tee -a' visudo

sudo systemctl stop power_agent
sudo systemctl stop power_request
sudo sed -i 's/^\(User=\).*/\1power/' /etc/systemd/system/power_agent.service
sudo sed -i 's/^\(User=\).*/\1power/' /etc/systemd/system/power_request.service
sudo systemctl start power_agent
sudo systemctl start power_request

Hope this helps!
Kind regards,
Daniel

EDIT:
I should add that at this point you should no longer have to run the python script I directed to earlier.

Also, in case you’re unsure how to get the logs that Ensar has asked for, you can use command:
journalctl -u power_request.service

Thank you Daniel, I had an issue editing the sudoers file the last time. I think the last time I was unsure if i was correctly entering the command as you instructed.
I tried to add two lines to the bottom of the file like so:

"power ALL=(ALL) NOPASSWD:ALL".
echo "power ALL=(ALL) NOPASSWD:ALL"|sudo EDITOR='tee -a' visudo

Please forgive my ignorance but I tried it a few different ways, it comes up with an error that I broke the sudoers file.

Here is the result of “sudo lsof -i -P -n”:

pi@raspberrypi:~ $ sudo lsof -i -P -n
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
avahi-dae  409 avahi   12u  IPv4  13188      0t0  UDP *:5353 
avahi-dae  409 avahi   13u  IPv6  13189      0t0  UDP *:5353 
avahi-dae  409 avahi   14u  IPv4  13190      0t0  UDP *:57432 
avahi-dae  409 avahi   15u  IPv6  13191      0t0  UDP *:48739 
cupsd      489  root    6u  IPv6  19546      0t0  TCP [::1]:631 (LISTEN)
cupsd      489  root    7u  IPv4  19547      0t0  TCP 127.0.0.1:631 (LISTEN)
dhcpcd     497  root   13u  IPv4  21527      0t0  UDP *:68 
dhcpcd     497  root   17u  IPv6  21546      0t0  UDP *:546 
cups-brow  517  root    7u  IPv4  17760      0t0  UDP *:631 
teamviewe 2281  root   15u  IPv4  28276      0t0  TCP 127.0.0.1:5939 (LISTEN)
teamviewe 2281  root   19u  IPv6  29273      0t0  TCP [2600:6c4a:1b3f:b204:7622:9136:d1ab:ae90]:41942->[2607:f0d0:1c01:a5::a]:5938 (ESTABLISHED)
teamviewe 2281  root   20u  IPv4  29269      0t0  TCP 127.0.0.1:5939->127.0.0.1:35446 (ESTABLISHED)
teamviewe 2281  root   21u  IPv6  37302      0t0  TCP [2600:6c4a:1b3f:b204:7622:9136:d1ab:ae90]:58580->[2605:380:55:351:188:172:221:69]:5938 (ESTABLISHED)
teamviewe 2281  root   22u  IPv4  30346      0t0  TCP 127.0.0.1:5939->127.0.0.1:35452 (ESTABLISHED)
teamviewe 2281  root   26u  IPv4  32811      0t0  UDP *:58109 
teamviewe 2281  root   29u  IPv6  87441      0t0  TCP [2600:6c4a:1b3f:b204:7622:9136:d1ab:ae90]:34108->[2605:380:55:351:188:172:221:76]:5938 (ESTABLISHED)
TeamViewe 2328    pi   22u  IPv4  29268      0t0  TCP 127.0.0.1:35446->127.0.0.1:5939 (ESTABLISHED)
TeamViewe 3207    pi   13u  IPv4  30345      0t0  TCP 127.0.0.1:35452->127.0.0.1:5939 (ESTABLISHED)
python3   8667    pi    4u  IPv4  45682      0t0  TCP *:6060 (LISTEN)
python3   8667    pi    5u  IPv4  86578      0t0  TCP 127.0.0.1:6060->127.0.0.1:56832 (ESTABLISHED)
python3   8671    pi    5u  IPv4  45829      0t0  TCP 192.168.26.10:38265->34.86.151.86:1883 (ESTABLISHED)
python3   8671    pi    6u  IPv4  45803      0t0  TCP 127.0.0.1:34778->127.0.0.1:44181 (ESTABLISHED)
python3   8671    pi    7u  IPv4  45804      0t0  TCP 127.0.0.1:44181->127.0.0.1:34778 (ESTABLISHED)
python3   8671    pi    8u  IPv4  84705      0t0  TCP 127.0.0.1:56832->127.0.0.1:6060 (ESTABLISHED)

I don’t see anything that looks like it is using port 6060, though I am not sure. This is a fresh install, I have the official pi touchscreen connected, and i have the sixfab power hat, as well as the sixfab 4g/lte hat with quectel card. Also this time I am using teamviewer, but was having the problem beforehand.

Hi Kev,

In future you can forego editing the file via command if you’re having issues with it:

sudo nano /etc/sudoers

Will allow you to edit the file in the nano editor :slight_smile:

From the looks of things here it seems that a python process (most likely the Power server running as user ‘pi’ - which depending on whether or not you have pi set up as a user could be the route of this issue).

Could you first grab the information from the power_request.service using the command:

journalctl -u power_request.service

and post that here, then if you have rebooted the pi since your last post you’ll need to find the PID (Process ID) again:

sudo lsof -i -P -n | grep LISTEN

And find the port status that has the name: *:6060 (LISTEN)
End this process using:

kill <PID here>

And then run the python3 command from earlier again and post the result here.

It may also be handy to double check the variables in the .service configuration files:

sudo nano /etc/systemd/system/power_agent.service
sudo nano /etc/systemd/system/power_request.service

Here you’ll want to ensure that the variable User is set to ‘power’, rather than ‘pi’.

Regards,
Daniel

Sorry I did not see that previously, here is the result of “journalctl -u power_request.service”

-- Logs begin at Thu 2021-02-18 07:20:27 EST, end at Thu 2021-02-18 16:17:15 EST. --
Feb 18 09:57:30 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 09:57:30 raspberrypi python3[8485]:  * Serving Flask app "src" (lazy loading)
Feb 18 09:57:30 raspberrypi python3[8485]:  * Environment: production
Feb 18 09:57:30 raspberrypi python3[8485]:    WARNING: This is a development server. Do not use it
Feb 18 09:57:30 raspberrypi python3[8485]:    Use a production WSGI server instead.
Feb 18 09:57:30 raspberrypi python3[8485]:  * Debug mode: off
Feb 18 09:57:30 raspberrypi python3[8485]:  * Running on http://0.0.0.0:6060/ (Press CTRL+C to qui
Feb 18 09:57:45 raspberrypi systemd[1]: Stopping Sixfab UPS HAT Distributed API...
Feb 18 09:57:45 raspberrypi systemd[1]: power_request.service: Main process exited, code=killed, s
Feb 18 09:57:45 raspberrypi systemd[1]: power_request.service: Succeeded.
Feb 18 09:57:45 raspberrypi systemd[1]: Stopped Sixfab UPS HAT Distributed API.
Feb 18 09:57:45 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 09:57:46 raspberrypi python3[8667]:  * Serving Flask app "src" (lazy loading)
Feb 18 09:57:46 raspberrypi python3[8667]:  * Environment: production
Feb 18 09:57:46 raspberrypi python3[8667]:    WARNING: This is a development server. Do not use it
Feb 18 09:57:46 raspberrypi python3[8667]:    Use a production WSGI server instead.
Feb 18 09:57:46 raspberrypi python3[8667]:  * Debug mode: off
Feb 18 09:57:46 raspberrypi python3[8667]:  * Running on http://0.0.0.0:6060/ (Press CTRL+C to qui
Feb 18 09:58:04 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:58:04] "GET /metrics/vers
Feb 18 09:58:17 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:58:17] "GET /signals/soft
Feb 18 09:58:30 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:58:30] "GET /signals/soft
Feb 18 09:58:43 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:58:43] "GET /signals/syst
Feb 18 09:58:55 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:58:55] "GET /metrics/vers
Feb 18 09:59:08 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:59:08] "GET /metrics/fan/
Feb 18 09:59:21 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:59:21] "GET /metrics/work
Feb 18 09:59:34 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:59:34] "POST /configurati
Feb 18 09:59:47 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:59:47] "GET /signals/soft
Feb 18 09:59:59 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 09:59:59] "GET /signals/soft
Feb 18 10:00:12 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:00:12] "GET /signals/syst
Feb 18 10:00:25 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:00:25] "GET /metrics/vers
Feb 18 10:00:38 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:00:38] "GET /metrics/fan/
Feb 18 10:00:51 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:00:51] "GET /metrics/work
Feb 18 10:01:04 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:01:04] "GET /signals/soft
Feb 18 10:01:16 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:01:16] "GET /signals/soft
Feb 18 10:01:29 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:01:29] "GET /signals/syst
Feb 18 10:01:42 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:01:42] "GET /metrics/vers
Feb 18 10:01:55 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:01:55] "GET /metrics/fan/
Feb 18 10:02:08 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:02:08] "GET /metrics/work
Feb 18 10:02:20 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:02:20] "GET /signals/soft
Feb 18 10:02:33 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:02:33] "GET /signals/soft
Feb 18 10:02:46 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:02:46] "GET /signals/syst
Feb 18 10:02:59 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:02:59] "GET /metrics/vers
Feb 18 10:03:12 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:03:12] "GET /metrics/fan/
Feb 18 10:03:25 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:03:25] "GET /metrics/work
Feb 18 10:03:37 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:03:37] "GET /signals/soft
Feb 18 10:03:50 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:03:50] "GET /signals/soft
Feb 18 10:04:03 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:04:03] "GET /signals/syst
Feb 18 10:04:16 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:04:16] "GET /metrics/vers
Feb 18 10:04:29 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:04:29] "GET /metrics/fan/
Feb 18 10:04:41 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:04:41] "GET /metrics/work
Feb 18 10:04:54 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:04:54] "GET /signals/soft
Feb 18 10:05:07 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:05:07] "GET /signals/soft
Feb 18 10:05:20 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:05:20] "GET /signals/syst
Feb 18 10:05:33 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:05:33] "GET /metrics/vers
Feb 18 10:05:45 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:05:45] "GET /metrics/fan/
Feb 18 10:05:58 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:05:58] "GET /metrics/work
Feb 18 10:06:11 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:06:11] "GET /signals/soft
Feb 18 10:06:24 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:06:24] "GET /signals/soft
Feb 18 10:06:37 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:06:37] "GET /signals/syst
Feb 18 10:06:49 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:06:49] "GET /metrics/vers
Feb 18 10:07:02 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:07:02] "GET /metrics/fan/
Feb 18 10:07:15 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:07:15] "GET /metrics/work
Feb 18 10:07:28 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:07:28] "GET /signals/soft
Feb 18 10:07:41 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:07:41] "GET /signals/soft
Feb 18 10:07:53 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:07:53] "GET /signals/syst
Feb 18 10:08:06 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:08:06] "GET /metrics/vers
Feb 18 10:08:19 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:08:19] "GET /metrics/fan/
Feb 18 10:08:32 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:08:32] "GET /metrics/work
Feb 18 10:08:45 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:08:45] "GET /signals/soft
Feb 18 10:08:57 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:08:57] "GET /signals/soft
Feb 18 10:09:10 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:09:10] "GET /signals/syst
Feb 18 10:09:23 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:09:23] "GET /metrics/vers
Feb 18 10:09:36 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:09:36] "GET /metrics/fan/
Feb 18 10:09:49 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:09:49] "GET /metrics/work
Feb 18 10:10:01 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:10:01] "GET /signals/soft
Feb 18 10:10:14 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:10:14] "GET /signals/soft
Feb 18 10:10:27 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:10:27] "GET /signals/syst
Feb 18 10:10:40 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:10:40] "GET /metrics/vers
Feb 18 10:10:53 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:10:53] "GET /metrics/fan/
Feb 18 10:11:05 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:11:05] "GET /metrics/work
Feb 18 10:11:18 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:11:18] "GET /signals/soft
Feb 18 10:11:31 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:11:31] "GET /signals/soft
Feb 18 10:11:44 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:11:44] "GET /signals/syst
Feb 18 10:11:57 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:11:57] "GET /metrics/vers
Feb 18 10:12:10 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:12:10] "GET /metrics/fan/
Feb 18 10:12:22 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:12:22] "GET /metrics/work
Feb 18 10:12:35 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:12:35] "GET /signals/soft
Feb 18 10:12:48 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:12:48] "GET /signals/soft
Feb 18 10:13:01 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:13:01] "GET /signals/syst
Feb 18 10:13:14 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:13:14] "GET /metrics/vers
Feb 18 10:13:26 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:13:26] "GET /metrics/fan/
Feb 18 10:13:39 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:13:39] "GET /metrics/work
Feb 18 10:13:52 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:13:52] "GET /signals/soft
Feb 18 10:14:05 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:14:05] "GET /signals/soft
Feb 18 10:14:18 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:14:18] "GET /signals/syst
Feb 18 10:14:30 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:14:30] "GET /metrics/vers
Feb 18 10:14:43 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:14:43] "GET /metrics/fan/
Feb 18 10:14:56 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:14:56] "GET /metrics/work
Feb 18 10:15:09 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:15:09] "GET /signals/soft
Feb 18 10:15:22 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:15:22] "GET /signals/soft
Feb 18 10:15:35 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:15:35] "GET /signals/syst
Feb 18 10:15:47 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:15:47] "GET /metrics/vers
Feb 18 10:16:00 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:16:00] "GET /metrics/fan/
Feb 18 10:16:13 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:16:13] "GET /metrics/work
Feb 18 10:16:26 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:16:26] "GET /signals/soft
Feb 18 10:16:39 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:16:39] "GET /signals/soft
Feb 18 10:16:51 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:16:51] "GET /signals/syst
Feb 18 10:17:04 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:17:04] "GET /metrics/vers
Feb 18 10:17:17 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:17:17] "GET /metrics/fan/
Feb 18 10:17:30 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:17:30] "GET /metrics/work
Feb 18 10:17:43 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:17:43] "GET /signals/soft
Feb 18 10:17:55 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:17:55] "GET /signals/soft
Feb 18 10:18:08 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:18:08] "GET /signals/syst
Feb 18 10:18:21 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:18:21] "GET /metrics/vers
Feb 18 10:18:34 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:18:34] "GET /metrics/fan/
Feb 18 10:18:47 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:18:47] "GET /metrics/work
Feb 18 10:19:00 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:19:00] "GET /signals/soft
Feb 18 10:19:12 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:19:12] "GET /signals/soft
Feb 18 10:19:25 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:19:25] "GET /signals/syst
Feb 18 10:19:38 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:19:38] "GET /metrics/vers
Feb 18 10:19:51 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:19:51] "GET /metrics/fan/
Feb 18 10:20:04 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:20:04] "GET /metrics/work
Feb 18 10:20:16 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:20:16] "GET /signals/soft
Feb 18 10:20:29 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:20:29] "GET /signals/soft
Feb 18 10:20:42 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:20:42] "GET /signals/syst
Feb 18 10:20:55 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:20:55] "GET /metrics/vers
Feb 18 10:21:08 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:21:08] "GET /metrics/fan/
Feb 18 10:21:20 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:21:20] "GET /metrics/work
Feb 18 10:21:33 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:21:33] "GET /signals/soft
Feb 18 10:21:46 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:21:46] "GET /signals/soft
Feb 18 10:21:59 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:21:59] "GET /signals/syst
Feb 18 10:22:12 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:22:12] "GET /metrics/vers
Feb 18 10:22:25 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:22:25] "GET /metrics/fan/
Feb 18 10:22:37 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:22:37] "GET /metrics/work
Feb 18 10:22:50 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:22:50] "GET /signals/soft
Feb 18 10:23:03 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:23:03] "GET /signals/soft
Feb 18 10:23:16 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:23:16] "GET /signals/syst
Feb 18 10:23:29 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:23:29] "GET /metrics/vers
Feb 18 10:23:41 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:23:41] "GET /metrics/fan/
Feb 18 10:23:54 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:23:54] "GET /metrics/work
Feb 18 10:24:07 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:24:07] "GET /signals/soft
Feb 18 10:24:20 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:24:20] "GET /signals/soft
Feb 18 10:24:33 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:24:33] "GET /signals/syst
Feb 18 10:24:45 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:24:45] "GET /metrics/vers
Feb 18 10:24:58 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:24:58] "GET /metrics/fan/
Feb 18 10:25:11 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:25:11] "GET /metrics/work
Feb 18 10:25:24 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:25:24] "GET /signals/soft
Feb 18 10:25:37 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:25:37] "GET /signals/soft
Feb 18 10:25:49 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:25:49] "GET /signals/syst
Feb 18 10:26:02 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:26:02] "GET /metrics/vers
Feb 18 10:26:15 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:26:15] "GET /metrics/fan/
Feb 18 10:26:28 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:26:28] "GET /metrics/work
Feb 18 10:26:41 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:26:41] "GET /signals/soft
Feb 18 10:26:54 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:26:54] "GET /signals/soft
Feb 18 10:27:06 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:27:06] "GET /signals/syst
Feb 18 10:27:19 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:27:19] "GET /metrics/vers
Feb 18 10:27:32 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:27:32] "GET /metrics/fan/
Feb 18 10:27:45 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:27:45] "GET /metrics/work
Feb 18 10:27:58 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:27:58] "GET /signals/soft
Feb 18 10:28:10 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:28:10] "GET /signals/soft
Feb 18 10:28:23 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:28:23] "GET /signals/syst
Feb 18 10:28:36 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:28:36] "GET /metrics/vers
Feb 18 10:28:49 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:28:49] "GET /metrics/fan/
Feb 18 10:29:02 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:29:02] "GET /metrics/work
Feb 18 10:29:14 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:29:14] "GET /signals/soft
Feb 18 10:29:27 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:29:27] "GET /signals/soft
Feb 18 10:29:38 raspberrypi python3[8667]: error in 0
Feb 18 10:29:38 raspberrypi python3[8667]: error in 0
Feb 18 10:29:38 raspberrypi python3[8667]: error in 0
Feb 18 10:29:38 raspberrypi python3[8667]: error in 0
Feb 18 10:29:40 raspberrypi python3[8667]: error in 0127.0.0.1 - - [18/Feb/2021 10:29:40] "GET /si
Feb 18 10:29:53 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:29:53] "GET /metrics/vers
Feb 18 10:30:06 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:30:06] "GET /metrics/fan/
Feb 18 10:30:18 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:30:18] "GET /metrics/work
Feb 18 10:30:31 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:30:31] "GET /signals/soft
Feb 18 10:30:44 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:30:44] "GET /signals/soft
Feb 18 10:30:57 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:30:57] "GET /signals/syst
Feb 18 10:31:10 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:31:10] "GET /metrics/vers
Feb 18 10:31:22 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:31:22] "GET /metrics/fan/
Feb 18 10:31:35 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:31:35] "GET /metrics/work
Feb 18 10:31:48 raspberrypi python3[8667]: 127.0.0.1 - - [18/Feb/2021 10:31:48] "GET /signals/soft

It seems to repeat from that point on.
Thanks for the helpful info on using nano. I will give that a try right now.

Ok, I have had some success this time, I was misunderstanding how to add the lines of code do the sudoers fiile but i figured it out.

I was able to do this without any errors, I then went to power.sixfab.com and added a new device and downloaded the script. here is the output of those commands:

pi@raspberrypi:~ $ sudo lsof -i -P -n
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
avahi-dae  394 avahi   12u  IPv4  17912      0t0  UDP *:5353 
avahi-dae  394 avahi   13u  IPv6  17913      0t0  UDP *:5353 
avahi-dae  394 avahi   14u  IPv4  17914      0t0  UDP *:52183 
avahi-dae  394 avahi   15u  IPv6  17915      0t0  UDP *:50322 
cupsd      424  root    6u  IPv6  15342      0t0  TCP [::1]:631 (LISTEN)
cupsd      424  root    7u  IPv4  15343      0t0  TCP 127.0.0.1:631 (LISTEN)
dhcpcd     465  root   10u  IPv4  19703      0t0  UDP *:68 
dhcpcd     465  root   16u  IPv6  20060      0t0  UDP *:546 
cups-brow  502  root    7u  IPv4  18203      0t0  UDP *:631 
teamviewe  532  root   14u  IPv4  18804      0t0  TCP 127.0.0.1:5939 (LISTEN)
teamviewe  532  root   18u  IPv6  22590      0t0  TCP [2600:6c4a:1b3f:b200:a7ed:d829:5f8f:ca21]:37426->[2607:f0d0:3901:54::d]:443 (ESTABLISHED)
teamviewe  532  root   19u  IPv6  29547      0t0  TCP [2600:6c4a:1b3f:b200:a7ed:d829:5f8f:ca21]:51914->[2605:380:55:351:188:172:221:74]:443 (ESTABLISHED)
teamviewe  532  root   20u  IPv4  30591      0t0  TCP 127.0.0.1:5939->127.0.0.1:56064 (ESTABLISHED)
teamviewe  532  root   21u  IPv4  29552      0t0  TCP 127.0.0.1:5939->127.0.0.1:56062 (ESTABLISHED)
teamviewe  532  root   27u  IPv4  32448      0t0  UDP *:60601 
TeamViewe 2048    pi   13u  IPv4  33323      0t0  TCP 127.0.0.1:56062->127.0.0.1:5939 (ESTABLISHED)
TeamViewe 2060    pi   22u  IPv4  32446      0t0  TCP 127.0.0.1:56064->127.0.0.1:5939 (ESTABLISHED)
pi@raspberrypi:~ $ journalctl -u power_request.service
-- Logs begin at Thu 2019-02-14 05:11:59 EST, end at Thu 2021-02-18 19:50:53 EST. --
Feb 18 19:44:35 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 19:44:38 raspberrypi python3[381]: Traceback (most recent call last):
Feb 18 19:44:38 raspberrypi python3[381]:   File "/opt/sixfab/pms/api/run_server.py", line 1, in <module>
Feb 18 19:44:38 raspberrypi python3[381]:     from src.main import app
Feb 18 19:44:38 raspberrypi python3[381]:   File "/opt/sixfab/pms/api/src/main.py", line 1, in <module>
Feb 18 19:44:38 raspberrypi python3[381]:     from .urls import urls
Feb 18 19:44:38 raspberrypi python3[381]:   File "/opt/sixfab/pms/api/src/urls.py", line 1, in <module>
Feb 18 19:44:38 raspberrypi python3[381]:     from .resources import getters
Feb 18 19:44:38 raspberrypi python3[381]:   File "/opt/sixfab/pms/api/src/resources/__init__.py", line 1, in <module>
Feb 18 19:44:38 raspberrypi python3[381]:     from .getters import *
Feb 18 19:44:38 raspberrypi python3[381]:   File "/opt/sixfab/pms/api/src/resources/getters.py", line 2, in <module>
Feb 18 19:44:38 raspberrypi python3[381]:     from ..core import hat_api
Feb 18 19:44:38 raspberrypi python3[381]:   File "/opt/sixfab/pms/api/src/core.py", line 3, in <module>
Feb 18 19:44:38 raspberrypi python3[381]:     from power_api import SixfabPower
Feb 18 19:44:38 raspberrypi python3[381]: ModuleNotFoundError: No module named 'power_api'
Feb 18 19:44:38 raspberrypi systemd[1]: power_request.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 19:44:38 raspberrypi systemd[1]: power_request.service: Failed with result 'exit-code'.
pi@raspberrypi:~ $ sudo lsof -i -P -n | grep LISTEN
cupsd      424  root    6u  IPv6  15342      0t0  TCP [::1]:631 (LISTEN)
cupsd      424  root    7u  IPv4  15343      0t0  TCP 127.0.0.1:631 (LISTEN)
teamviewe  532  root   14u  IPv4  18804      0t0  TCP 127.0.0.1:5939 (LISTEN)
pi@raspberrypi:~ $ python3 /opt/sixfab/pms/api/run_server.py
 * Serving Flask app "src" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:6060/ (Press CTRL+C to quit)

In both files, the user is set to power. :slight_smile:

This is looking like good progress! :slight_smile:

It seems that during re-installation some issues have arisen with the python package: sixfab-power-python-api. To check this can you open a terminal and start a python session using command:

python3

once the session has started enter after the >>:

from power_api import SixfabPower

If this gives you the ModuleNotFoundError, you’ll need to install the python package again.
To exit the python session:

exit()

To install power-api:

python3 -m pip install sixfab-power-python-api

When you’ve done this reboot the pi and then run through the following:

  • check listening ports (You only need to use the version of the lsof command that has the GREP LISTEN part on the end, this filters the list of ports to only show the ones listening for incoming connections)
  • check journalctl for power_requests.service
  • if you have port 6060 running you might be able to find some additional information by opening the chromium browser and entering: http://172.0.0.1:6060 into the URL bar (172.0.0.1 is what’s know as the ‘home’ or ‘self’ IP address :slight_smile: )

Regards,
Daniel

pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from power_api import SixfabPower
>>> exit()
pi@raspberrypi:~ $ python3 -m pip install sixfab-power-python-api
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: sixfab-power-python-api in ./.local/lib/python3.7/site-packages (0.2.2)
Requirement already satisfied: smbus2==0.3.0 in /usr/local/lib/python3.7/dist-packages (from sixfab-power-python-api) (0.3.0)
Requirement already satisfied: crc16==0.1.1 in /usr/local/lib/python3.7/dist-packages (from sixfab-power-python-api) (0.1.1)
Requirement already satisfied: vcgencmd==0.1.1 in /usr/local/lib/python3.7/dist-packages (from sixfab-power-python-api) (0.1.1)
pi@raspberrypi:~ $ 
pi@raspberrypi:~ $ sudo lsof -i -P -n | grep LISTEN
cupsd      425  root    6u  IPv6  19482      0t0  TCP [::1]:631 (LISTEN)
cupsd      425  root    7u  IPv4  19483      0t0  TCP 127.0.0.1:631 (LISTEN)
teamviewe  520  root   13u  IPv4  17715      0t0  TCP 127.0.0.1:5939 (LISTEN)
pi@raspberrypi:~ $ journalctl -u power_request.service
-- Logs begin at Thu 2019-02-14 05:11:59 EST, end at Thu 2021-02-18 21:03:07 EST
Feb 18 20:57:50 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 20:57:53 raspberrypi python3[372]: Traceback (most recent call last):
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/run_server
Feb 18 20:57:53 raspberrypi python3[372]:     from src.main import app
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/main.p
Feb 18 20:57:53 raspberrypi python3[372]:     from .urls import urls
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/urls.p
Feb 18 20:57:53 raspberrypi python3[372]:     from .resources import getters
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resour
Feb 18 20:57:53 raspberrypi python3[372]:     from .getters import *
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resour
Feb 18 20:57:53 raspberrypi python3[372]:     from ..core import hat_api
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/core.p
Feb 18 20:57:53 raspberrypi python3[372]:     from power_api import SixfabPower
Feb 18 20:57:53 raspberrypi python3[372]: ModuleNotFoundError: No module named '
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Main process exit
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Failed with resul
lines 1-18/18 (END)
























-- Logs begin at Thu 2019-02-14 05:11:59 EST, end at Thu 2021-02-18 21:03:07 EST. --
Feb 18 20:57:50 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 20:57:53 raspberrypi python3[372]: Traceback (most recent call last):
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/run_server.py", line 1, 
Feb 18 20:57:53 raspberrypi python3[372]:     from src.main import app
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/main.py", line 1, in
Feb 18 20:57:53 raspberrypi python3[372]:     from .urls import urls
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/urls.py", line 1, in
Feb 18 20:57:53 raspberrypi python3[372]:     from .resources import getters
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resources/__init__.p
Feb 18 20:57:53 raspberrypi python3[372]:     from .getters import *
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resources/getters.py
Feb 18 20:57:53 raspberrypi python3[372]:     from ..core import hat_api
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/core.py", line 3, in
Feb 18 20:57:53 raspberrypi python3[372]:     from power_api import SixfabPower
Feb 18 20:57:53 raspberrypi python3[372]: ModuleNotFoundError: No module named 'power_api'
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Main process exited, code=exite
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Failed with result 'exit-code'.
~

This is looking less encouraging… it seems for some reason power_api isn’t becoming accessible in time for the server start.

If you try starting the server using the python command:

python3 /opt/sixfab/pms/api/run_server.py

Last time you did this everything seemed to start fine, can you check and see if the online power service is receiving your device’s information when you run the server this way?

Regards,
Daniel

> pi@raspberrypi:~ $ python3 /opt/sixfab/pms/api/run_server.py
>  * Serving Flask app "src" (lazy loading)
>  * Environment: production
>    WARNING: This is a development server. Do not use it in a production deployment.
>    Use a production WSGI server instead.
>  * Debug mode: off
>  * Running on http://0.0.0.0:6060/ (Press CTRL+C to quit)
> pi@raspberrypi:~ $ sudo lsof -i -P -n | grep LISTEN
> cupsd      425  root    6u  IPv6  19482      0t0  TCP [::1]:631 (LISTEN)
> cupsd      425  root    7u  IPv4  19483      0t0  TCP 127.0.0.1:631 (LISTEN)
> teamviewe  520  root   13u  IPv4  17715      0t0  TCP 127.0.0.1:5939 (LISTEN)
> python3   5420    pi    4u  IPv4  97180      0t0  TCP *:6060 (LISTEN)
> pi@raspberrypi:~ $ journalctl -u power_request.service
> -- Logs begin at Thu 2019-02-14 05:11:59 EST, end at Thu 2021-02-18 21:28:46 EST. --
> Feb 18 20:57:50 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
> Feb 18 20:57:53 raspberrypi python3[372]: Traceback (most recent call last):
> Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/run_server.py", line 1, in <module>
> Feb 18 20:57:53 raspberrypi python3[372]:     from src.main import app
> Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/main.py", line 1, in <module>
> Feb 18 20:57:53 raspberrypi python3[372]:     from .urls import urls
> Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/urls.py", line 1, in <module>
> Feb 18 20:57:53 raspberrypi python3[372]:     from .resources import getters
> Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resources/__init__.py", line 1, in <module>
> Feb 18 20:57:53 raspberrypi python3[372]:     from .getters import *
> Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resources/getters.py", line 2, in <module>
> Feb 18 20:57:53 raspberrypi python3[372]:     from ..core import hat_api
> Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/core.py", line 3, in <module>
> Feb 18 20:57:53 raspberrypi python3[372]:     from power_api import SixfabPower
> Feb 18 20:57:53 raspberrypi python3[372]: ModuleNotFoundError: No module named 'power_api'
> Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Main process exited, code=exited, status=1/FAILURE
> Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Failed with result 'exit-code'.

I’m not sure what the problem is, am I supposed to start it manually every time? I have to keep that terminal open otherwise it shuts down.

Its been about 5 minutes now manually running the server, and it doesn’t show up in the online power service.

Ok I ran the command with the token that i first ran when i installed and the server is started on its on now, but seems there is still an issue with it.

pi@raspberrypi:~ $ sudo lsof -i -P -n | grep LISTEN
cupsd      425  root    6u  IPv6  19482      0t0  TCP [::1]:631 (LISTEN)
cupsd      425  root    7u  IPv4  19483      0t0  TCP 127.0.0.1:631 (LISTEN)
teamviewe  520  root   13u  IPv4  17715      0t0  TCP 127.0.0.1:5939 (LISTEN)
python3   8115 power    4u  IPv4 144784      0t0  TCP *:6060 (LISTEN)
pi@raspberrypi:~ $ journalctl -u power_request.service
-- Logs begin at Thu 2019-02-14 05:11:59 EST, end at Thu 2021-02-18 21:37:13 EST
Feb 18 20:57:50 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 20:57:53 raspberrypi python3[372]: Traceback (most recent call last):
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/run_server
Feb 18 20:57:53 raspberrypi python3[372]:     from src.main import app
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/main.p
Feb 18 20:57:53 raspberrypi python3[372]:     from .urls import urls
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/urls.p
Feb 18 20:57:53 raspberrypi python3[372]:     from .resources import getters
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resour
Feb 18 20:57:53 raspberrypi python3[372]:     from .getters import *
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resour
Feb 18 20:57:53 raspberrypi python3[372]:     from ..core import hat_api
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/core.p
Feb 18 20:57:53 raspberrypi python3[372]:     from power_api import SixfabPower
Feb 18 20:57:53 raspberrypi python3[372]: ModuleNotFoundError: No module named '
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Main process exit
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Failed with resul
Feb 18 21:36:27 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 21:36:28 raspberrypi python3[8115]:  * Serving Flask app "src" (lazy load
Feb 18 21:36:28 raspberrypi python3[8115]:  * Environment: production
Feb 18 21:36:28 raspberrypi python3[8115]:    WARNING: This is a development ser
Feb 18 21:36:28 raspberrypi python3[8115]:    Use a production WSGI server inste
lines 1-23...skipping...
-- Logs begin at Thu 2019-02-14 05:11:59 EST, end at Thu 2021-02-18 21:37:13 EST. --
Feb 18 20:57:50 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 20:57:53 raspberrypi python3[372]: Traceback (most recent call last):
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/run_server.py", line 1, in <module>
Feb 18 20:57:53 raspberrypi python3[372]:     from src.main import app
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/main.py", line 1, in <module>
Feb 18 20:57:53 raspberrypi python3[372]:     from .urls import urls
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/urls.py", line 1, in <module>
Feb 18 20:57:53 raspberrypi python3[372]:     from .resources import getters
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resources/__init__.py", line 1, in <module>
Feb 18 20:57:53 raspberrypi python3[372]:     from .getters import *
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/resources/getters.py", line 2, in <module>
Feb 18 20:57:53 raspberrypi python3[372]:     from ..core import hat_api
Feb 18 20:57:53 raspberrypi python3[372]:   File "/opt/sixfab/pms/api/src/core.py", line 3, in <module>
Feb 18 20:57:53 raspberrypi python3[372]:     from power_api import SixfabPower
Feb 18 20:57:53 raspberrypi python3[372]: ModuleNotFoundError: No module named 'power_api'
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 20:57:53 raspberrypi systemd[1]: power_request.service: Failed with result 'exit-code'.
Feb 18 21:36:27 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 21:36:28 raspberrypi python3[8115]:  * Serving Flask app "src" (lazy loading)
Feb 18 21:36:28 raspberrypi python3[8115]:  * Environment: production
Feb 18 21:36:28 raspberrypi python3[8115]:    WARNING: This is a development server. Do not use it in a production deployment.
Feb 18 21:36:28 raspberrypi python3[8115]:    Use a production WSGI server instead.
Feb 18 21:36:28 raspberrypi python3[8115]:  * Debug mode: off
Feb 18 21:36:28 raspberrypi python3[8115]:  * Running on http://0.0.0.0:6060/ (Press CTRL+C to quit)
Feb 18 21:36:43 raspberrypi python3[8115]: 127.0.0.1 - - [18/Feb/2021 21:36:43] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:36:55 raspberrypi python3[8115]: 127.0.0.1 - - [18/Feb/2021 21:36:55] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:37:08 raspberrypi python3[8115]: 127.0.0.1 - - [18/Feb/2021 21:37:08] "GET /signals/soft_reboot HTTP/1.1" 503 -

Not sure why but there is no error this time when i run journalctl -u power_request.service

pi@raspberrypi:~ $ journalctl -u power_request.service
-- Logs begin at Thu 2021-02-18 21:44:27 EST, end at Thu 2021-02-18 22:11:09 EST
Feb 18 21:44:30 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 21:44:33 raspberrypi python3[399]:  * Serving Flask app "src" (lazy loadi
Feb 18 21:44:33 raspberrypi python3[399]:  * Environment: production
Feb 18 21:44:33 raspberrypi python3[399]:    WARNING: This is a development serv
Feb 18 21:44:33 raspberrypi python3[399]:    Use a production WSGI server instea
Feb 18 21:44:33 raspberrypi python3[399]:  * Debug mode: off
Feb 18 21:44:33 raspberrypi python3[399]:  * Running on http://0.0.0.0:6060/ (Pr
Feb 18 21:44:48 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:44:48] "
Feb 18 21:45:19 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:19] "
Feb 18 21:45:31 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:31] "
Feb 18 21:45:44 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:44] "
Feb 18 21:45:57 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:57] "
Feb 18 21:46:10 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:10] "
Feb 18 21:46:23 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:23] "
Feb 18 21:46:35 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:35] "
Feb 18 21:46:48 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:48] "
Feb 18 21:47:01 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:01] "
Feb 18 21:47:14 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:14] "
Feb 18 21:47:27 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:27] "
Feb 18 21:47:39 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:39] "
Feb 18 21:47:52 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:52] "
Feb 18 21:48:05 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:48:05] "
lines 1-23...skipping...
-- Logs begin at Thu 2021-02-18 21:44:27 EST, end at Thu 2021-02-18 22:11:09 EST. --
Feb 18 21:44:30 raspberrypi systemd[1]: Started Sixfab UPS HAT Distributed API.
Feb 18 21:44:33 raspberrypi python3[399]:  * Serving Flask app "src" (lazy loading)
Feb 18 21:44:33 raspberrypi python3[399]:  * Environment: production
Feb 18 21:44:33 raspberrypi python3[399]:    WARNING: This is a development server. Do not use it in a production deployment.
Feb 18 21:44:33 raspberrypi python3[399]:    Use a production WSGI server instead.
Feb 18 21:44:33 raspberrypi python3[399]:  * Debug mode: off
Feb 18 21:44:33 raspberrypi python3[399]:  * Running on http://0.0.0.0:6060/ (Press CTRL+C to quit)
Feb 18 21:44:48 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:44:48] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:45:19 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:19] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:45:31 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:31] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:45:44 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:44] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:45:57 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:45:57] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:46:10 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:10] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:46:23 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:23] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:46:35 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:35] "POST /configurations HTTP/1.1" 503 -
Feb 18 21:46:48 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:46:48] "POST /configurations HTTP/1.1" 503 -
Feb 18 21:47:01 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:01] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:47:14 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:14] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:47:27 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:27] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:47:39 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:39] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:47:52 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:47:52] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:48:05 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:48:05] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:48:18 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:48:18] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:48:31 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:48:31] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:48:43 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:48:43] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:48:56 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:48:56] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:49:09 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:49:09] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:49:22 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:49:22] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:49:35 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:49:35] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:49:47 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:49:47] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:50:00 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:50:00] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:50:13 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:50:13] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:50:26 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:50:26] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:50:39 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:50:39] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:50:51 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:50:51] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:51:04 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:51:04] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:51:17 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:51:17] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:51:30 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:51:30] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:51:43 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:51:43] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:51:55 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:51:55] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:52:08 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:52:08] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:52:21 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:52:21] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:52:34 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:52:34] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:52:47 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:52:47] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:53:00 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:53:00] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:53:12 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:53:12] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:53:25 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:53:25] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:53:38 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:53:38] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:53:51 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:53:51] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:54:04 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:54:04] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:54:16 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:54:16] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:54:29 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:54:29] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:54:42 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:54:42] "GET /signals/soft_shutdown HTTP/1.1" 503 -
Feb 18 21:54:55 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:54:55] "GET /signals/soft_reboot HTTP/1.1" 503 -
Feb 18 21:55:08 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:55:08] "GET /signals/system_temperature HTTP/1.1" 503 
Feb 18 21:55:20 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:55:20] "GET /metrics/version HTTP/1.1" 503 -
Feb 18 21:55:33 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:55:33] "GET /metrics/fan/health HTTP/1.1" 503 -
Feb 18 21:55:46 raspberrypi python3[399]: 127.0.0.1 - - [18/Feb/2021 21:55:46] "GET /metrics/working_mode HTTP/1.1" 503 -
Feb 18 21:55:59 raspberrypi python3[399]: 127.0.0.1 - - [

It goes on and on this way…

It looks to me that the server is now running correctly, you say this still isn’t logging on the power website to the device that you have connected you [edit] your system to?

May I ask what OS and version of python you have on your pi?

# system information command
cat /etc/os-release
# python version command
python -V
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:~ $ python -V
Python 2.7.16
pi@raspberrypi:~ $

The only thing I have added to the installation is teamviewer, but was having these issues before hand. On the power website, it shows connected, but says “No Data”

Apologies, I was a thinking ‘a bit slow’ last night, update to the python command:

python3 -V

Regards,
Daniel

Not a problem at all, thanks for your patience and for helping me.

Python 3.7.3

Still Not having any luck, Ive followed the instructions to manually update the firmware but received this error:

error in 0
raised error

I also tried to use the examples for the python api, the only value that would return was the system temp, everything else returned an error including the battery usage:

Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from power_api import SixfabPower, Definition, Event
>>> api = SixfabPower()
>>> api.get_battery_level()
error in 0
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python3.7/site-packages/power_api/power_api.py", line 478, in get_battery_level
    raw[PROTOCOL_HEADER_SIZE : COMMAND_SIZE_FOR_INT32 - 2], "big"
TypeError: 'int' object is not subscriptable
>>> 

I’ve tried downloading an older release of buster, Still the same. I’m out of ideas at this point.

Can you try to reset your HAT?

Please reset the HAT by bridging the GND and the RESET pad as shown in the image below.

Then reboot and check again.