wanstreet
Posts: 38
Joined: Fri Jun 01, 2018 5:28 am

AP + WiFi Station without ethernet cable

Wed Jun 20, 2018 6:56 am

I am trying to make an Access Point as well as Wireless station using onboard wifi of Rpi3.
I can make the access point but sadly it doesnot connect to the internet.
It is always either AP or WIFi station.
Any suggestions over here on how to achieve this task?
Can i use the dhcpcd service as a dhcp server to lease out IP address for other devices?

epoch1970
Posts: 1929
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: AP + WiFi Station without ethernet cable

Wed Jun 20, 2018 9:28 am

You can try your luck searching to "virtual AP" threads, it is marginally possible to have an AP + STA setup with the built-in interface on a Pi 3.

dhcpcd is a client deamon. Dnsmasq is often a good choice as a server.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

shanem2
Posts: 13
Joined: Tue Jan 23, 2018 10:38 am

Re: AP + WiFi Station without ethernet cable

Wed Jun 20, 2018 10:53 am

@wanstreet - I'm trying to achieve the same. Basically looking at WiFi for my NAS but I have a second RPi which will be a different location and primary will Sync.

I'm struggling with the first part, but doing mine all headless as I don't have suitable monitors and keyboard/mouse.

I can see my WiFi AP come up, but it's not issuing IPs. I had a static on one host and got a single ping working but then fails. I'm thinking it's an iptables issue.

I'll work on the client side once this works.

I'm going to also install Plex so my kids can watch movies from tablets on the go. The NAS is so we can backup files from other devices.

If you have any links or config files, please share. I'll let you know what I have re AP Client shortly.

shanem2
Posts: 13
Joined: Tue Jan 23, 2018 10:38 am

Re: AP + WiFi Station without ethernet cable

Wed Jun 20, 2018 11:09 am

Check this article, pg2 gives full config.

viewtopic.php?f=36&t=138730&start=25

SurferTim
Posts: 1706
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: AP + WiFi Station without ethernet cable

Wed Jun 20, 2018 11:18 am

I got it to work, but it was not what I expected as fas as speed and reliability. I now use a usb wifi device in addition to the onboard unit.

wanstreet
Posts: 38
Joined: Fri Jun 01, 2018 5:28 am

Re: AP + WiFi Station without ethernet cable

Thu Jun 21, 2018 6:04 am

epoch1970 wrote:
Wed Jun 20, 2018 9:28 am
You can try your luck searching to "virtual AP" threads, it is marginally possible to have an AP + STA setup with the built-in interface on a Pi 3.

dhcpcd is a client deamon. Dnsmasq is often a good choice as a server.
Well ya, those 2 are a start, once i understood that running 2 dhcp program creates some problem.
But yesterday I think I came close to create a wifi sta and access point both, but the thing is rpi3 can access the internet while running the AP at the side.
but the devices who are connecting to the AP cannot access the internet.
Like if i connect my mobile with the wifi, then I am getting ip address assigned from the dnsmasq, but after that I cannot access the internet with my mobile phone.
Maybe something to do with NAT settings.
Really need to create a larger post if someone here is willing to help me out with what I did, basically I followed another guys instruction from github - github.com/peebles/rpi3-wifi-station-ap

wanstreet
Posts: 38
Joined: Fri Jun 01, 2018 5:28 am

Re: AP + WiFi Station without ethernet cable

Thu Jun 21, 2018 6:07 am

SurferTim wrote:
Wed Jun 20, 2018 11:18 am
I got it to work, but it was not what I expected as fas as speed and reliability. I now use a usb wifi device in addition to the onboard unit.
wifi usb, like a separate wifi adapter or usb dongle?

wanstreet
Posts: 38
Joined: Fri Jun 01, 2018 5:28 am

Re: AP + WiFi Station without ethernet cable

Thu Jun 21, 2018 8:04 am

most of the references includes making changes in the network/interfaces file.
If I make any changes then dhcpcd stops working.
Do we have any other way to get it back up?
The only way I am getting the dhcpcd back up is by removing the added lines in the network/interfaces file

wanstreet
Posts: 38
Joined: Fri Jun 01, 2018 5:28 am

Re: AP + WiFi Station without ethernet cable

Thu Jun 21, 2018 9:11 am

shanem2 wrote:
Wed Jun 20, 2018 10:53 am
@wanstreet - I'm trying to achieve the same. Basically looking at WiFi for my NAS but I have a second RPi which will be a different location and primary will Sync.

I'm struggling with the first part, but doing mine all headless as I don't have suitable monitors and keyboard/mouse.

I can see my WiFi AP come up, but it's not issuing IPs. I had a static on one host and got a single ping working but then fails. I'm thinking it's an iptables issue.

I'll work on the client side once this works.

I'm going to also install Plex so my kids can watch movies from tablets on the go. The NAS is so we can backup files from other devices.

If you have any links or config files, please share. I'll let you know what I have re AP Client shortly.
I have shared one link, its basically from a github guy, you can follow it, and see if its working.
It has one part where you need to make some changes in the /etc/network/interfaces file, which did not bode well for me.
You can try it and see if you can get it to work,
The concept is to use the dhcpcd to work with the internal/onboard wifi interface, which is wlan0 by default.
and use another dhcp server i.e dnsmasq or isc-dhcp( any1 u are familiar with) to work with another wifi interface, you can either add a virtual interface or use another wifi adapter( I am trying with a virtual interface, you can try it with an separate wifi-adapter, your wish)
The trick is not to allow the dhcp's to talk to each other, sometimes you will see that the dhcp server(not the dhcpcd) giving ip address to the internal wifi(wlan0) which leads to the problem of "lost connection to dhcpcd", (atleast thats what I think, and i am no ras-pi expert).
So we need to keep those to love-birds separate(cruel world) .
i wrote no-dhcp-inteface=lo,upa0(the virtual interface) in /etc/dhcpcd.conf file and no-dhcp-inteface=lo,wlan0 in dnsmasq.conf file
once that was done all I did was restart the dhcpcd service, followed by hostapd service, followd by dnsmasq service.
It was working.
My devices were able to get IP address from the dnsmasq but they were not able to access the internet.
And my raspi device was able to host the AP as well as connect to the outer internet.
Its not perfect but if u wana run some sort of data transmission related work, you can run a python script who will fwd the data to any outside server.

Return to “Networking and servers”

Who is online

Users browsing this forum: KlSchlitzohr and 13 guests