• 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

Accessing the ESP32 Web Server from Anywhere

Q&A Forum › Category: ESP32 › Accessing the ESP32 Web Server from Anywhere
0 Vote Up Vote Down
Tim Lewis asked 3 years ago

I get to the last step and this is the error message I get. I am new to this but would like to this working. Help Please
 
Failed to complete tunnel connection

The connection to http://db47-209-58-130-50.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:8888.
Make sure that a web service is running on localhost:8888 and that it is a valid address.
The error encountered was: dial tcp [::1]:8888: connectex: No connection could be made because the target machine actively refused it.

11 Answers
0 Vote Up Vote Down
Steve Mercer answered 3 years ago

I’m guessing you’re referring to this tutorial which is not part of the Random Nerd tutorials.

I’ll try my best to help. I’m guessing when you got to the line “ngrok tcp IP_ADDRESS:8888 –authtoken TUNNEL_AUTHTOKEN” you used “localhost” for “IP_ADDRESS”. This will not work. NGROK is trying to tunnel through your router to a local machine on your network but it can’t translate “localhost” as that would mean your router itself. Use the actual IP address and it should work.

0 Vote Up Vote Down
Tim Lewis answered 3 years ago

No, the  tutorial form is here https://rntlab.com/module-4/accessing-the-esp32-web-server-from-anywhere/
Look I am fairly new to this and use what actual IP address?
 

0 Vote Up Vote Down
Steve Mercer answered 3 years ago

I’m afraid I don’t have access to that. Is the one I linked to close to being the same?
 
At any rate you need the IP Address of the device you are trying to connect to via ngrok.
 
Ie. It’s trying to connect to whatever the device is that has a service that responds to requests on port 8888. Is it the ESP32? Is it your local PC? Is it something else? Supply that IP Address.

0 Vote Up Vote Down
Tim Lewis answered 3 years ago

Yes, I looked at it and it is the same. I still don’t get it.

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Tim.
 
When you type your ESP IP address on your browser followed by :8888, do you get access to the web server?
Did you insert your ESP32 IP address and tunnel auth token on the following command?

ngrok tcp YOUR_ESP_IP_ADDRESS:8888 --authtoken YOUR_TUNNEL_AUTHTOKEN

For example, if my ESP32 IP address is 192.168.1.70, and the authoken is 3V1MfHcNMD9rhBizf8TRs_2whamY91tqX4, I would run the command as follows:

ngrok tcp 192.168.1.70:8888 --authtoken 3V1MfHcNMD9rhBizf8TRs_2whamY91tqX4

 
 
Note: Steve, thanks for trying to help. Please, avoid sharing that website here in our forum. Almost every tutorial related to the ESP32 that they publish is stolen from our website. They copy the code, structure, change a few words on the sentences, and change the color of the images or examples (to make it look different, but you can clearly see that it is copied from our tutorials), and don’t provide any credit. If you check their latest tutorials, they are almost all copied from our website. Thanks.
 
Regards,
Sara

0 Vote Up Vote Down
Steve Mercer answered 3 years ago

Sara
 
Sorry about that. Unfortunately there is no way for me to know that. It appears they have copied a tutorial from one of your books that I don’t have access to. All I can do is search the internet and their copy is one of the first that comes up.

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Steve.
Don’t worry. I know that.
And thanks for trying to help. 
Regards,
Sara

0 Vote Up Vote Down
Tim Lewis answered 3 years ago

Sara,
No to the first question and yes to the second question. I went through the tutorial step by step as said earlier when got to the last step I got the error shown above. I went back to one of my earlier programs and it still worked. The difference is this line ( WiFiServer server(80); ) was changed to this  (  WiFiServer server(8888);  ) in the code in your tutorial.
 
Tim

0 Vote Up Vote Down
Tim Lewis answered 3 years ago

Sara,
I just entered this in my browser 192.168.0.28:8888 and it is asking for the user name and password but I don’t know what to type in?
 
Tim

0 Vote Up Vote Down
Tim Lewis answered 3 years ago

I have gone through the tutorial again when I am ngrok and here what it is saying.
 
ngrok by @inconshreveable (Ctrl+C to quit) Session Status online Account Tim Lewis (Plan: Free) Version 2.3.40 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding tcp://2.tcp.ngrok.io:14697 -> 192.168.0.28:8888 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Tim.
 
If got to this step, it usually means everything is working as expected.
You need to go to that ngrok URL: tcp://2.tcp.ngrok.io:14697 to access the web server.
 
The username is user and the password is pass (the same we’ve set on a previous project in the course).
 
I’m sorry that these instructions are confusing. Maybe I need to update them.
 
Regards,
Sara

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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 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.