Here is a youTube link that you might be interested in.
He controls leds from a browser. Right up your alley. He explains both sides.
You can get the code from his github. There is a link to his github from the vid.
Here is a youTube link that you might be interested in.
He controls leds from a browser. Right up your alley. He explains both sides.
You can get the code from his github. There is a link to his github from the vid.
It is necessary to underline that in this example the author uses a WebSocket connection which is another web technology.
If @TechGraphix want to go deeper he should definitely learn this too, but I think for now it is better to tackle one piece at a time.
With the latest versions from the official repositories I can compile without errors even with the latest ESP32 core version 3.x.x.
Good to know
Got it working. i like the idea of the comma-separated string through a parser.
Only thing left now is how to convert a String to char * without errors:
this works:
configTzTime("CET-1CEST,M3.5.0/03,M10.5.0/03","de.pool.ntp.org");
but if String ntp = "de.pool.ntp.org"; (like it comes from the parser) i can't get it in that configTzTime("....", char * server).....
char * should be a pointer to the first character of a nul-terminated string. so my first guess was that something like char *ntp should do the trick... NOT (ofcourse)
BTW, i see a lot of this conversion items but no answers, or i don't understand it...
String has a method called c_str() which returns the underlying c-string for this exact use.
String ntp = "de.pool.ntp.org";
configTzTime("CET-1CEST,M3.5.0/03,M10.5.0/03", ntp.c_str());
Thanks, that was what i was looking for...
But why would you make that a String…. ?
const char * ntpServer = "de.pool.ntp.org";
Is good enough and does not use RAM and flash (just flash) for the text. And you then do
configTzTime("CET-1CEST,M3.5.0/03,M10.5.0/03", ntpServer);
I didn't. the OP did. I was responding to their question.
I believe it is an outcome of some sort of parsing....
Yes sorry the question was for the OP.
Sorry, i missed that one... The reason i want this is that i can fill in a ntp-server name in the form (html.h) so instead of the default "de.pool.ntp.org" i can use another.
A const can't be changed.
Ok - could be a char array then but if Strings suit you better that’s fine too.