User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 5:19 am

Hey guys. I'm sorry to be asking. I've been away from the Pi for a very long time. I just want to run a Pi zero W as an access point and host Mosquitto MQTT broker on it. Will it work with NOOBS or do I have to scale it down with a "Lite" version?

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 5:50 am

marine_hm wrote:
Sun Aug 12, 2018 5:19 am
Hey guys. I'm sorry to be asking. I've been away from the Pi for a very long time. I just want to run a Pi zero W as an access point and host Mosquitto MQTT broker on it. Will it work with NOOBS or do I have to scale it down with a "Lite" version?
Noobs is not an OS. It's an OS installer. I assume you mean Raspbian Desktop or Raspbian Lite.
For an AP + broker you don't need a GUI. A Zero would struggle with that anyway.
So I would go with Raspbian Lite.

mattmiller
Posts: 2102
Joined: Thu Feb 05, 2015 11:25 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 11:05 am

I'd think it would work 99% as fine on a full Desktop vs using Raspbian Lite

All my PiZero(W) run full desktops doing various tasks and I've never thought I needed to go down the Raspbian Lite route

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 11:20 am

mattmiller wrote:
Sun Aug 12, 2018 11:05 am
I'd think it would work 99% as fine on a full Desktop vs using Raspbian Lite
Clearly we're looking at things differently.
Why would I put on a GUI if I don't need it? You can't use it for setting up the AP and you also don't need it for the MQTT broker...

mattmiller
Posts: 2102
Joined: Thu Feb 05, 2015 11:25 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 12:17 pm

Why would I put on a GUI if I don't need it?
Is this going to be a 5 min argument or the full half-hour? :)

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 12:52 pm

mattmiller wrote:
Sun Aug 12, 2018 12:17 pm
Why would I put on a GUI if I don't need it?
Is this going to be a 5 min argument or the full half-hour? :)
No argument needed. I just don't understand why you would add 3GB + for something that will not be used.
Especially on a Zero that's not really equipped to use that extra functionality.
That's it, no need to try to convince me that it makes sense to do so.

lewmur
Posts: 368
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 2:57 pm

I think the important point has been missed. GUI or not, IMO, is not the question. Which OS is the question. And my answer is, stay away from Stretch Debian. It makes it more difficult the bridge from the wired port to the wifi port to create the AP. It is MUCH easier to do in earlier versions of Deb.

Heater
Posts: 13120
Joined: Tue Jul 17, 2012 3:02 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 3:17 pm

I would be very surprised if that is true.

It is wise to keep up with the latest OS releases for security and other reasons.

DirkS
Posts: 9902
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 3:31 pm

lewmur wrote:
Sun Aug 12, 2018 2:57 pm
I think the important point has been missed. GUI or not, IMO, is not the question. Which OS is the question. And my answer is, stay away from Stretch Debian. It makes it more difficult the bridge from the wired port to the wifi port to create the AP. It is MUCH easier to do in earlier versions of Deb.
Well luckily the Zero W doesn't have an ethernet port.
And OP actually doesn't say he wants to do bridging anyway...

For the rest: I have created APs on Pi pretty much from the start and on Stretch it's just as easy as on earlier versions.

lewmur
Posts: 368
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 4:03 pm

Heater wrote:
Sun Aug 12, 2018 3:17 pm
I would be very surprised if that is true.

It is wise to keep up with the latest OS releases for security and other reasons.
It is true. I know because I've done it. And older OS releases still get security updates. There is no need to have the "latest and greatest" OS version unless there is a particular feature or features you need or want.

lewmur
Posts: 368
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: Which operating system for Pi Zero W as access point, MQTT only

Sun Aug 12, 2018 4:06 pm

DirkS wrote:
Sun Aug 12, 2018 3:31 pm
lewmur wrote:
Sun Aug 12, 2018 2:57 pm
I think the important point has been missed. GUI or not, IMO, is not the question. Which OS is the question. And my answer is, stay away from Stretch Debian. It makes it more difficult the bridge from the wired port to the wifi port to create the AP. It is MUCH easier to do in earlier versions of Deb.
Well luckily the Zero W doesn't have an ethernet port.
And OP actually doesn't say he wants to do bridging anyway...

For the rest: I have created APs on Pi pretty much from the start and on Stretch it's just as easy as on earlier versions.
My bad. I assumed the access was to a LAN.

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 11:12 am

Wow! I found this less complicated last year when I made it happen. Our house or neighborhood got struck by lightening. My Pi w/zero stopped working.
I want the Pi Zero W as a solo access point running MQTT. No LAN to a router
I think I want to start from the beginning.
Format the SD card
Download Rasbian stretch light? I don't see "Jessie" anymore, is that outdated?
Unzip it, then copy those file onto the SD card?
Somewhere in all that, I understand I can modify something to make it "headless"? Turning on SSH? Where do I get the IP address? I would like to assign the IP address to the Pi. My sensors are already programmed to log into an IP address from the last Pi Zero W.
[edit] Looking back at my arduino sketch for the sensors. It logs onto the Pi via SSID, then password. Then the MQTT IP. So once I get the ACCESS point hurdled, we can assign the MQTT IP address?

I have sensors, that logged into the Pi/MQTT, EPS8266 modules that logged in retrieving the sensor data? LED lights up when the value gets to a certain point. That is my goal. Very basic. I'm not an IT guy, just a 55 y/o hobyest trying to keep my mind active.

Thanks for all your assistance.
Last edited by marine_hm on Mon Aug 13, 2018 11:36 am, edited 2 times in total.

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 11:26 am

I tried following the instructions from Adafruit like I did last year. https://cdn-learn.adafruit.com/download ... -point.pdf

Downloaded Raspbian stretch,. installed hostapd, then tried modifying the /etc subdirectory files. via keyboard/mouse HUB. They are non-existent.

Right now, I cannot SSH into the Pi I think that would be my first hurdle. {edit} Got it. Typo fixed, it's now up!

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 12:01 pm

Now that I have SSH'd into my Pi Zero W; I typed LS; I see the following folders [DESKTOP], [DOWNLOADS], [MUSIC], [PUBLIC], TEMPLATES], [DOCUMENTS], MAGPI], [PICTURES], [PYTHON-GAMES], [VIDEOS]

User avatar
B.Goode
Posts: 8273
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 12:27 pm

Apart from the fact that the Capitalisation is incorrect, that looks like a default installation of Raspbian.

The Raspberry Pi Foundation documentation for setting up your RPi as a WiFi access point that your (wifi-equipped?) Arduino can associate with is here:
https://www.raspberrypi.org/documentati ... s-point.md

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 12:50 pm

Thank you so much for the link. I'm still waiting for the update/upgrade to complete. Then, I will work on Access point configuration.

Will report back. Are you going to be available today if I have any issues? Looks straight forward but, unexpected things happen!

Again, Thank you very much for your time!

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 12:54 pm

Sorry, while I'm waiting on the upgrade... Where does the MQTT IP come in? I'm hoping that It won't matter. As long as it logs onto the pi and able to publish MQTT topic/data. ??? IDK

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 1:18 pm

I'm on the line adding a static IP address. is that where the MQTT address comes from?

interface wlan0
static ip_address=192.168.4.1/24
nohook wpa_supplicant

I don't want to go any further until I can confirm.

Thanks

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 1:24 pm

I just copied and pasted for now. I figure I can go back in and change it if needed huh?

User avatar
B.Goode
Posts: 8273
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 1:51 pm

Will report back. Are you going to be available today if I have any issues? Looks straight forward but, unexpected things happen!

The majority of assistance offered in these forums comes from (unpaid) volunteers giving up their own free time. Whether anyone with appropriate knowledge is available at any given time is purely a matter of chance.

Anyone can, and often does, contribute to a topic. There is no central agency that assigns cases to a designated 'agent' to be seen through to completion.

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 4:18 pm

Looks like I don't need the MQTT IP.
I opened 2 Putty windows
1. Subscribed to topic
2. Published to topic, msg
#1 received the message

User avatar
B.Goode
Posts: 8273
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 4:29 pm

marine_hm wrote:
Mon Aug 13, 2018 4:18 pm
Looks like I don't need the MQTT IP.
I opened 2 Putty windows
1. Subscribed to topic
2. Published to topic, msg
#1 received the message

It is true that you don't need to know the IP address of the machine running your MQTT broker in the circumstances under which you have run your test.

If you do not specify otherwise the Publish and Subscribe mechanisms assume that the MQTT Broker is running on the same system as the two clients (which you create in the 2 PuTTY sessions.) So it silently 'does the right thing.'

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Mon Aug 13, 2018 7:19 pm

Dang. The sensors all have the MQTT IP address. they sit there doing nothing until connected. So I need to figure out how to assign the MQTT address. I obviously did this before and poor documentation on how I did it. Will have to document it well this go around.

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

Re: Which operating system for Pi Zero W as access point, MQTT only

Tue Aug 14, 2018 8:36 am

MQTT is a layer 4 protocol. Layer 4 has an assigned PORT number.

IP addresses are assigned at layer 2.

What you mean is the IP address for the server running your MQTT broker (which is most likely Mosquitto at port 1883).
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.

User avatar
marine_hm
Posts: 82
Joined: Tue Mar 07, 2017 4:27 pm

Re: Which operating system for Pi Zero W as access point, MQTT only

Tue Aug 14, 2018 12:28 pm

Just to try out a theory to make sure it's working correctly. I changed the sketch on one ESP8266 sensor so that the MQTT server IP was the same as the new Pi Zero W when I type ifconfig

// Connect to the WiFi
const char* ssid = "PiCharts";
const char* password = "Espressif";
const char* mqtt_server = "192.168.4.1";

It does log on and works correctly. So my issue now is NOT with MQTT but assigning the Pi Zero W's IP address to match the IP address from the previous Pi Zero W. Just so I'm not pulling apart a bunch of sensors to change the IP address in the individual sketches.

I did it with this tutorial: https://www.raspberrypi.org/documentati ... s-point.md

Two lines that I'm looking at :
sudo nano /etc/dhcpcd.conf

interface wlan0
static ip_address=192.168.4.1/24
nohook wpa_supplicant

sudo nano /etc/dnsmasq.conf

interface=wlan0 # Use the require wireless interface - usually wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h

Not sure if I even need the dnsmasq.conf file unless each ESP loging in will be assigned an IP while it's logged in.

I definitely need to change the Static ip_address=169.254.78.169 so all my sensors can log into MQTT
So it's down to; what to do with the dnsmasq.conf?

Thanks

Return to “General discussion”