Jump to content

Recommended Posts

Posted

Hello all,

 

This seems to be an issue related to the python script to start the program, any help will be appreciated for those with python programming understanding:

$ sudo systemctl status sys-oled.service
* sys-oled.service - System Starting on OLED Display
   Loaded: loaded (/etc/systemd/system/sys-oled.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2021-09-17 02:22:42 JST; 10s ago
  Process: 4425 ExecStart=/usr/bin/python3 /usr/local/bin/sys-oled --display ${display_model} (code=exited, status=1/FAILURE)
 Main PID: 4425 (code=exited, status=1/FAILURE)

Sep 17 02:22:42 nas python3[4425]:     main()
Sep 17 02:22:42 nas python3[4425]:   File "/usr/local/bin/sys-oled", line 132, in main
Sep 17 02:22:42 nas python3[4425]:     display_info(device)
Sep 17 02:22:42 nas python3[4425]:   File "/usr/local/bin/sys-oled", line 105, in display_info
Sep 17 02:22:42 nas python3[4425]:     draw.text((0, 0), cpu_usage(), font=font, fill="white")
Sep 17 02:22:42 nas python3[4425]:   File "/usr/local/bin/sys-oled", line 78, in cpu_usage
Sep 17 02:22:42 nas python3[4425]:     temp = psutil.sensors_temperatures()['f10e4078.thermal']
Sep 17 02:22:42 nas python3[4425]: KeyError: 'f10e4078.thermal'
Sep 17 02:22:42 nas systemd[1]: sys-oled.service: Main process exited, code=exited, status=1/FAILURE
Sep 17 02:22:42 nas systemd[1]: sys-oled.service: Failed with result 'exit-code'.

 

Thank you in advance for any hints or recommendations about how to solve this.

Sincerely,

Posted

The repo is on github, problematic line seems to be this one: https://github.com/kobol-io/sys-oled/blob/master/bin/sys-oled#L78

 

I do not have an OLED display attached  to my helios4 but running this simple python test script has worked. Maybe you can try it? Just put it in a file, make executable (chmod +x ) and run it. 

 

#!/usr/bin/env python3

import psutil

sens = psutil.sensors_temperatures()
temp = psutil.sensors_temperatures()['f10e4078.thermal']
print(sens)
print(temp)

 

Give us the output of the test script and also attach the 'armbianmonitor -u' output or tell us which exact version you are using.

 

 

Posted (edited)

Hello @Heisath my apologies for the delayed response.  Find below the error I get when running the smaller python script you provided:
 

$ ./sys-oled2
Traceback (most recent call last):
  File "./sys-oled2", line 6, in <module>
    temp = psutil.sensors_temperatures()['f10e4078.thermal']
KeyError: 'f10e4078.thermal'

 

Seems very similar to the error result of the full `sys-oled` python script.

 

And here is the armbian command:
 

$ sudo armbianmonitor -u
System diagnosis information will now be uploaded to curl: (52) Empty reply from server
Please post the URL in the forum where you've been asked for.

 

I look forward to your advice.

 

Sincerely,

Edited by jairunet
Posted

A KeyError in Python is raised when you try to access a dictionary key that doesn't exist in the dictionary. This error occurs when you try to access a dictionary value using a key that doesn't exist in the dictionary. The error message typically includes the name of the key that was not found in the dictionary. 

 

To handle this error, you can either check if the key exists in the python dictionary before trying to access it, or use the .get() method which allows you to specify a default value to return if the key does not exist in the dictionary. 

 

my_dict = {"a": 1, "b": 2}
if "c" in my_dict:
    print(my_dict["c"])
else:
    print("Key 'c' not found in the dictionary")

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines