Saminnet-Search Article Wiki Forum Piwigo SNS Cloud vtiger Sugar
Clusterhat pi zero static

  • Data-Articles
    • Labuanbajo2 (287) Sat09,12:10pm

      Hari pertamaSailingKomodo, kapal kami menuju ke pulau Kanawa. Bukan Kenawa yang di Sumba itu, ya. Karena biasanya sering tertukar. Pulau Kanawa sendiri sebuah pulau kecil yang memiliki dermaga dan sebuah resort. Kalian bisa menginap di resort ini dengan fasilitas antar jemput dari pelabuhan Labuan Bajo-Kanawa. Bisa dilihat paketnya di situs-situs penjualan reservasi hotel. Kami akan mampir untuksn

      Read More...

Clusterhat pi zero static

Networking

Carlos Justiniano edited this pageツon 6 Oct 2016ツツキツ17 revisions

IMPORTANT: This section provides networking tips for configuring the cluster's two Pi 3s - it does not apply to the configuration for the third Pi 3 which is acting as a controller for the four Pi Zeros using a ClusterHat. That configuration follows.

When you first setup a Raspberry Pi (after flashing the SD card) you should it directly to your router directly using an Ethernet cable.

After starting the PI you should be able to find it byツping raspberrypi.localツto see at what IP address it resolves.

$ ping raspberrypi.local
PING raspberrypi.local (192.168.1.218): 56 data bytes
64 bytes from 192.168.1.218: icmp_seq=0 ttl=64 time=3.997 ms
64 bytes from 192.168.1.218: icmp_seq=1 ttl=64 time=2.178 ms

You can then ssh into your Pi using the defaultツpi/raspbrerryツcredentials.

$ ssh 
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 
The authenticity of host '192.168.1.218 (192.168.1.218)' can't be established.
ECDSA key fingerprint is SHA256:ZLF6F2E8NXVupKxtYaAYm5YFi84xFQYLMsN5XGDkLXk.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.218' (ECDSA) to the list of known hosts.

 This email address is being protected from spambots. You need JavaScript enabled to view it.
 's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
pi@raspberrypi:~ $

You're now ready to reconfigure the networking settings.

However, don't forget to configure your Pi by at least changing its default password. Useツsudo raspi-config.

Next, we'll use standard Debian networking. This will provide static IP addresses for each cluster node.

$ cd /etc/network
$ sudo vi interfaces

The 192.168.1.x space is used in this doc because that's the network address scheme for my home network. Yours may differ.

Change the line that reads:ツiface eth0 inet manualツto:

auto eth0
iface eth0 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 8.8.8.8 8.8.4.4

The 192.168.1.10 address above should be different for each Pi.

Next disable DHCPCD and switch to Debian networking:

$ sudo systemctl disable dhcpcd
$ sudo systemctl enable networking

Lastly,ツsudo rebootツto apply the settings on the next restart.

Ad hoc networking via a Mac

You can connect (ssh) to each Pi in the cluster by using ad hoc networking on your computer.

Then you canツsshツinto each Pi:

$ ssh 
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 

Computers

NodeUseIP
00 Redis, Hydra-router, Hydra-mcp 192.168.1.10
01 Monitor, constats 192.168.1.11
02 ClusterHat 192.168.1.12
03 Zero 1 192.168.1.13
04 Zero 2 192.168.1.14
05 Zero 3 192.168.1.15
06 Zero 4, pilights 192.168.1.16

ClusterHat Setup

TheツClusterHatツis a controller which allows the hosting of four Raspberry Pi Zeros. To do this it allows the Zeros to be networked over onboard USB connections using a bridged network.

For more about bridged networks seeツBridgeNetworkConnections

Configuring the controller for use requires modifying the networking configuration on the host Raspberry Pi (controller) and each of the connected Pi Zeros.

Firstly, setup the ClusterHat using the instructions foundツhere

Then perform the following post configurations.

Controller Setup

While working with the ClusterHat I found it useful to be able to switch from DHCP and Static networking. To facilitate this I created two files to backup the configuration for each mode.

$ cd /etc/network
$ sudo cp interfaces interfaces.dhcp
$ sudo cp interfaces interfaces.static

Then I edited theツinterfaces.staticツby simply replacing theツiface br0 inetツentry with:

iface br0 inet static
  bridge_ports eth0
  bridge_stp off
  bridge_waitport 0
  bridge_fd 0
  address 192.168.1.12
  broadcast 192.168.1.255
  netmask 255.255.255.0
  network 192.168.1.0
  gateway 192.168.1.1
  dns-nameservers 8.8.8.8 8.8.4.4

To switch between DHCP and Static I just do:

$ sudo cp interfaces.static interfaces

or

$ sudo cp interfaces.dhcp interfaces

Pi Zeros Setup

Each Pi Zero needs to be updated to create a secondary network interface to provide a static IP. A hat tip to Ken Darker for hisツexcellent post.

$ cd /etc/network
$ sudo vi interfaces

Append:

auto usb0:0
allow-hotplug usb0:0
iface usb0:0 inet static
  address 192.168.1.13
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255

Increment above address for each new node.

This allows each Pi Zero to work in the mode (dhcp / static) specified by the host Pi.

Comments   

 
0 #1 Guest 2020-06-11 19:59
Good day! I know this is kinda off topic however I'd
figured I'd ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa?
My blog goes over a lot of the same topics as yours and I believe we could greatly
benefit from each other. If you are interested feel
free to send me an e-mail. I look forward to hearing from
you! Awesome blog by the way!
Quote
 

Articles by Date

TweetTweet Share on LinkedInShare on LinkedIn Share on Google+Google+ Submit to RedditReddit Publish on WordPress WordPress Send emailSend email