1 of 1 people found this helpful
This is not strictly supported in the Arduino API, however there's a couple things you could try;
Use SD library
1. get your python script to update a file on an SD card in the Galileo's SD card slot. You can then read this file in your arduino sketch using the SD library (on Galileo, the SD library talks to the native SD slot by default, as opposed to an SD shield).
Use system call
2. Get your python script to update a file anywhere in the Galileo's root filesystem (let's use /home/root/log.txt as an example).
In your arduino sketch, use a system call which reads this file and redirects the output to the serial port used by the IDE serial monitor, which will allow you to read the output in the sketch.
system("cat /home/root/log.txt > /dev/ttyGS0");
You can also use the example on the sketch under Ethernet, UDPSendReceive. Basically you are going to use UDP to send and receive data. Since the Galileo board has the Ethernet in place you can use it already as it is. I tried this sketch tonight and it works for me. I was able to send a UDP packet and the arduino was able to receive it. The sketch printed it on the serial monitor (see below).
Received packet of size 23
From 255.255.255.255, port 0
As sending UDP packets there is an example at:
Or the one I used was a node.js example from here:
> Use the UDPClient example
> the ports and hosts needs to be aligned to where the sketch is listening to.