Skip to main content
replaced http://raspberrypi.stackexchange.com/ with https://raspberrypi.stackexchange.com/
Source Link

I think that your question and thus the existing answers address only part of the problem you have.

I have 2 arduino pro minis sending data to my Raspberry Pi. But in order to do that I need to run the script by typing it on my Raspberry.

To me it sounds that you intend the setup of Pi and Arduinos to automatically work no matter what, e.g. after powering it up. In this case you certainly do not want to manually log into the Pi and start a script following the procedure KennetRunner has described. Instead you would want the Pi to automatically restart the script. (It goes without saying that the access provided by SSH and dyndns has still its merits as it allows access for maintenance. So this is not about either ... or but both ... and.)

To automatically start/restart scripts various techniques are described. I found supervisord an easy to configure tool to achieve this. Besides starting processes on reboot it also monitors them and restarts them if they crash.

See also: Start and run a Python script at boot and use Cron to make sure its still aliveStart and run a Python script at boot and use Cron to make sure its still alive

I think that your question and thus the existing answers address only part of the problem you have.

I have 2 arduino pro minis sending data to my Raspberry Pi. But in order to do that I need to run the script by typing it on my Raspberry.

To me it sounds that you intend the setup of Pi and Arduinos to automatically work no matter what, e.g. after powering it up. In this case you certainly do not want to manually log into the Pi and start a script following the procedure KennetRunner has described. Instead you would want the Pi to automatically restart the script. (It goes without saying that the access provided by SSH and dyndns has still its merits as it allows access for maintenance. So this is not about either ... or but both ... and.)

To automatically start/restart scripts various techniques are described. I found supervisord an easy to configure tool to achieve this. Besides starting processes on reboot it also monitors them and restarts them if they crash.

See also: Start and run a Python script at boot and use Cron to make sure its still alive

I think that your question and thus the existing answers address only part of the problem you have.

I have 2 arduino pro minis sending data to my Raspberry Pi. But in order to do that I need to run the script by typing it on my Raspberry.

To me it sounds that you intend the setup of Pi and Arduinos to automatically work no matter what, e.g. after powering it up. In this case you certainly do not want to manually log into the Pi and start a script following the procedure KennetRunner has described. Instead you would want the Pi to automatically restart the script. (It goes without saying that the access provided by SSH and dyndns has still its merits as it allows access for maintenance. So this is not about either ... or but both ... and.)

To automatically start/restart scripts various techniques are described. I found supervisord an easy to configure tool to achieve this. Besides starting processes on reboot it also monitors them and restarts them if they crash.

See also: Start and run a Python script at boot and use Cron to make sure its still alive

Source Link
Ghanima
  • 15.9k
  • 16
  • 63
  • 120

I think that your question and thus the existing answers address only part of the problem you have.

I have 2 arduino pro minis sending data to my Raspberry Pi. But in order to do that I need to run the script by typing it on my Raspberry.

To me it sounds that you intend the setup of Pi and Arduinos to automatically work no matter what, e.g. after powering it up. In this case you certainly do not want to manually log into the Pi and start a script following the procedure KennetRunner has described. Instead you would want the Pi to automatically restart the script. (It goes without saying that the access provided by SSH and dyndns has still its merits as it allows access for maintenance. So this is not about either ... or but both ... and.)

To automatically start/restart scripts various techniques are described. I found supervisord an easy to configure tool to achieve this. Besides starting processes on reboot it also monitors them and restarts them if they crash.

See also: Start and run a Python script at boot and use Cron to make sure its still alive