run arduino sketch on boot

Hi, I have an Arduino sketch on a Pi running raspbian Jessis. The Arduino IDE is already installed. I would like the sketch runs every time the Pi is boot. How would I do that? Thank you.

rich1812:
Hi, I have an Arduino sketch on a Pi running raspbian Jessis. The Arduino IDE is already installed. I would like the sketch runs every time the Pi is boot. How would I do that? Thank you.

That’s a Raspberry Pi question?

Don’t they have a forum?

(deleted)

Thank for the replies.

Perhaps I did not state my question clearly. Here is my hook up. on the arduino I use a Nano. I have two sensors connecteded to the nano via i2c to collect data. Once the data is collected I send it to Pi via serial connection to process in a Python script on Pi.

To make my quest short. How do I run a adruino sketch where the computer boot up?

Just open the serial port. It should toggle the DTR line of the USB to UART chip of the Arduino, resulting in a reset.

Or you could have the Arduino wait for a specific byte on the serial port, and send that byte from the Pi to the Arduino when the booting process is finished.

Pieter

(deleted)

Let me make it clear. I am NOT running arduino sketch on Pi. I want to start running Arduino at start up on pi then the arduno loads the sketch to run, sent data via serial to a python script to execute.

rich1812:
Let me make it clear. I am NOT running arduino sketch on Pi. I want to start running Arduino at start up on pi then the arduno loads the sketch to run, sent data via serial to a python script to execute.

This isn't a forum about the Raspberry Pi.

As I suggested earlier go ask the question on their forums.

Arduino runs as soon as it gets power.

INTP:
Arduino runs as soon as it gets power.

For some reason he wants to load a sketch to the Arduino using the Raspberry Pi.

So the sketch has not been uploaded to the Nano yet?

Why even use the Nano? Pi has its own GPIO.

(deleted)

My interpretation:
He has an Arduino connected to the Pi via USB.
The Arduino measures some sensor values and sends those values over the Serial USB connection to the Pi.
He doesn't want the Arduino measuring the sensors before the Pi has booted up or he wants to reset the Arduino when the Pi boots up.
Once the Pi is ready, the Arduino should start measuring and sending sensor data.

But why use the Nano in the first place? Why can't you connect the sensors to the Pi's GPIO pins?

Pieter

Hi, I have an Arduino sketch on a Pi running raspbian Jessis

Let me make it clear. I am NOT running arduino sketch on Pi.

Which is it?

srnet:
$50SAT

That is exceptionally cool! Since this thread self-fizzled, how much did it cost to hitch a ride?

The first question is why you only want to send data from the Arduino to the Pi when the Pi is on. After all, it does not hurt the Arduino or the Pi if communication happens while the Pi is off.

I however think that you must forget about the IDE and use a dedicated application on the Pi that implements some form of handshake (and the Arduino needs to implement that as well).

holesflow:
That is exceptionally cool! Since this thread self-fizzled, how much did it cost to hitch a ride?

The launch was paid for by someone else, it was part of a proof of concept project run by Moorhead University.

Launch costs are in the region of $100,000 per Kg.

spycatcher2k:
I must be too stupid to understand what the OP wants! :o

Or that not all Arduinos run AVR chips.

rich1812:
Hi, I have an Arduino sketch on a Pi running raspbian Jessis. The Arduino IDE is already installed. I would like the sketch runs every time the Pi is boot. How would I do that? Thank you.

Just making sure that the Arduino sketch is on an Arduino connected to the RPi?

When you load the Arduino board with a sketch, the program stays in the Arduino flash memory. If the power goes off and starts later, the sketch on the board runs from start.

If you want to change the sketch every time then best to do that before starting the RPi up, perhaps before the last shutdown.

The sketch will need to wait for the RPi to open serial before sending data, the Arduino sketch will start before the RPi finishes booting.