Go Down

Topic: OpenWRT - Start a python script at boot. (Read 1 time) previous topic - next topic

mansa

Hey, I have a python script with an infinite loop which adds data too a database while the system is on, my script works i have tested it via SSH. but i cant seem to get the script too either be started at boot by the process library or by the OpenWRT's rc.local or init.d files or find any information on why it is not working.

heres my rc.local file

Code: [Select]
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

wifi-live-or-reset
boot-complete-notify

[u]python /mnt/sda1/arduino/www/x/app.py &[/u]

# Uncomment the following line in order to reset the microntroller
# right after linux becomes ready

#reset-mcu

# Uncomment the following line in order to disable kernel console
# debug messages, thus having a silent and clean serial communication
# with the microcontroller

#echo 0 > /proc/sys/kernel/printk

exit 0


sonnyyu

#1
Jan 08, 2016, 12:54 am Last Edit: Jan 08, 2016, 12:55 am by sonnyyu
Put shebang line (#!/usr/bin/python) at header of app.py

Code: [Select]
chmod 755 /mnt/sda1/arduino/www/x/app.py


Code: [Select]
opkg update
opkg install coreutils-nohup


...

Code: [Select]
/usr/bin/nohup /root/freerun.py &



put  "/usr/bin/nohup /mnt/sda1/arduino/www/x/app.py &"  at rc.local file.




seaurchin

Put shebang line (#!/usr/bin/python) at header of app.py

Code: [Select]
chmod 755 /mnt/sda1/arduino/www/x/app.py



put  "/usr/bin/nohup /mnt/sda1/arduino/www/x/app.py &"  at rc.local file.




when I try to install no nohup I get error saying:

Code: [Select]

root@iduino:~# opkg install coreutils-nohup
Unknown package 'coreutils-nohup'.
Collected errors:
 * opkg_install_cmd: Cannot install package coreutils-nohup.



sonnyyu

#3
Mar 11, 2017, 01:36 am Last Edit: Mar 11, 2017, 01:36 am by sonnyyu
https://www.arduino.cc/en/Main/Software

Packages List
The list of available packages for the Yún is available here.
See the list of changes.

https://downloads.arduino.cc/openwrtyun/1/packages/index.html

coreutils-nohup_8.16-1_ar71xx.ipk  is here.


Code: [Select]
opkg  update
opkg install coreutils-nohup


Plan B:

if failed please pull source of coreutils-nohup then compile it.



Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy