2

I am running an Intro to Robotics class, and I am having them create different projects to use in my classroom with pi zero 2ws. For example: a countdown clock using LED lights. I want to be able to connect all these projects together with a Raspberry Pi 4 wirelessly and be able to control them. I do not have access to the school wifi as it is blocked, and so I cannot ssh into the pi. I need to make a standalone network that I can access.

Is it possible for the Pi 4 to set up a network that several devices can connect to? And then, could I use my own personal computer to connect to it and send out commands to the separate pi projects? For example - Type '3 minutes' into Thonny from my computer and have the pi zero start a 3 minute countdown on a separate device.

There are several tutorials on creating wifi access points, but they are all way over my head. Is there a simple way to do this? Or, can you direct me to a good resource?

Here is one webpage that looks like it has a lot of information, but it is rather confusing to me. As a teacher, I am an avid learner. Would you send me to a good place to begin learning about networks?

Thanks!

Setting up a Raspberry Pi as an access point - the easy way

  • This Question does not conform to the guidelines - it lacks focus. Concentrate on ONE issue at a time. – Milliways Apr 01 '22 at 00:59
  • RaspberryPi Ltd has extensive documentation - much free. See https://magpi.raspberrypi.com/books – Milliways Apr 01 '22 at 05:45
  • https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-a-routed-wireless-access-point – Dougie Apr 01 '22 at 08:02
  • Does this answer your question? [Raspberry Pi 3 Model B Access Point](https://raspberrypi.stackexchange.com/questions/63411/raspberry-pi-3-model-b-access-point) – Dougie Apr 01 '22 at 08:04
  • No thanks necessary. You may want to accept the answer you consider to be correct and click on gray check mark next to the correct answer and turn it green ✅. This will mark the problem solved and will help others. – user68186 Apr 05 '22 at 19:37

3 Answers3

3

A Cheap WiFi Router

The simplest way seems to get hold of a cheap WiFi router. It can be old. You don't need high speed or the latest protocol. Any WiFi router that supports 802.11n should work.

The router should not be connected to the Internet. You can set it up by temporarily connecting the router to the laptop or the Pi 4 using an Ethernet cable. You may want to change the SSID to something like "ClassBotNetwork" and assign a password.

Once setup you should be able to connect all the Pies to that WiFi network as usual.

You will need to setup all the Pi 0s as ssh servers. At this point you should be able to ssh from your Pi 4 to all the Pi 0s.

There are ssh tools that allow connecting to multiple servers, P 0s in your case, and send the same commands to them all. For example, pssh or clusterssh.

Hope this helps

user68186
  • 420
  • 3
  • 13
  • 1
    ...I had never thought about this. That is definitely the easiest work around. I just ordered a $20 router. Thank you so much! I have already used ssh for Pi 0s before, so it should quite simple. – Joshua Mitchell Apr 05 '22 at 19:32
1

Tough spot for a teacher... if this were my problem, I think I would first try to follow the systemd procedure - the one you noted at the bottom of your question. @Ingo's answers are typically very thorough, and this answer has quite a few upvotes. He also provided another answer that contains some "checkpoints" that may be useful.

A few other comments that may or may not help... I make them only because your question omits some specifics:

  • With the stand-alone network you describe, there is no need for routers; a router would only be needed (for example) to route your stand-alone network traffic into the school's WiFi system, or directly to the Internet.

  • Re *"a simple way to do this?"*: Simple is a relative term of course, but if you mean you do not wish to make configuration changes to your system, then I'd suggest you consider spending a bit of cash to get perhaps a human friendly commercial WiFi box - perhaps similar to this.

  • Also Re. "simple": One of the answers in your reference contains a link to the pi-ap script that might take care of the pick and shovel work. I've not tried it, and can't comment except to say that it's not been updated in 3 years, has some open issues that go back a while, and the author hasn't posted in 2 years. OTOH, at least one report says it works well.

One recommendation:

If you elect to take on the pick and shovel work using either the systemd-networkd approach, or Milliways' recommended RPi official approach, consider this for risk-mitigation:

When one makes configuration changes, there is always a risk of breaking your system; even seasoned admins face recovery risks. However, there is an outstanding and inexpensive risk mitigator available to all in the form of a spare SD card. I would strongly suggest that you start your systemd-networkd (or RPi official approach) re-configuration using a newly-flashed SD card. Remove your current SD card, and set it aside for the time being. If your efforts wreck the system's networking configuration, restoration is a simple 60-second swap to your original SD card.

etc, etc

That likely concludes the actual answer part of this answer. The remainder is offered FWIW:

One potential snag is that the procedures listed above were developed against the buster version of RPi OS, and bullseye is now current. I feel it's unlikely that the differences between buster and bullseye would derail the configuration, but as I've not tried this, please take that with a grain of salt!

As noted in Milliway's answer, systemd-networkd is an alternative to the more conventional procedure outlined in the "official documentation", but his answer leaves it unclear whether or not he has verified that procedure.

Inevitably, it comes down to your choice. I felt for years that a visit to the dentist's office was the only thing worse than learning systemd, but I now admit that it does have some useful aspects, and even this Luddite now uses it for a few things. systemd currently acts in the role of init on your RPi; huge role in your current RPi as the init systemd apparently aims to be all things to all people, and systemd-networkd is the project's foray into networking. In general, networking is a rather fragmented business in Linux with several competing schemes, and the idea of having a single approach that works across all platforms is a compelling one.

Debian's (and therefore RPi OS) current approach to networking does not use systemd-networkd. RPi OS specifically uses dhcpcd as its network manager, and dhcpcd cannot be run concurrently with systemd-networkd.

Seamus
  • 18,728
  • 2
  • 27
  • 57
  • Thank you for your in-depth and helpful answer! It is very wise to have a spare SD card, and I will definitely try that first. I would like to dive into learning sysemd. Would you recommend just starting with the normal pi documentation? Or, is it best to begin with this project first to get a feel for it? Is there another resource for learning you would recommend? – Joshua Mitchell Apr 05 '22 at 19:33
  • @JoshuaMitchell: `"Would you recommend just starting with the normal pi documentation?"` No - not there. :) `systemd` is wide and deep. It has a controversial past, & makes for interesting reading sometimes. As `systemd` currently performs the role of `init` in RPi, it touches all of the core services. I am still learning `systemd`, and expect that to continue *forever*. IMHO, the best way to learn is a combination of reading **and** doing. You might [start with this article](https://www.tecmint.com/systemd-replaces-init-in-linux/) & then search for more. – Seamus Apr 05 '22 at 20:09
  • There are many good, read-able [systemd articles on LWN](https://duckduckgo.com/?q=linux+systemd+LWN). As far as the "doing" part of it, [this search](https://duckduckgo.com/?q=writing+systemd+unit+files) should contain a "hello World" `systemd` unit file in at least one of the articles - may start w/ DigitalOcean as their stuff is usually accurate & updated. – Seamus Apr 05 '22 at 20:15
  • It can be educational to look at systemd configuration files that exist for services that are preinstalled and working. Look at the privileged command systemctl that provides administrator control of services that are set up for systemd. Use "dpkg -L " to list all files installed with , looking specifically for those files that are installed under /etc and /lib/systemd. (You can also see what man pages are installed by the package.) – Chad Farmer Apr 08 '22 at 05:26
  • @JoshuaMitchell: Glad it was helpful; [please read this](https://raspberrypi.stackexchange.com/help/someone-answers) – Seamus Apr 08 '22 at 15:40
0

systemd-networkd is a powerful network management tool BUT is is NOT simple to setup, and if you are inexperienced I suggest you try the normal process for setting up an Access Point as recommended by RP Ltd. Setting up a Routed Wireless Access Point.

If I wanted to do this I would use a stand alone router, which is likely to perform better. Most of us have old routers in our junk box but new basic routers are quite inexpensive. This is much simpler, particularly if you are struggling to follow tutorials.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • Thank you so much for your answer and the idea. I am going to pick up a cheap router and try that way. I will keep my questions more specific in the future. I also like your name. – Joshua Mitchell Apr 05 '22 at 19:36