This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Launch the ADS1115 tool automatically at startup?
#1
How do I launch the ADS1115 tool automatically at startup?

I can run the following form the terminal successfully
python /home/pi/.config/openplotter/tools/analog_ads1115.py

But if I try to call this from rc.local it fails with SUDO user error key.

I also don't particularly want to launch it before openplotter is finished as I suspect that this could cause problems down the line.
Reply
#2
(2018-03-30, 03:51 PM)garysmith Wrote: How do I launch the ADS1115 tool automatically at startup?

I can run the following form the terminal successfully
python /home/pi/.config/openplotter/tools/analog_ads1115.py

But if I try to call this from rc.local it fails with SUDO user error key.

I also don't particularly want to launch it before openplotter is finished as I suspect that this could cause problems down the line.

I just stumbled across your question, and an the legacy doc here answers your first question. Don't know about your timing question.

https://sailoog.gitbooks.io/openplotter-documentation/content/en/standalone-tools.html

Hope that helps.
Reply
#3
You could try startup in /home/pi/.config/autostart this has scripts to run after login. This is where the openplotter startup script is started. It also starts other scripts.
Reply
#4
Hi, im not sure what is the analog_ads1115.py but :

The sudo command need some user's specific environement variables to work.    
If I remember well, rc.local is executed on each multiuser runlevels BUT it is done by the runlevel1 root user (witch don't have environment variables like $HOME and $PATH set.).

Therefor it's not realy the place for using sudo ....and mainly you just don't need it as you are already root.


----

IF
analog_ads1115.py is a demon or some kind of background task.
Creating a .service file and enable it with systemctl would probably be the proper thing to do.

Other wise if it's some Graphical User Interface application,
/home/pi/.config/autostart will be a good place so your app.


The point is you should not put any demon or background running task in your autostart. 
Autostart should be reserved for thing that depend on the graphical interface and have no reasons to be without it.  
Otherwise, If something trivial ( like vlc or pdfviewer ) make your Xorg crash. your analog_ads1115.py will be killed with the rest.

--Fred
Reply
#5
Edit openplotter.conf. Change this
Code:
['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115.py', '0']

to this
Code:
['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115.py', '1']
(Look into the docs as svtgd said (analog_ads1115.py is a normal python program. It starts when you press the start buttom or it autostarts on every boot if you change the 0 to 1))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)