0

If I have 2 raspberry pi's and I wanted to transfer\receive data with a LAN cable connected to them both(do i need a crossover cable?) how would I get the data from the LAN port? with a python script or bash file? how could i send and receive data from the command line?

3
  • not a Raspberry Pi question ... it is a Linux networking question .... what exactly is the data you are talking about?
    – jsotola
    Mar 29, 2022 at 2:32
  • @jsotola, uh just text/string data. temperature/humidity and probably some other stuff. that and added maybe a chat window so you could "text" the other rpi Mar 29, 2022 at 2:50
  • The problem with your question is that there are an almost innumerable number of ways to do this. One way would be to use Link Local addresses, and there is another Q&A here on RPi SE that answers your question using another approach.
    – Seamus
    Mar 29, 2022 at 19:59

1 Answer 1

0

You could just connect both of them to one another with a normal internet cable, and give them both a static IP. You could also just connect them to your network. Would probably be easier. I don't know if that is possible in your current setup though.

If they have the same default gateway (and subnet mask), and you give them an IP in between your chosen subnet mask, you should be able to just SSH or SFTP from one Pi to another.

But like @Jsotola stated, it is not really a RPi specific question.

2
  • Where should I ask this Mar 29, 2022 at 15:06
  • I gave you a suggestion to try/Google more info on. And you could try the Unix StackExchange, with a network tag for example (unix.stackexchange.com/). You should also find enough tutorials in general about this subject. Try to Google: connect two raspberry pi with ethernet cable or something alike Mar 29, 2022 at 16:56

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