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.
Any idea why Udp.remoteIP() and Udp.remotePort() functions don't return the correct values?
They always return 255.255.255.255[not configured] and port0, like your example too.
I tried some UDP testers and confirmed the packet header sent to Galileo is correct.
I also have this problem, How to solve the problem...
Please help me to solve the problem.
I have the same problem, I need to use the remote IP and PORT, but I get always the same: 255.255.255.255 & 0.