Black Lives Matter - Action and Equality.
0

Adafruit_BBIO errors when running with systemd
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_BBIO errors when running with systemd

by Islogic on Mon May 18, 2020 11:18 pm

Hello!
we currently have an app that is using the Adafruit_BBIO python libs to interact with various pins on the beaglebone. We are using the lastest image from beaglebone. Debian 10. When we run the program by itself IE manually login and type: sudo python3 app.py the program is able to run and the adafruit does not print anything and the program runs as expected. When we try to put it into a systemd file to run as a service we see this issue and it hangs. Adafruit_BBIO: version <unknown> initialized
Is there any advice on setting up systemd files while using the adafruit libs with the beaglebone?
Thank you!

Islogic
 
Posts: 2
Joined: Mon May 18, 2020 11:08 pm

Re: Adafruit_BBIO errors when running with systemd

by Islogic on Mon May 18, 2020 11:55 pm

It turns out that it was working. It turns out you need to run python3 -u to turn off buffering and text would print to the screen. :)
Thank you!
in case anyone else sees this error:
try this service file: Note the -u and the type simple. Also as a friendly reminder if you are going to copy and paste please always test and verify before using in production. :)

[Unit]
Description=put your app Description here
After=network.target

[Service]
Type=simple
WorkingDirectory=/var/lib/cloud9/gateway-source/
ExecStart= /usr/bin/python3 -u /var/lib/cloud9/gateway-source/app.py

[Install]
WantedBy=multi-user.target

Islogic
 
Posts: 2
Joined: Mon May 18, 2020 11:08 pm

Re: Adafruit_BBIO errors when running with systemd

by drewfustini on Tue May 19, 2020 8:29 am

Thanks for sharing this

drewfustini
 
Posts: 928
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.