• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Direct control of ESP-32 over WAN? (With forum question corrected)

Q&A Forum › Category: ESP32 › Direct control of ESP-32 over WAN? (With forum question corrected)
0 Vote Up Vote Down
Stephen Hershberger asked 5 years ago

Greetings,
Thank you for answering my previous question about phones and BLE. I purchased your course “Learn ESP-32 w/Arduino IDE” and see in module 4 that in using the ESP-32 as a web server you must connect over the LAN. Later in module 4, unit 7 talks of accessing it from anywhere, but states you need to keep a computer turned on. If I have a static WAN IP would it be possible to connect to and control the ESP-32 from WAN directly? Without a DNS service, and having to have a computer turned on?. If so, could you please direct me to where I would be able to learn how to do this?

4 Answers
0 Vote Up Vote Down
Steph answered 5 years ago

Hello Stephen,

Yes! You can totally expose the web server running on your ESP32 outside your home network. And you don’t need to leave a computer on. Your local network router will take care of routing the packets coming from outside (addressed on your static WAN IP address) to your ESP32.

I suggest you read the following article to better understand how things work:

How to Forward Ports on Your Router
 
Simply redirect requests that arrive on port 80 of your router to port 80 of the IP address of your ESP32.

To make things a little more secure, you can choose not to expose port 80 of your router, but choose another one so that the curious can’t easily access your ESP32. For example, you could choose to expose port 1234 on your router, and redirect traffic addressed to this port to port 80 of your ESP32.

However, this precaution would require you to access the ESP from the outside with the following URL:

http://[the_static_WAN_IP_of_your_router]:1234/
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Stephen.
As Stéphane mentioned, you can use port forwarding.
We don’tn have any tutorial about that subject, but the link suggested by Stéphane is a good resource.
Regards,
Sara

0 Vote Up Vote Down
Stephen Hershberger answered 5 years ago

Thank you Sara, and Stephane,
I really appreciate you taking the time to help me.  I am totally new to this stuff, and I am not even familiar with using forums yet.  I decided to just put this WAN project on hold, and start with something I thought would be simpler (Converting a MAX-13855 thermocouple module’s output to display Fahrenheit instead of Celsius), but I am even having problems with that (I can multiply it by 1.8, but can’t add 32 to it).  I don’t know how to code properly.  I will continue to try and figure this out, and go on from there.  Thank you again for your help. 
Steve
 

0 Vote Up Vote Down
Steph answered 5 years ago

Hello Steve
Maybe you’re getting the wrong result by using the wrong type?
Here’s a conversion function that should work:

float celsius2fahrenheit(float celsius) {
    return celsius * 1.8 + 32;
}

Multiplication by 9/5 = 1.8 requires using the float type here.
Regards
Steph

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.