• 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

change port number slider webserver esp8266

Q&A Forum › Category: ESP8266 › change port number slider webserver esp8266
0 Vote Up Vote Down
werner grothe asked 4 years ago

I change the port number in main.cpp to
AsyncWebServer(89)
after this change, I can call  the webpage of Slider webserverver esp8266  by typing  the follow  ip adress
http://xxx.xxx.xxx.xx:89 but then I change the slider the brightness of the led do not change
in the serial monitor i see no connection to the client
is it possible to change the port number in slider webserver ?
Thank you for your help
best regards
Werner

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Werner.
I think you should also change the WebSocket port on the JavaScript file.

var gateway = `ws://${window.location.hostname:89}/ws`;

I haven’t tried it. But I think the solution should be something like that.
I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
werner grothe answered 4 years ago

Hallo Sara
No, it doesn’t work
I get a Syntax-Error In  VS Code
but I also think the Error must be in the Java File
 
Thank you
Werner

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

Hi.

I’m sorry, my mistake.

This is the correct syntax.

var gateway = `ws://${window.location.hostname}:89/ws`;

I’ve tried it and it worked.

Regards,
Sara

0 Vote Up Vote Down
werner grothe answered 4 years ago

Hallo
I test it with the new syntax and everything works fine
 
Thank you
Werner

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

Great!
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
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

  • [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.