Adafruit_BBIO errors when running with systemd

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Islogic
 
Posts: 2
Joined: Mon May 18, 2020 11:08 pm

Adafruit_BBIO errors when running with systemd

Post by Islogic »

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!

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

Re: Adafruit_BBIO errors when running with systemd

Post by Islogic »

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

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Adafruit_BBIO errors when running with systemd

Post by drewfustini »

Thanks for sharing this

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”