-->
Page 2 of 4

Re: Accessing WiFi Access Point from a preloaded HTML/Javasc

PostPosted: Sun Feb 23, 2020 5:56 am
by MikeDB
ok thanks. All on the PC is what I want. I'll give it a try. Thanks again

Re: Accessing WiFi Access Point from a preloaded HTML/Javasc

PostPosted: Sun Feb 23, 2020 3:35 pm
by kenn
No you can't access a new AP from the HTML or its JS code. That would be a massive security hole. So you should expect to do that manually before accessing the ESPs web server from a browser.

If your tablet is android or IOS, it would be possible to write an app to do that.

btw the most efficient way to operate is to have the ESP simply output data as a json, and web page (or an application) is on the tablet.

Re: Accessing WiFi Access Point from a preloaded HTML/Javasc

PostPosted: Mon Feb 24, 2020 5:23 am
by quackmore
Code: Select allNo you can't access a new AP from the HTML or its JS code. ...


and from the original question:

Code: Select all... switch the tablet WiFi over to the ESP WiFi, open the downloaded webpage and have it initiate communication with the ESP8266 on the usual 192.168.4.1. ...


@kenn ... guess you should read the question before answering ...

and yes, you can copy your HTML and JS files to an Android device
open them with Chrome (file:///sdcard/... or wherever they are...)
and have them redirecting queries to an external device...
it's called CORS, "Cross-origin resource sharing", not "massive security hole"
you will have to properly take are of it in your code

just saying...

Re: Accessing WiFi Access Point from a preloaded HTML/Javasc

PostPosted: Tue Feb 25, 2020 4:06 pm
by MikeDB
So in your ESPthermostat, am I correct in thinking that the ESP8266 code doesn't actually know it's using CORS ?
Or is there something inside your ESPBOT code as well which I can't locate ?