Connected but No Data

We will do it as soon as possible :+1:
I recommend using virtualenv.

you can try “converting down” with something like f2format (pip install f2format). I can’t vouch for this and I can’t speak to your “only use packages” agreement, just a suggestion. It seems you’re in a bit of a bind if you can’t install python 3.6/7/8.x and you can’t swap SD card images for ups testing.

@mark.donofrio thanks for the suggestion to try another SD card. I can do that for testing pretty easily.
Meanwhile, I modified the toolkit to remove the troublesome f" strings. They’re only found in a couple of files and the Python %s syntax works well to provide alternate code. Perhaps Sixfab should make these changes to allow earlier versions of Python to be useable. Unless I made a mistake somewhere the code changes did not help and I still have no dashboard data (see below).

agent/core/modules/set_configurations.py

# set scheduled events                                                                                                                                                          
for ignored_field in data["ignored_fields"]:  # clear ignored events                                                                                                                                                             
    for event in data["scheduled"]:
        event_id_test = "event_" + event['_id']
        if event_id_test == ignored_field:
            data["scheduled"].remove(event)

for _id in ids_to_add:

    if "event_" + _id in data["ignored_fields"]:
        continue

agent/core/modules/updater.py

def send_status(status):
    mqtt_client.publish(
        "/device/%s/hive" % token,
        json.dumps({
            "command": "update_status_firmware",
            "status": status
        })
    )

send_status("git")
if os.path.exists(LOCAL_FIRMWARE_FOLDER):
    os.system("cd %s && sudo git pull" % LOCAL_FIRMWARE_FOLDER)
else:
    os.system("sudo git clone %s %s" % (remote_repository, LOCAL_FIRMWARE_FOLDER))

latest_version = open("%s/latest_version" % LOCAL_FIRMWARE_FOLDER).read().strip()
latest_firmware = "%s/sixfab_pms_firmware_%.bin" % (LOCAL_FIRMWARE_FOLDER, latest_version)


def send_status(status):
    mqtt_client.publish(
        "/device/%s/hive" % token,
        json.dumps({
            "command": "update_status_agent",
            "status": status
        })
    )

With these changes the system is running without error and I’m getting a new “Received PUBLISH (d0, q0, r0, m0), '/device/Path-” message, but still no data on the Dashboard.

May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:[FEEDER] Starting, locking
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getBatteryLevel] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getBatteryHealth] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getFanSpeed] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getFanHealth] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getWorkingMode] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[askWatchdogAlarm] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getInputTemp] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getInputVoltage] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getInputCurrent] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getInputPower] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getSystemTemp] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getSystemVoltage] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getSystemCurrent] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getSystemPower] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getBatteryTemp] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getBatteryVoltage] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getBatteryCurrent] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getBatteryPower] #033[0m done
May 20 09:46:22 picayune-2 python3[22839]: DEBUG:root:#033[94m[getFirmwareVer] #033[0m done
May 20 09:46:23 picayune-2 python3[22839]: Received PUBLISH (d0, q0, r0, m0), ‘/device/Path- xxx -Curvy/directives’, … (58 bytes)
May 20 09:46:23 picayune-2 python3[22839]: DEBUG:root:Setting RTC time to default
May 20 09:46:23 picayune-2 python3[22839]: DEBUG:root:#033[94m[setRtcTime] #033[0m Function executed success

yes, your data set is empty. give buster lite a try on a fresh SD. you’ll see that the power portal works rather well for beta. best of luck.

After installing a new SD card and reinstalling the software, I’m now getting statistics on the Dashboard, finally. Everything looks normal except fan rotation states 6600 rpm which seems really high and unusual. I loaded 2020-02-13-raspbian-buster-full.img with all the latest updates.

I had a similar problem with raspbx on a pi4. With “sudo systemctl status pms_agent” and “sudo journalctl” I could see that the pms_agent service could not be started.

The Sixfab Power HAT installer expects that a user pi exists, which is a member of the groups sudo, i2c and video and is allowed execute sudo without password.

If you are using an image other than raspbian or you want the pms_agent service to run as a different user (e.g. power), you could do the following:

# 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

# stop pms_agent, edit user in /etc/systemd/system/pms_agent.service and start pms_agent
sudo systemctl stop pms_agent
sudo sed -i 's/^\(User=\).*/\1power/' /etc/systemd/system/pms_agent.service
sudo systemctl start pms_agent

Hi. I am connected by no data

1 Like

Hi @chjunke,

The installer updated and these checks added.
Thanks for contributing. :heart:

Hello I have this problem too. Connected, but with no data. I’m using a pi4 with “Raspberry Pi OS with desktop” - Release date: January 11th 2021

Hi Kev,

I’m working on this same issue myself.
On your pi can you open a terminal and enter:

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

Then refresh the web page and let me know if that improves anything for you!

Regards,
Daniel

Hello @ensar,

I have found in my case that pms/api/run_server/py isn’t running automatically on system startup, I’m not sure if this is down to me using the ‘power’ user as suggested above or if this is something that happens to 1 in x users - hopefully Kev’s set up should be able to clarify this for us.

In order to ‘fix’ this issue I have added:
@python3 /opt/sixfab/pms/api/run_server.py & disown
To /etc/xdg/lxsession/LXDE-pi/autostart

Hopefully this will provide a solution to those who are experiencing this issue.

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
    Traceback (most recent call last):
    File “/opt/sixfab/pms/api/run_server.py”, line 6, in
    app.run(host=“0.0.0.0”, port=6060, threaded=False, processes=1, debug=bool(is_debug_enabled))
    File “/usr/local/lib/python3.7/dist-packages/flask/app.py”, line 990, in run
    run_simple(host, port, self, **options)
    File “/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py”, line 1052, in run_simple
    inner()
    File “/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py”, line 1005, in inner
    fd=fd,
    File “/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py”, line 863, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
    File “/usr/local/lib/python3.7/dist-packages/werkzeug/serving.py”, line 740, in init
    HTTPServer.init(self, server_address, handler)
    File “/usr/lib/python3.7/socketserver.py”, line 452, in init
    self.server_bind()
    File “/usr/lib/python3.7/http/server.py”, line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
    File “/usr/lib/python3.7/socketserver.py”, line 466, in server_bind
    self.socket.bind(self.server_address)
    OSError: [Errno 98] Address already in use

I did try to add the power user as described above, but I had problems editing the sudoers file so I’m going to start over again this evening with a fresh install.

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