BlueWave Studio forum
Internet not shared via AP/Hotspot? - Printable Version

+- BlueWave Studio forum (https://bluewavestudio.io/community)
+-- Forum: Community (https://bluewavestudio.io/community/forum-85.html)
+--- Forum: General (https://bluewavestudio.io/community/forum-57.html)
+--- Thread: Internet not shared via AP/Hotspot? (/thread-2460.html)



Internet not shared via AP/Hotspot? - benjamindlea - 02-28-2021

Hello, My setup is the following:

a. RPI 4B
b. Generic 3A PSU
c. UGreen Soundcard
d. with mic input
e. CSR 5.0, having some sound artifact issues though and 4.0 on the way (should be unrelated to THIS issue)
f. 7" Capacitive Touch

2. Android Auto:
a. Latest version according to Play Store (Released: 23 Feb 21)
b. Samsung S10 and Sony Xperia XZ1 Compact

3. Steps to reproduce issue

Huawei E5372 wireless modem connected to RPI, and internet connection verified using browser/youtube app in OAP
Enable hotspot Mode in OAP
Connect Phone to hotspot
Phone is connected to network, but no internet.

Is this correct behaviour? I would expect the Hotspot to provide internet if the RPI has internet connection?! Is there something else I have missed?

Many Thanks,
Ben


RE: Internet not shared via AP/Hotspot? - Great - 03-01-2021

(02-28-2021, 04:21 PM)benjamindlea Wrote: Hello, My setup is the following:

a. RPI 4B
b. Generic 3A PSU
c. UGreen Soundcard
d. with mic input
e. CSR 5.0, having some sound artifact issues though and 4.0 on the way (should be unrelated to THIS issue)
f. 7" Capacitive Touch

2. Android Auto:
a. Latest version according to Play Store (Released: 23 Feb 21)
b. Samsung S10 and Sony Xperia XZ1 Compact

3. Steps to reproduce issue

Huawei E5372 wireless modem connected to RPI, and internet connection verified using browser/youtube app in OAP
Enable hotspot Mode in OAP
Connect Phone to hotspot
Phone is connected to network, but no internet.

Is this correct behaviour? I would expect the Hotspot to provide internet if the RPI has internet connection?! Is there something else I have missed?

Many Thanks,
Ben

This is completely normal.

You have to create / edit some files in order to share the internet of the Huawei modem with the hotspot created by the OAP.

The first thing you have to do is create the routed-ap.conf file with this command:

sudo nano /etc/sysctl.d/routed-ap.conf



Then you will write this to the file you've just created to enable IPV4 routing.



net.ipv4.ip_forward=1 



Save it.


Next insert this command in terminal:

sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE


Where eth1 will be the network device created by your Huawei modem.


Now you need to save the iptable rules with this command:

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"



Finally, you have to load these rules each time you restart RPi. To do this, you will edit the rc.local file with the command:

sudo nano /etc/rc.local



you will scroll down and above where the exit 0 is you will put this:

iptables-restore < /etc/iptables.ipv4.nat


Save the file, reboot and you should have internet in your RPi by now.


RE: Internet not shared via AP/Hotspot? - am12 - 03-25-2021

(03-01-2021, 10:05 AM)Great Wrote:
(02-28-2021, 04:21 PM)benjamindlea Wrote: Hello, My setup is the following:

a. RPI 4B
b. Generic 3A PSU
c. UGreen Soundcard
d. with mic input
e. CSR 5.0, having some sound artifact issues though and 4.0 on the way (should be unrelated to THIS issue)
f. 7" Capacitive Touch

2. Android Auto:
a. Latest version according to Play Store (Released: 23 Feb 21)
b. Samsung S10 and Sony Xperia XZ1 Compact

3. Steps to reproduce issue

Huawei E5372 wireless modem connected to RPI, and internet connection verified using browser/youtube app in OAP
Enable hotspot Mode in OAP
Connect Phone to hotspot
Phone is connected to network, but no internet.

Is this correct behaviour? I would expect the Hotspot to provide internet if the RPI has internet connection?! Is there something else I have missed?

Many Thanks,
Ben

This is completely normal.

You have to create / edit some files in order to share the internet of the Huawei modem with the hotspot created by the OAP.

The first thing you have to do is create the routed-ap.conf file with this command:

sudo nano /etc/sysctl.d/routed-ap.conf



Then you will write this to the file you've just created to enable IPV4 routing.



net.ipv4.ip_forward=1 



Save it.


Next insert this command in terminal:

sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE


Where eth1 will be the network device created by your Huawei modem.


Now you need to save the iptable rules with this command:

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"



Finally, you have to load these rules each time you restart RPi. To do this, you will edit the rc.local file with the command:

sudo nano /etc/rc.local



you will scroll down and above where the exit 0 is you will put this:

iptables-restore < /etc/iptables.ipv4.nat


Save the file, reboot and you should have internet in your RPi by now.
I am unsure if I understand this thread correctly.  Once you have wireless AA working with OAP, will the steps above allow the RPi to utilize your phone in order to access the internet via chromium etc?


RE: Internet not shared via AP/Hotspot? - Daniel_BlueWave - 03-25-2021

Above steps allows you to add external WiFi modem to your RPi that will provide internet connection while internal Wifi works as hotspot without internet access.

If you would like to share your phone internet to Rpi you can turn on BT internet tethering.


RE: Internet not shared via AP/Hotspot? - mirrormurr - 07-04-2021

Will this interfere with the use of AA wireless, or is a usb connection then mandatory?


RE: Internet not shared via AP/Hotspot? - poedaniel - 07-05-2021

(07-04-2021, 12:57 PM)mirrormurr Wrote: Will this interfere with the use of AA wireless, or is a usb connection then mandatory?

if the phone is still connected to the pi via wifi it should still work wirelessly. wired connection never hurts though.


RE: Internet not shared via AP/Hotspot? - mirrormurr - 07-16-2021

I am confused..
I made the configuration as described, in previous post but this set-up only works with a usb connection to the Pi.
If I understood correctly, the Pi itself cannot be connected to the wireless Hotspot-modem and act as a Hotspot at the same time... I tried to turn on Hotspot on in OA, but that left the whole setup without internet connection. Could someone please describe how to proceed with the settings OA to make this work?


RE: Internet not shared via AP/Hotspot? - Daniel_BlueWave - 07-16-2021

You have to activate hot-spot on the RPI, in OAP. Then connect your phone with this hot-spot.
Internet connection is matter of your phone. Check in the phone manual how to use mobile internet while WiFi is connected to the hot-spot without internet access.
In case you would like to share your phone internet to Rpi you can turn on BT internet tethering.

Looks like now you have issue with your phone - it does not allow you to use mobile data while connected to Wifi. Ask phone manufacturer for help.


RE: Internet not shared via AP/Hotspot? - mirrormurr - 07-16-2021

Hello again,
I think I get what you are describing here, Wireless Android with the phone itself as internet provider. What I would like to do, as the first poster described, is to use an external mobile WiFi Access point as source for online data, and use it combined with Wireless AA. On my set-up, AA only worked when both phone and Pi connected individually to the access point and phone was using USB to Pi.


RE: Internet not shared via AP/Hotspot? - Great - 07-21-2021

(07-16-2021, 07:41 PM)mirrormurr Wrote: Hello again,
I think I get what you are describing here, Wireless Android with the phone itself as internet provider. What I would like to do, as the first poster described, is to use an external mobile WiFi Access point as source for online data, and use it combined with Wireless AA. On my set-up, AA only worked when both phone and Pi connected individually to the access point and phone was using USB to Pi.

What kind of external mobile WIFI are you plan to use?