1

I want to connect 4 RasPi to one windows PC using ethernet cables. The plan is to have each RasPi equipped with a camera. I will have the cameras start recording upon the press of a button, then a second button press will stop the recording AND send the video file to the PC for storage and analysis. So, the RasPis are only connected to power, the button(s) and the PC through the ethernet cables.

I am only looking for help to setup the connection between the RasPis and PC so this idea can work. I will deal with the button and camera setup myself. I am just providing the full picture in case something was relevant and I did not realise.

I was planning to use an ethernet switch and setup a LAN with the PC as a host. However, I cannot find clear instructions on how to do that...

Any advice appreciated!

  • what operating system is running on the PC? If it's any version of microsoft windows, by far the simplest solution is to set static IP addresses on all machines, including the PC – Jaromanda X Mar 16 at 1:38
  • what hardware are you using for setting up the LAN? – jsotola Mar 16 at 4:30
  • Buy the switch. Plug in cables from the PC and each of the Pis. Job done. If that doesn't work perhaps ask another question. – joan Mar 16 at 10:27
  • @Jaromanda X - The PC operates windows XP, so yes, I was planning to set static IPs, but was not sure that would be enough. Thank you for comfirming. – PVV Mar 16 at 17:33
  • @jsotola - I was planning to use an ethernet switch – PVV Mar 16 at 17:36
4

Here's a quick and dirty sketch to get you going. All you need to do is plug the devices into the switch, then add appropriate IP address information to all of the hosts. After that, you'll be able to communicate to/from the PC to the Pis, and the Pis between themselves.

            -------------
            |           |
            |   PC      |
            |           |
            -------------
                 |
                 |
            -------------
            |           |
          _ | switch    |__
         /  |           |  \
        /   -------------   \
       /     |     |         \
      /      |     |          \
-------  -------  -------  -------
|     |  |     |  |     |  |     |
| pi1 |  | pi2 |  | pi3 |  | pi4 |
-------  -------  -------  -------

Static IP address information:

PC: 192.168.10.5/24

pi1: 192.168.10.1/24

pi2: 192.168.10.2/24

pi3: 192.168.10.3/24

pi4: 192.168.10.4/24

Note that the /24 simply means use a subnet mask of 255.255.255.0. Also note that you have no need to add any default gateway information, as this is purely a local network with no exit point.

  • Thank you for taking the time to answer. Looking at your sketch - this is precisely what I am planning to do! However, is the assigning of IP addresses something I need to do by programming each Pi separately, or does it happen automatically once you plug in the Pis in the switch? For example - is this method necessary, and will it work: instructables.com/id/… – PVV Mar 16 at 17:28
  • Those instructions are one way to set a static IP address on your Pis, yes. – stevieb Mar 16 at 17:48
  • Thank you very much! – PVV Mar 16 at 17:52
  • No worries, glad I could help! – stevieb Mar 16 at 17:58
  • Note that instead of a switch, you could buy a cheap home gateway device (eg. "router") with enough LAN side ports for all five devices, plug them all in, and the "router" will automatically supply all of the IP address information to all connected devices. The LAN side is literally just a switch, so leave WAN out of the equation. You could also use just a switch (without the "routing" piece), and set up one of your Pis (or the PC) as a DHCP server for the same effect. – stevieb Mar 16 at 18:01

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.