I have seen a lot of threads about this question, but most of the threads covers only from RPi to laptop or the other way around, or just suggest to use some API's, in my case I cannot do that. I need this for my last year project so everything has to be written by myself.

I was wondering what are the best ways to make a connection between RPi and laptop and continuously send data from RPi to laptop and from laptop to RPi. My RPi is going to have some sensors and I want to send the data from sensors to laptop very often, like 2-10 times per second and the laptop is going to receive the data and is going to compute the data and then send the commands to RPi telling him what to do now. So they will constantly be receiving and sending data to each other. RPi code will probably be written in python and I want to code on laptop in Java.

So I was just wondering if anyone have good suggestions in how I can approach this thing? How to do this with python on one end and java on another end? Is it better to code with something like node.js or to use sockets for TCP or UDP connection, I am just wondering what are the best ways to do this. Sorry for the long post.

1 Answer 1


I suggest you use TCP as that is what most applications will use.

I'd use Python as probably the better supported choice.

Lots of socket examples on-line to get you started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.