User avatar
leafry
Posts: 6
Joined: Wed Sep 11, 2019 12:51 am

Joining pi's on a home network

Fri Sep 13, 2019 7:22 pm

Hey everybody. I have a trio of pi zeros that are retrieving some stats and I want to network join them on my home network so that a larger server (most likely a pi 4) can consume that data and return the results to a web app. I'm a little new to Linux and pi's, what would be my best bet in creating a domain to address the machines by computer name over the network instead of IP since that is most likely to change if the router assigns them a new one?

Andyroo
Posts: 4231
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Joining pi's on a home network

Fri Sep 13, 2019 7:32 pm

I assume you have a Pi Zero W as the Pi Zero does not have any network connections.

First thought:
A) Check the router and reserve a range of IP addresses that the router does not issue out to devices
B) Set up dhcpcd.conf to use an address in that range (static)

Second thought:
A) Find the MAC address of each Pi from the router and reserve an IP address on the router for that MAC address

Note: it is vital that you change the Pi name using

Code: Select all

sudo raspi-config
As you should never have two computers with the same name on the same network.
I also add this into dhcpcd.conf now to make sure for WiFi routers (the EE one I have is a bit naff in this respect).

So, my questions are:
1) Are these boards Zeros or Zero Ws - accuracy is key :lol:
2) How we’ll do you understand your router config screens?
3) What type of router do you have (and do you have the admin password)?
Need Pi spray - these things are breeding in my house...

User avatar
leafry
Posts: 6
Joined: Wed Sep 11, 2019 12:51 am

Re: Joining pi's on a home network

Fri Sep 13, 2019 7:41 pm

Haha for sure, accuracy is key.

1) Yes, these are Zero W's, sorry for any confusion. They are joined over wifi.
2) Not very well, but I can learn.
3) I have an orbi rbk30 bridged to a router my isp has given me. I have the admin password for both.

Andyroo
Posts: 4231
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Joining pi's on a home network

Fri Sep 13, 2019 8:18 pm

I would set each Pi up first and give them a unique name in that case.

Does the router or the Orbi give out IP addresses do you know?
Need Pi spray - these things are breeding in my house...

User avatar
leafry
Posts: 6
Joined: Wed Sep 11, 2019 12:51 am

Re: Joining pi's on a home network

Fri Sep 13, 2019 8:19 pm

Yeah, from what I understand it is what is distributing the IP addresses.

User avatar
neilgl
Posts: 819
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Joining pi's on a home network

Fri Sep 13, 2019 9:56 pm

Maybe just install mqtt on the three pi zeros and set the pi4 up as an mqtt server (mqtt broker). Then feed the data to influxdb on the pi4 and graph it with grafana on the pi4 - which you can see on a web page. That is what I do.

Andyroo
Posts: 4231
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Joining pi's on a home network

Fri Sep 13, 2019 10:15 pm

leafry wrote:
Fri Sep 13, 2019 8:19 pm
Yeah, from what I understand it is what is distributing the IP addresses.
:?: the router or Orbi?
Need Pi spray - these things are breeding in my house...

User avatar
neilgl
Posts: 819
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Joining pi's on a home network

Fri Sep 13, 2019 10:32 pm

And set the pi4 mqtt server (mqtt broker) to have a fixed ip address in your router. The other pis can then use that - they dont need a fixed ip.

Andyroo
Posts: 4231
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Joining pi's on a home network

Fri Sep 13, 2019 11:54 pm

neilgl wrote:
Fri Sep 13, 2019 10:32 pm
And set the pi4 mqtt server (mqtt broker) to have a fixed ip address in your router. The other pis can then use that - they dont need a fixed ip.
Technically NONE of them need static IPs as you can connect to an MQTT broker by name...
Need Pi spray - these things are breeding in my house...

User avatar
leafry
Posts: 6
Joined: Wed Sep 11, 2019 12:51 am

Re: Joining pi's on a home network

Sat Sep 14, 2019 12:23 am

Andyroo wrote:
Fri Sep 13, 2019 10:15 pm
leafry wrote:
Fri Sep 13, 2019 8:19 pm
Yeah, from what I understand it is what is distributing the IP addresses.
:?: the router or Orbi?
The orbi should be distributing IPs. Also, I've never heard of MQTT until now. That sounds very interesting. Just to be sure, how reliable is the MQTT method mentioned? In the future as a fyi, I would like to extrapolate the data I'm collecting and display it in a web app that will run on the Pi 4 that I can then access through my phone or some other machine.

W. H. Heydt
Posts: 10772
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Joining pi's on a home network

Sat Sep 14, 2019 2:47 am

Andyroo wrote:
Fri Sep 13, 2019 7:32 pm
I assume you have a Pi Zero W as the Pi Zero does not have any network connections.
While your assumption turned out to be correct, it didn't have to be...https://www.monoprice.com/product?p_id=9466

Andyroo
Posts: 4231
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Joining pi's on a home network

Sat Sep 14, 2019 12:39 pm

leafry wrote:
Sat Sep 14, 2019 12:23 am
...
Also, I've never heard of MQTT until now. That sounds very interesting. Just to be sure, how reliable is the MQTT method mentioned? In the future as a fyi, I would like to extrapolate the data I'm collecting and display it in a web app that will run on the Pi 4 that I can then access through my phone or some other machine.
MQTT is very reliable and you can set 'last will and testament' messages if the Pi locks / dies and even basic messages can have different service levels to increase reliability if needed. See http://www.steves-internet-guide.com for a good introduction to MQTT

As for the original request :lol:

Going by https://community.netgear.com/t5/Genera ... -p/1655446 you may not be able to set static IP addresses on the network but as I do not have one I cannot check for you. I did see that there are two apps for setting these up - it may be worth hunting the second app and see if that gives you more control.

So for now, I would avoid static addresses for every computer and set every machine up as dynamic addresses and refer to each machine by name or name.local if the network supports that correctly.
Need Pi spray - these things are breeding in my house...

User avatar
leafry
Posts: 6
Joined: Wed Sep 11, 2019 12:51 am

Re: Joining pi's on a home network

Sat Sep 14, 2019 6:47 pm

Andyroo wrote:
Sat Sep 14, 2019 12:39 pm
leafry wrote:
Sat Sep 14, 2019 12:23 am
...
Also, I've never heard of MQTT until now. That sounds very interesting. Just to be sure, how reliable is the MQTT method mentioned? In the future as a fyi, I would like to extrapolate the data I'm collecting and display it in a web app that will run on the Pi 4 that I can then access through my phone or some other machine.
MQTT is very reliable and you can set 'last will and testament' messages if the Pi locks / dies and even basic messages can have different service levels to increase reliability if needed. See http://www.steves-internet-guide.com for a good introduction to MQTT

As for the original request :lol:

Going by https://community.netgear.com/t5/Genera ... -p/1655446 you may not be able to set static IP addresses on the network but as I do not have one I cannot check for you. I did see that there are two apps for setting these up - it may be worth hunting the second app and see if that gives you more control.

So for now, I would avoid static addresses for every computer and set every machine up as dynamic addresses and refer to each machine by name or name.local if the network supports that correctly.
Awesome!!! Thank you so much for your help. This gives me a great idea of where I need to start. I will come back if I have any issues setting anything up. I was able to review some documentation on the MQTT service last night and it looks very straight forward. Again, thank you for all your help everybody.

User avatar
DougieLawson
Posts: 35836
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Joining pi's on a home network

Sat Sep 14, 2019 8:38 pm

Steve's Internet Guide is brilliant for MQTT.

There's also some good education materials at https://www.hivemq.com/mqtt-essentials/
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Beginners”