Is it possible to connect 2 Raspberry Pi 3's together using cable? (I read somewhere and show some videos that an Arduino can be connected to a Pi using a serial cable.)

One of the Raspberry Pi's will be used as a gateway and a CoAP server that communicates with sensor nodes that is on the other Pi. The sensor will be a DHT22 sensor for temperature.

The Arduino part of the question is because I saw this. Just asking if it can happen pi to pi.

enter image description here

  • 1
    If you connect the UART/Serial Header on both PI's together, flipping rx/tx wire. You will have bi-directional communication over serial terminal /dev/ttyASM0. However since you have the full linux networking stack, using IP even if its just a two node network is still a very viable option
    – crasic
    Nov 6 '17 at 21:22
  • Of course you can. Heck, you can even do it wirelessly (I mean WiFi). It's just that there's so many ways to do it (GPIO/Serial/I2C/SPI/USB modules/Ethernet/whatever). Try some!
    – Aloha
    Nov 9 '17 at 6:09

There are a variety of options for connecting two Raspberry Pis together.

The easiest, if both Raspberry Pis are already on the same wireless network, is not to bother with a cable and just communicate over the existing network.

A second option is to create a dedicated network between the two devices by connecting them directly with an Ethernet cable. Configure eth0 statically on each system so that each has a unique ip, and you're all set.

There are other options available (e.g., wiring their serial ports together), but unless you have a very specific use case I suspect that one of the above network solutions will be the easiest to implement and use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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