Connecting to ESP32 based board WiFi different network
-
- Posts: 1
- Joined: Tue Jul 31, 2018 11:56 am
Connecting to ESP32 based board WiFi different network
Hi Everyone
I have a project where I control motor from a mobile phone or a computer using ESP32 DOIT DEVKIT.
I can connect to the board ONLY when my phone or computer and the ESP32 DOIT DEVKIT are on the same network.
When in different networks, there is no connection, and that does not become very useful.
Any help will be highly appreciated.
Thanks
I have a project where I control motor from a mobile phone or a computer using ESP32 DOIT DEVKIT.
I can connect to the board ONLY when my phone or computer and the ESP32 DOIT DEVKIT are on the same network.
When in different networks, there is no connection, and that does not become very useful.
Any help will be highly appreciated.
Thanks
-
- Posts: 9749
- Joined: Thu Nov 26, 2015 4:08 am
Re: Connecting to ESP32 based board WiFi different network
Yes, they can't connect because they are in different networks. if there's no communication path between these two networks, the ESP32 can't magically create one. If both networks do have Internet access, you could either use a server accessible by both networks to act as a proxy of some sorts, or set up the network the ESP32 is on to set up port forwarding to make some port on the ESP32 accessible from the outside.
Re: Connecting to ESP32 based board WiFi different network
Hello,ESP_Sprite wrote: ↑Wed Aug 01, 2018 8:39 amYes, they can't connect because they are in different networks. if there's no communication path between these two networks, the ESP32 can't magically create one. If both networks do have Internet access, you could either use a server accessible by both networks to act as a proxy of some sorts, or set up the network the ESP32 is on to set up port forwarding to make some port on the ESP32 accessible from the outside.
Is it possible to use OpenVPN or Tiny VPN service inside ESP32 to connect or access ESP32 based device from different network like Virtual LAN concept?
So that all devices have different physical IP Address but with same Virtual IP Addresses it can be access using VPN.
Let me know if possible with ESP32 as well
Regards,
Ritesh Prajapati
Ritesh Prajapati
-
- Posts: 9749
- Joined: Thu Nov 26, 2015 4:08 am
Re: Connecting to ESP32 based board WiFi different network
Technically, yes, this is possible. I don't think anyone has implemented yet, though.
Re: Connecting to ESP32 based board WiFi different network
Hello,ESP_Sprite wrote: ↑Wed Sep 23, 2020 11:27 amTechnically, yes, this is possible. I don't think anyone has implemented yet, though.
Thanks. I agreed but would you please share some details if you have any idea? Because for VPN, there should be support into LWIP Library and into network stack itself.
As far as i know that light weight LWIP Library and Stack is used into ESP32.
I went through few links which I found below
https://github.com/husarnet/husarnet-esp32
https://husarnet.com/
https://www.hackster.io/donowak/control ... net-fa9634
https://github.com/adamkrawczyk/esp32_rosserial_demo
https://github.com/martin-ger/MQTT_VPN
https://forum.arduino.cc/index.php?topic=567137.0
https://esp-forum.de/index.php/forum/ko ... it-openvpn
https://www.reddit.com/r/esp32/comments ... pn_server/
But I just want to know that it is feasible as per capabilities of ESP32 with memory and stack point of view? Because VPN or Virtual Network is generally ported into Linux or High variant MCUs.
I haven't heard or didn't see it to use for low memory devices like ESP32 and other tiny MCUs.
Let me know if you have any idea or any example for same
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Connecting to ESP32 based board WiFi different network
You may find it easier to use a Cloud service e.g. an MQTT server.
You could create topics using the ESP MAC or some other unique hash (the ESP mqtt client already defaults its client id to MAC NIC).
Then your PC/Phone would PUBLISH its commands to the MQTT server.
Your ESP would SUBSCRIBE to its unique hash/NIC topic root.
You would need to use a Cloud service but that does not have to cost.
You would be up and running very quickly & if you structure the communication API properly you could replace with your VPN latter.
You could create topics using the ESP MAC or some other unique hash (the ESP mqtt client already defaults its client id to MAC NIC).
Then your PC/Phone would PUBLISH its commands to the MQTT server.
Your ESP would SUBSCRIBE to its unique hash/NIC topic root.
You would need to use a Cloud service but that does not have to cost.
You would be up and running very quickly & if you structure the communication API properly you could replace with your VPN latter.
& I also believe that IDF CAN should be fixed.
Re: Connecting to ESP32 based board WiFi different network
Yes. MQTT already we are using into our application to send data over cloud which you have mentioned earlier.PeterR wrote: ↑Wed Sep 23, 2020 12:16 pmYou may find it easier to use a Cloud service e.g. an MQTT server.
You could create topics using the ESP MAC or some other unique hash (the ESP mqtt client already defaults its client id to MAC NIC).
Then your PC/Phone would PUBLISH its commands to the MQTT server.
Your ESP would SUBSCRIBE to its unique hash/NIC topic root.
You would need to use a Cloud service but that does not have to cost.
You would be up and running very quickly & if you structure the communication API properly you could replace with your VPN latter.
But I don't have any idea like how to use it with VPN.
So I need help for that as per our requirements.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Connecting to ESP32 based board WiFi different network
Why do you need VPN if you have MQTT & a cloud server?
The MQTT server acts as 'the man in the middle'. No one needs to know anyone elses address. You can all have private addresses!
All you need to know is the server's address & your product serial number (or MAC or whatever you use to uniquely topic name).
VPN is your suggestion and one of many potential solutions to the original use case (actually I think link management would be hard for you if you were creating a product with many installs). You then went on to find that a VPN sofware might be hard to find for the ESP. So move on! Use another solution (e.g. MQTT)!
Simples
PS There are the usually security concerns & as this is a motor it might be wise to consider them.
The MQTT server acts as 'the man in the middle'. No one needs to know anyone elses address. You can all have private addresses!
All you need to know is the server's address & your product serial number (or MAC or whatever you use to uniquely topic name).
VPN is your suggestion and one of many potential solutions to the original use case (actually I think link management would be hard for you if you were creating a product with many installs). You then went on to find that a VPN sofware might be hard to find for the ESP. So move on! Use another solution (e.g. MQTT)!
Simples
PS There are the usually security concerns & as this is a motor it might be wise to consider them.
& I also believe that IDF CAN should be fixed.
Re: Connecting to ESP32 based board WiFi different network
@Ritesh
Also quite confussed as to if your question:
You should raise a fresh topic if you have a VPN question as otherwise potentially a diversion from the OP.
Also quite confussed as to if your question:
is a new question or if this thread remains about the OP's question.Is it possible to use OpenVPN or Tiny VPN service inside ESP32 to connect or access ESP32 based device from different network like Virtual LAN concept?
You should raise a fresh topic if you have a VPN question as otherwise potentially a diversion from the OP.
& I also believe that IDF CAN should be fixed.
Re: Connecting to ESP32 based board WiFi different network
Thanks.PeterR wrote: ↑Wed Sep 23, 2020 7:40 pm@Ritesh
Also quite confussed as to if your question:is a new question or if this thread remains about the OP's question.Is it possible to use OpenVPN or Tiny VPN service inside ESP32 to connect or access ESP32 based device from different network like Virtual LAN concept?
You should raise a fresh topic if you have a VPN question as otherwise potentially a diversion from the OP.
I will raise seperate request for same.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: Bing [Bot] and 93 guests