Raspberry Pi broadcast serial port data to local network

Posted by D051P0 on Stack Overflow See other posts from Stack Overflow or by D051P0
Published on 2013-06-26T07:19:07Z Indexed on 2013/06/26 22:21 UTC
Read the original article Hit count: 177

I didn't find anything to help me with this problem.

What I want is:

Serial device sends repeatedly some data to serial port. Raspberry Pi should get this data from RxD and stream it to local network via port 10001 without filtering it. So I can find this device on my pc. This should also work in other direction: Raspberry listen to port 10001 and forward all data from local network to TxD.

I'm newbie in Linux World. How can I listen to some port on Raspberry Pi and send broadcast to the same port? I'm using Raspbian Wheezy with soft float.

I have found a library Pi4j for Java, that I already use to get and write data from/to serial port.

final Serial serial = SerialFactory.createInstance();
        serial.addListener(new SerialDataListener() {   
            public void dataReceived(SerialDataEvent event) {

                forward(event.getData());
            }            
        });

event.getData() is a String, which I want to broadcast in my local network.

Is it generally a good Idea to use Java for that?

I need also a String from port 10001, which I can forward to serial port.

© Stack Overflow or respective owner

Related posts about java

Related posts about networking