Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

armbian in orange Pi creates script process in rc-local.service but don't executes correctly

Featured Replies

  • Solution

Hello guys.

Could you help me resolv a problem with orange pi (armbian)?

The problem is the following:
I created a small script in Python that read a I/O of orange Pi, that is read the state of a button(switch). If I execute it on terminal It works fine... But my problem is when I put in inicialization of SO(/lib/systemd/system/rc-local.service ), the linux created a process correctly but when a press the button not happen anything.

 

root@orangepizero:~# ps -aux|grep press
root      1306 83.7  1.9  11268  4852 ?        Rs   18:54   0:38 /usr/bin/python /usr/local/sbin/press_button.py

 

SO of Orange Pi Zero:
Linux orangepizero 5.10.21-sunxi #21.02.3 SMP Mon Mar 8 00:28:04 UTC 2021 armv7l GNU/Linux

 

Obs: I tried put the script in rc.local, used crontab too, put in init.d.... but always the same problem, the linux created the process but dont happen anything when I pressed the button... But if I execute on bash the script It read the button correctly.

 

Script python:


 

import os

import sys

from pyA20.gpio import gpio

from pyA20.gpio import port

from time import sleep
#initialize the linphonecsh
os.system("linphonecsh init")

os.system("linphonecsh register --username 8000 --host 10.100.14.210 --password 8000")
os.system("linphonecsh soundcard playback 0")
os.system("linphonecsh soundcard capture 0")
os.system("linphonecsh soundcard ring 0")

#initialize the gpio module / initialise le GPIO

gpio.init()

button = port.PA12

#setup the port
gpio.setcfg(button, gpio.INPUT)

 

while True:

if gpio.input(button)==0:

sleep(1)
print("button pressed")                                                                                                                                                                                                                                                                                                                                                                                                  os.system("./test_autodial.sh")

 

I'm already suspecting that it's a problem with this OS version.

Hope someone can help me.

Thank you very much.

 

Solved by andreygoncalves

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.