Trouble configuring rpi 3B+ and piBeacon to use wifi

BillC
Posts: 238
Joined: Sun Mar 09, 2008 4:51 pm

Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by BillC »

New user of piBeacon, need a bit of assistance.

Using piBeacon 7.128.459, buster 2020-02-25 ssd image.

Can someone point me to instructions to bring up an rpi 3B+ to use wifi, both by using ethernet initially and starting with wifi?

Using the Debian distro through rpi, the rpi has no trouble showing available networks and connecting to my SSID without having ethernet connected, so the rpi's wifi works. piBeacon works well through ethernet, I just can't get wifi operational.

Using the piBeacon SD image as above, even though wlan0 is "UP", no packets are being transmitted; doesn't look like the interface is being used therefore dhcp request doesn't get sent. The wifi mac address is in my router to give a specific wlan IP, but piBeacon reports "no ip number working".

If I then connect an ethernet cable, the rpi immediately obtains an IP address through dhcp.

I would like to be able to change to wifi. More importantly, I would also like at some point to add one or more rpi 0-W's, so I need to be able to start from scratch with only wifi and terminal input (keyboard and monitor on rpi).

I have tried the procedures here , and adding json file {"SSID":"abc", "passCode":"def"} to the boot directory on the sd card as described here, without success.

Appreciate any pointers to what I'm missing. Have read a bunch of topics in this subforum but not finding the right place.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by kw123 »

BillC wrote:New user of piBeacon, need a bit of assistance.

Using piBeacon 7.128.459, buster 2020-02-25 ssd image.

Can someone point me to instructions to bring up an rpi 3B+ to use wifi, both by using ethernet initially and starting with wifi?

Using the Debian distro through rpi, the rpi has no trouble showing available networks and connecting to my SSID without having ethernet connected, so the rpi's wifi works. piBeacon works well through ethernet, I just can't get wifi operational.

Using the piBeacon SD image as above, even though wlan0 is "UP", no packets are being transmitted; doesn't look like the interface is being used therefore dhcp request doesn't get sent. The wifi mac address is in my router to give a specific wlan IP, but piBeacon reports "no ip number working".

If I then connect an ethernet cable, the rpi immediately obtains an IP address through dhcp.

I would like to be able to change to wifi. More importantly, I would also like at some point to add one or more rpi 0-W's, so I need to be able to start from scratch with only wifi and terminal input (keyboard and monitor on rpi).

I have tried the procedures here , and adding json file {"SSID":"abc", "passCode":"def"} to the boot directory on the sd card as described here, without success.

Appreciate any pointers to what I'm missing. Have read a bunch of topics in this subforum but not finding the right place.
The trick with the text file on the ssd boot directory only work with a fresh ssd. After it works the “master” program assumes it is configured and you can setup WiFi yourself

This is mainly for pi0 They do not have an Ethernet port.

So you need to setup your WiFi yourself

1. With graphic interface setup WiFi
2. Create the proper interface and supplicant file in the proper directories
3. Edit ~/pibeacon/interfaces and /wpa_supplicant Then run
sudo python interface.py
It will copy the files to the proper directories

You can also
Look at interface.py where it copies the files to.

This assumes you know how to edit files on the rpi.

Also in indigo edit rpi device you can disable /enable Ethernet / WiFi

By default it should be 1. use Ethernet if available otherwise WiFi. If Ethernet is on do not use WiFi

Hope that helps.

When you have setup WiFi you also need to tell the plugin the new ip number of the rpi in either edit rpi device or initial setup of rpi.


If you still have problems let me know- I can walk you through the steps online if you like

Karl


Sent from my iPhone using Tapatalk
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by kw123 »

here the python ppm that copies the files:

Code: Select all

import subprocess
subprocess.Popen("sudo cp /home/pi/pibeacon/interfaces /etc/network/interfaces ",shell=True)
subprocess.Popen("sudo cp /home/pi/pibeacon/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf ",shell=True)
here a basic supplicant file:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
      ssid="xxx"
      psk="yyy"
}
replace xxx and yyy with your sid and password

and the basic interfaces file:

Code: Select all

source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Karl
BillC
Posts: 238
Joined: Sun Mar 09, 2008 4:51 pm

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by BillC »

Karl, thanks for the replies. Tomorrow when I have some time I will start over with a fresh ssd. But it seems to me the problem is that the rpi never tries DHCP on the wlan0 interface, and therefore doesn’t get to the SSID/pwd entries.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by kw123 »

Yes you need to have a valid interfaces file

As WiFi only works if you have the proper ssid you need to edit these files anyway.

Hence any preconfigured setup would not work

That is why I added the option to supply the interface and wpa supplicant files on the ssd
That’s where you have to set the dhcp info.

Karl


Sent from my iPhone using Tapatalk
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by kw123 »

I just published a new version that allows to create interfaces as well as wpa_supplicant.conf file(s) in the boot directory on the RPI ssd at EVERY boot

1.put the ssd into the mac card reader
2.create interfaces and wpa_supplicant file as described above
3. put ssd into rpi
4. reboot the rpi

BEFORE this works you need to upgrade the plugin version and push the new version to the RPI(s)

Bill for you -- BEFORE step1:
connect the rpi w ethernet
upgrade the plugin - the plugin should push the new version to the rpi (if the userid ip# are correct)
then do step 1,2,3,4 from above


Karl
ps..
this is the program that does the copying:

Code: Select all

def copySupplicantFileFromBoot():
	try:
		retCode = False
		if os.path.isfile("/boot/wpa_supplicant.conf"):
			subprocess.call("/usr/bin/sudo cp  /boot/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf", shell=True)
			subprocess.call("/usr/bin/sudo rm  /boot/wpa_supplicant.conf", shell=True)
			retCode = True
		if os.path.isfile("/boot/interfaces"):
			subprocess.call("/usr/bin/sudo cp  /boot/interfaces  /etc/network/interfaces", shell=True)
			subprocess.call("/usr/bin/sudo rm  /boot/interfaces", shell=True)
			retCode = True
		return retCode
	except	Exception as e :
		logger.log(30, u"cBY:{:<20} Line {} has error={}".format(G.program, sys.exc_info()[-1].tb_lineno, e))
	return False
BillC
Posts: 238
Joined: Sun Mar 09, 2008 4:51 pm

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by BillC »

I just published a new version that allows to create interfaces as well as wpa_supplicant.conf file(s) in the boot directory on the RPI ssd at EVERY boot

1.put the ssd into the mac card reader
2.create interfaces and wpa_supplicant file as described above
3. put ssd into rpi
4. reboot the rpi

BEFORE this works you need to upgrade the plugin version and push the new version to the RPI(s)

Bill for you -- BEFORE step1:
connect the rpi w ethernet
upgrade the plugin - the plugin should push the new version to the rpi (if the userid ip# are correct)
then do step 1,2,3,4 from above
Thanks, Karl, that worked.

What would I need to do to set up without using ethernet, as if I were setting up the zero-w?
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by kw123 »

put the wpa_supplicant file into the boot directory while mounted on the mac BEFORE you put it into the RPi 0


Karl
BillC
Posts: 238
Joined: Sun Mar 09, 2008 4:51 pm

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by BillC »

To be clear: just the wpa_supplicant.conf file, not interfaces and not the wifiInfo.json file?
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by kw123 »

on the SSD only the wpa_supplicant file is copied and also if present the Json - don't do both

in the new plugin version it will look at wpa_.. interfaces and json BUT that only gets there after you have it connected at least through ethernet and the plugin can push the new version.

What I also do with an rpi0: put a usb--> ethernet connector, to get things setup. you can that remove later. they cost $8 at amazon

Karl
BillC
Posts: 238
Joined: Sun Mar 09, 2008 4:51 pm

Re: Trouble configuring rpi 3B+ and piBeacon to use wifi

Post by BillC »

What I also do with an rpi0: put a usb--> ethernet connector, to get things setup. you can that remove later. they cost $8 at amazon
Now that makes a lot of sense and I should have thought of it earlier, since I knew they existed.

Thanks for all your help, and for sharing all your work!

Bill
Post Reply

Return to “piBeacon”