Controlling the cluster

593 views
Skip to first unread message

Bryant Moyle

unread,
Jun 17, 2019, 6:05:05 PM6/17/19
to ClusterHAT
After setting everything up, the base pi is connected to the internet, I can SSH into it, and I can run commands like 'clusterhat on' etc, how can I ssh into the pi0's? I can't connect them to the internet through their wifi chips because of them being connected to the HAT, and I don't even know their IP's so ssh in. I want to use something like Python's Fabric to control the cluster, but I can't connect due to me being unable to connect to the 0's.

If the raspberry Pi is connected to the internet, does that mean the pi0's are connected as well? Are they discover-able using a program to view active IP addresses on my router?

Chris Burton

unread,
Jun 17, 2019, 7:18:25 PM6/17/19
to ClusterHAT
Hi, 
After setting everything up, the base pi is connected to the internet, I can SSH into it, and I can run commands like 'clusterhat on' etc, how can I ssh into the pi0's? I can't connect them to the internet through their wifi chips because of them being connected to the HAT, and I don't even know their IP's so ssh in. I want to use something like Python's Fabric to control the cluster, but I can't connect due to me being unable to connect to the 0's.

Being on the Cluster HAT doesn't prevent you from configuring WiFi on the individual Pi Zeros, but you'd need to alter the priority (metric) to tell the Pi Zeros to prioritise the gateway on the WiFi interface over the USB gadget interface ( see https://groups.google.com/d/msg/clusterhat/whZHOo836uU/ooYqlHWcCwAJ ).
  
If the raspberry Pi is connected to the internet, does that mean the pi0's are connected as well? Are they discover-able using a program to view active IP addresses on my router?

It depends, there are many combinations - which image are you using on the controller and how are you connecting the controller to your local network?

Chris.

Bryant Moyle

unread,
Jun 17, 2019, 7:32:34 PM6/17/19
to ClusterHAT
It depends, there are many combinations - which image are you using on the controller
 
I am using the "Stretch (FULL) with Desktop Controller and Lite P1/2/3/4 images."
 

how are you connecting the controller to your local network?

I have a USB WiFi chip in my controller (as it doesn't have built in WiFi) but Ethernet is the end goal for the connection.

Being on the Cluster HAT doesn't prevent you from configuring WiFi on the individual Pi Zeros

I don't think it's the fact that I'm being prevented from configuring WiFi, it's the fact that I have no access to any terminal or GUI to configure WiFi, which is why I was asking if there's a way to control the 0's from the controller and not just have the basic commands. Apologies if that didn't come across in my first post. 

Chris Burton

unread,
Jun 17, 2019, 7:54:16 PM6/17/19
to ClusterHAT
Hi, 
It depends, there are many combinations - which image are you using on the controller
 
I am using the "Stretch (FULL) with Desktop Controller and Lite P1/2/3/4 images."
 

how are you connecting the controller to your local network?

I have a USB WiFi chip in my controller (as it doesn't have built in WiFi) but Ethernet is the end goal for the connection.

Still a few combinations :).

If/when you use Ethernet and assuming you have a DHCP server on your network the controller and Pi Zeros will all get an IP address and be accessible from the local network using their hostname controller.local/p1.local/p2.local/etc. assuming you have avahi/zeroconf/bonour or you can lookup the IP address on your router, etc. as normal ( https://www.raspberrypi.org/documentation/remote-access/ip-address.md ).

If you're using WiFi then only the controller would get an IP from your access point/router.
- The controller would also get the fallback IP 172.19.180.254.
- The Pi Zeros would get a fallback IP 172.19.180.X where X is the pX number so you'd be able to talk to the Pi Zeros from the controller but the Pi Zeros wouldn't be able to talk to the rest of the network in either direction.

You'd need to switch the image to NAT (reconfigure to "cnat" - see the Intermediate tab on https://clusterhat.com/setup-software ) to allow the Pi Zeros to access the rest of your network/internet but as it's NAT to go the other way you'd need to log into the controller first then to the Pi Zeros (you can always switch it back by reconfiguring to "c" which works best on Ethernet to the controller).

Being on the Cluster HAT doesn't prevent you from configuring WiFi on the individual Pi Zeros

I don't think it's the fact that I'm being prevented from configuring WiFi, it's the fact that I have no access to any terminal or GUI to configure WiFi, which is why I was asking if there's a way to control the 0's from the controller and not just have the basic commands. Apologies if that didn't come across in my first post. 

The images are just a modified Raspbian so you can enable SSH and setup WiFi in the standard headless way ( https://www.raspberrypi.org/documentation/configuration/wireless/headless.md ).

You can use minicom from the controller pi to access the Pi Zeros over the USB Gadget Serial console "minicom p1", "minicom p2", etc. (use CTRL-A, then 'q' to exit from minicom), or if you're more familiar with screen then "screen /dev/ttypiX" where X is the pX number (use CTRL-A, then 'k' to exit). Using either one you'll probably need to press enter to get a login prompt to show up.

Chris.

Bryant Moyle

unread,
Jun 18, 2019, 11:39:55 PM6/18/19
to ClusterHAT
Okay, so I redid all of the pi's, and clean installed all of them with the bundled light version of stretch (Stretch Lite Controller and Lite P1/2/3/4 images.)

When plugging the controller into Ethernet, and doing an IP scan, I only see 1 raspberry pi, which is the controller. Now, from the controller, how would I set up the respective 0's 1-4 to the internet? I cannot edit them from the controller, and if I can I haven't found any information on how.

Chris Burton

unread,
Jun 19, 2019, 12:56:37 PM6/19/19
to ClusterHAT
Hi, 
When plugging the controller into Ethernet, and doing an IP scan, I only see 1 raspberry pi, which is the controller. Now, from the controller, how would I set up the respective 0's 1-4 to the internet? I cannot edit them from the controller, and if I can I haven't found any information on how.

I assume you plugged it into the Ethernet and then powered on the Pi Zeros? Are you using the "controller" image or did you switch to NAT ("cnat") ?

If you're using the "controller" image and have a DHCP server on the local network you shouldn't need to do anything, it should automatically assign an IP on the controller and Pi Zeros via DHCP.

What does "sudo brctl show", "sudo ifconfig -a" look like on the controller and if you're able to login using "minicom p1" to the Pi Zero from the controller what does "sudo ifconfig -a" look like there?

Chris.

Bryant Moyle

unread,
Jun 19, 2019, 5:03:49 PM6/19/19
to ClusterHAT
I assume you plugged it into the Ethernet and then powered on the Pi Zeros? Are you using the "controller" image or did you switch to NAT ("cnat") ?

"Controller" image because I'm using Ethernet.
 
If you're using the "controller" image and have a DHCP server on the local network you shouldn't need to do anything, it should automatically assign an IP on the controller and Pi Zeros via DHCP

The controller has an auto-assigned IP, but the 0's don't. I turned them on and re-scanned my network and still only have the controller connected with an IP.
 
What does "sudo brctl show", "sudo ifconfig -a" look like on the controller
 

if you're able to login using "minicom p1" to the Pi Zero from the controller what does "sudo ifconfig -a" look like there?
 

Chris Burton

unread,
Jun 19, 2019, 7:17:44 PM6/19/19
to ClusterHAT
From that output it looks like P1 isn't online, but P2/3/4 are. Can you access those either by SSH or minicom?

For P1, I'd advise checking the Pi Zero is pushed far enough onto the connector on the Cluster HAT (when new they will normally "click" when they're on far enough).

If that looks OK, power off P1, remove the SD card, power on P1, wait a minute and check the output of "lsusb -t".

For P1 do you see something like this (the Dev number will be different) but P1 will show up as Port 4 as below.

|__ Port 4: Dev X, If 0, Class=Vendor Specific Class, Driver=, 12M

If you do see similar then I'd power off p1, and reimage the SD card.

If not, then check again then maybe switch it with another Pi Zero (without SD card) and see if you see it show up as a 12M device or not to work out if it's an issue with the connector on the ClusterHAT or with the Pi Zero.

Chris.
Reply all
Reply to author
Forward
0 new messages