candreshidalgo
Posts: 16
Joined: Mon Mar 27, 2017 5:05 pm

code python launch at startup...i need a suggestion

Mon Apr 10, 2017 7:57 pm

I have a Python code that inputs the amount of liters of a water tank (I made the signal adaptation for gpio...3.3V ), and send the data to remote database ( r = requests.get...), it`s work fine.

my script is launched after the raspberry pi boot. (etc/init.d)

but now i thinking the way to show the data in a tv screen automatically...after the raspberry pi finished to boot process

can I run a flask server or another server (lamp) so that when launching raspberry the amount of registered liters is shown in a tv screen? What does a flask server need? Which are the other options?.

if someone can give me an idea to start....thanks

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: code python launch at startup...i need a suggestion

Tue Apr 11, 2017 9:45 am

Will the Pi be connected to that TV-screen with HDMI ?
Will the information on the screen change over time ?

klintkrossa
Posts: 81
Joined: Tue Nov 10, 2015 3:06 pm

Re: code python launch at startup...i need a suggestion

Thu Apr 13, 2017 4:18 pm

Hello
The one that I like is:
sudo nano /etc/profile.d/startup.sh

Code: Select all

#!/bin/sh

sudo /usr/bin/python3 /complete/path/to/your/program.py 
Down side is that some time it will not show if there are errors loading the python.
Thanks
This is not like any other bulletin boards that I have been on. Been flamed on other BB's so bad I was afraid to ask.

All my Raspberry Pi's are like the Hessian artilleryman of Sleepy Hollow.

Return to “Python”