I’m having some issues getting my BeagleBoneBlack (BBB) to talk with my Arduino ethernet shield.
The BBB is running Java and I’m using standard sockets to write/read a message on the UDP port.
The following setups work:
Java (BBB) → Packet Sender (on windows PC) : Packets are successfully sent and received
Java (on Windows PC) → Arduino Ethernet shield : Packets are successfully sent and received
Arduino Ethernet shield → Packet Sender (on windows PC) : Packets are successfully sent and received
Java (BBB) → Arduino Ethernet shield : !!! FAIL !!! Cannot get the two to talk to each other.
Anyone have any idea as to why I can get my pc running java to talk with the Ethernet shield but the BBB running the SAME program
refuses to talk (A connection is established though as far I understand. It throws and error when there is no physical connection).
Details:
I’m deploying the BBB remotely from my PC through Netbeans through USB and the BBB is connected to the ethernet shield through classical ethernet cable.
Running Angstrom on the BBB element 14 rev C
The snippet running on JAVA:
-
try {
-
System.out.println(“Waiting for packet from SYSCU…”);
-
BUFFER = new byte[3];
-
// Receive request
-
PACKET = new DatagramPacket(BUFFER, BUFFER.length);
-
SOCK.receive(PACKET);
-
// Print out received message
-
System.out.println("Message received from SYSCU: " + msg);
And the Arduino code
Code ©:
-
void setup() {
-
Ethernet.begin(mac,ip);
-
Udp.begin(localPort);
-
Serial.begin(9600);
-
while(1){
-
char str[3];
-
str[0] = ‘a’;
-
str[1] = ‘c’;
-
str[2] = ‘k’;
-
// Send a new packet
-
Udp.beginPacket(remoteIP, remotePort); // localPort
-
Udp.write(str);
-
Udp.endPacket();
-
Serial.println("Packet sent, waiting 1000ms ");
-
delay(1000);
-
}
-
Thanks in advance.