BeagleBoneBlack + Arduino Ethernet shield refuse to communicate

Thread Starter

Shagas

Joined May 13, 2013
804
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.

The snippet running on JAVA:


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
                String msg = new String(BUFFER, 0, PACKET.getLength());
                System.out.println("Message received from SYSCU: " + msg);

Snippet running on arduino:

C:
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.
 
Last edited:

tjohnson

Joined Dec 23, 2014
611
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.

The snippet running on JAVA:


Code:
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
                String msg = new String(BUFFER, 0, PACKET.getLength());
                System.out.println("Message received from SYSCU: " + msg);

Snippet running on arduino:

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.
Just a tip: If you use [code=java] for your opening code tag, your code will have syntax highlighting.

Sorry that I can't help more, but I don't know Java and have no experience with BeagleBoneBlack or Arduino.
 

Thread Starter

Shagas

Joined May 13, 2013
804
Just a tip: If you use [code=java] for your opening code tag, your code will have syntax highlighting.

Sorry that I can't help more, but I don't know Java and have no experience with BeagleBoneBlack or Arduino.
Thanks for the tip, I'm not sure I correctly understood though. In any case I used the
[C.O.D.E=java] tag that I found somewhere else on the forum.[/CODE]
 

tjohnson

Joined Dec 23, 2014
611
Thanks for the tip, I'm not sure I correctly understood though. Is it [</mono>]codehere[/</mono>] or does the mono go after the
Code:
 tag or how is it?
Sorry for the confusion. You don't need to use the [mono] tag, but it showed up momentarily in my post before I edited it to correct my formatting. Use [code=java]enter code here[/code] and [code=c]enter code here[/code]. The code in your post has syntax highlighting now.

EDIT: Good, you figured it out. I didn't see your edited post until now.
 
Last edited:
Top