My friend and I are doing a project and we're stuck on a problem. We tried looking stuff up but it looks like no one documented something similar before.
Basically, what we want to do is have one Arduino (we thought a MKR NB 1500) in a remote location without any available WiFi (or Ethernet) connection be able to host its own Wifi Network. We thought that giving it a SIM card would allow it to communicate to our webserver (API) and to our surprise, it does (yay)! However, we also want people near the Arduino to be able to access the internet. However, that's where we're stuck...
I know that hosting an access point on an Arduino with WiFi is possible. But is it possible for that access point to link the user to the real internet, itself provided by the SIM card?
P.S. : We are open to having two different Arduinos linked together (or more) in order to make this work. We just need to be able to transfer the SIM network to an access point (hotspot basically).
P.P.S : We are also open to using different technologies like ESP controllers... We're just not using a cellular hotspot because of the cost of these things and we want to make it with Arduino or different controllers.
1 Answer 1
Bridging of two networks at TCP/IP level is done in the TCP/IP stack. It translates addresses from one network interface to other network interface, but both interfaces are handled by the same TCP/IP stack.
An example on an MCU would be translating between esp8266 SoftAP and STA network interface. They are two network interfaces handled by the same TCP/IP stack. And now esp8266 Arduino can handle some Ethernet modules as additional network interfaces of that TCP/IP stack too.
With MKR NB 1500 or any other (mobile) network module attached to Arduino you can't do bridging because the TCP/IP stack is in the firmware of the module and the WiFi or Ethernet shield you would attach to the MKR would have its own TCP/IP stack in the firmware too.
If you are on esp8266, esp32 or other MCU where the TCP/IP stack runs in the MCU, you still can't make it work together with the TCP/IP stack in the external module. Those Ethernet modules esp8266 can use as netwok interaces with its TCP/IP stack are interfaced on the software layer closer to hardware, but the mobile network modules use AT commands without exposing access to lower layers.
What you can do is to proxy some network services as I write in this answer.
-
This is wrong Bridging of two networks at TCP/IP level is done with IP Network Address Translation (NAT) Protocol.. NAT is a routing solution not bridging.MatsK– MatsK10/07/2023 09:24:32Commented Oct 7, 2023 at 9:24
-
-
No, bridging is on layer 2 and routing on layer 3.MatsK– MatsK10/07/2023 18:04:16Commented Oct 7, 2023 at 18:04
-
1@MatsK, ok. I removed mentions of NAT10/08/2023 05:14:02Commented Oct 8, 2023 at 5:14
internet
?