Pi Zero W and SSID changing

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
CJ01
Posts: 29
Joined: Sat Jun 23, 2018 12:40 am

Pi Zero W and SSID changing

Post by CJ01 »

I have a Pi3B+ setup as a router (DietPi version). My PiZero W(using the Pi light version) was setup in Raspi-Config to access it.
It gave out an IP address 192.168.42.14. My Cable router is 192.168.1.1. (I know the Pi3B+ has an IP address of 192.168.42.1.)
I could not get to the Pi Zero W through SSH on my windows laptop. (Have done many times before but only when connected to cable router). SSH is enabled. So I used Raspi-Config to change the SSID and password to my cable router. Rebooted. The IP address is still at 192.168.42.14. Does Raspi-Config overwrite or add the SSID's? I havn't went into the config files to check.
I'm just wondering if anyone else has had this problem. Plus should I not be able to get to the Zero W regardless of the IP address?
As long as it's on my network? I guess that's multiple questions.
CJ01
Posts: 29
Joined: Sat Jun 23, 2018 12:40 am

Re: Pi Zero W and SSID changing

Post by CJ01 »

And yes I did enable SSH through Raspi-Config
User avatar
WarHawk
Posts: 622
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi Zero W and SSID changing

Post by WarHawk »

Possible help here

/etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="Your SSID"
    psk="YourWPAPassword"
    key_mgmt=WPA-PSK
}
Change the country code to your country of course ;)
https://medium.com/@jay_proulx/headless ... dd8c4d2742
User avatar
MichaIng
Site Admin
Posts: 2336
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pi Zero W and SSID changing

Post by MichaIng »

Btw.:
Do not use "raspi-config" on DietPi systems. "dietpi-config" can do the same and more and is fully compatible the way DietPi works, scrapes and sets config files.

Change your SSID via dietpi-config > Network Settings (Adapter) > WiFi

SSH is enabled by default on DietPi images via Dropbear. You can change to OpenSSH if somehow requires via "dietpi-software".

"raspi-config" might work here as well but might also break the way DietPi implements/sets the features as said.
CJ01
Posts: 29
Joined: Sat Jun 23, 2018 12:40 am

Re: Pi Zero W and SSID changing

Post by CJ01 »

I'm using Raspian lite not DietPi. I had a post earlier about DietPi keeps rebooting when I install RPI Webcam.
OR RealVNC installed. I basically abandoned DietPi OS since no one could help me for the Pi Zero W.
The basic answer was always the Power Supply was not strong enough. Which is incorrect since I tested it.
User avatar
MichaIng
Site Admin
Posts: 2336
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pi Zero W and SSID changing

Post by MichaIng »

Ah sorry missed that part and remember your other topic. GitHub issue about it is opened and I hope Fourdee (or someone with Pi Zero W at home) is able to test and replicate, now that v6.13 is released.

To access from laptop to Pi Zero, laptop and Pi Zero need to be successfully connected to this same subnet, but I guess you know that. So if laptop is connected to cable router, Pi Zero needs to be as well and this should be possible to achieve via raspi-config, in case after reboot. Check this as WarHawk said via wpa_supplicant.conf and also check /etc/network/interfaces, if wpa_supplicant is correctly added there for WPA support.

But actually I guess you want both, laptop and Pi Zero to be connected to the Pi3 hotspot, enabling you SSH via the 192.168.42.* subnet? So check first, if the laptop successfully connects to the Pi3 subnet, has internet access afterwards (via RPi3 -> cable router -> www).
CJ01
Posts: 29
Joined: Sat Jun 23, 2018 12:40 am

Re: Pi Zero W and SSID changing

Post by CJ01 »

Thanks. Hopefully they will fix the endless rebooting.

As for the SSID.
My normal network router is 192.168.1.1. The DietPi AP hotspot assigned 192.168.42.1. So basically if I want to access the Zero W which is running off the AP Hotspot I need to make sure they're both on 192.168.1 or 192.168.42 ?

I had a AP Hotspot setup before but with Raspian and configured it as static 192.168.1.200 and gave out address 192.168.1.201-254.
I actually made the pi Zero w also static as 192.168.1.201 & 192.168.1.202 (for my 2 Rpi Webcam setups).

Can I go in the files and change the Ip Address on the Pi 3 (DietPi AP setup) and make it static and on the same subnet 192.168.1 as I did on my old AP setup under Raspian? I'm afraid when I do an Update/Upgrade in DietPi it may reset the IP addresses.
User avatar
MichaIng
Site Admin
Posts: 2336
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pi Zero W and SSID changing

Post by MichaIng »

So basically if I want to access the Zero W which is running off the AP Hotspot I need to make sure they're both on 192.168.1 or 192.168.42 ?
Exactly.
I had a AP Hotspot setup before but with Raspian and configured it as static 192.168.1.200 and gave out address 192.168.1.201-254.
And this AP was connected via cable to router with another 192.168.1.* IP? Not sure if it is possible to use the same subnet for cable interface and AP wifi interface. At least this could cause some issues, two DHCP servers on the same subnet (router + AP), the AP being available via two different IPs (eth and wifi IP) and so on, but based on the real network it might work.
At least you don't need to worry about if you connect to router or RPi3 AP then, as both share the same subnet.

I guess your AP wifi interface is wlan0? Check "ip a" if this shows up in combination with the AP IP.
You can adjust the related device IP within /etc/network/interfaces and to apply it instantly, use "ip addr add 192.168.1.200 dev wlan0".
And you also need to change the DHCP server settings: /etc/dhcp/dhcpd.conf

Never tested it, at best create backups of the files first. I derived this from our hotspot install/config code: https://github.com/Fourdee/DietPi/blob/ ... i-software
CJ01
Posts: 29
Joined: Sat Jun 23, 2018 12:40 am

Re: Pi Zero W and SSID changing

Post by CJ01 »

Thanks for the response. I will definitely check out the install code and other files you mentioned.

Yes, the Raspian version of the AP worked great. It was 192.168.1.200 (static) and gave out range 201 to 254. I made the 2 Pi Zero W webcams statics at 192.168.1.201 & 202. I even tested my laptop and phone against it (Raspian AP) and they worked fine. Thats why I was not aware that you couldn't have two routers on the same subnet.

So if I understand you correctly, with the DietPi setup I can only get to the Pi Zero W's by SSH'ing off the actual Pi3 AP (DietPi) and not through my laptop since it's on a different subnet? Or I would have to be using the AP DietPi as my router for my laptop to SSH into them?

This Is why I wanted to know if I can change the config files to be on the same setup as my original Raspian AP version?

Thanks for any help.
Post Reply