Page 1 of 1

ESP32-Lolin-Lite compile fail

Posted: Thu Aug 31, 2023 8:23 am
by chipfryer27
Hi

Ages ago I created a chart for an ESP32 that when ran first checked to see if it "connected" and if not then created an AP allowing you to set connection parameters. The ESP chips remembered previous connection details so it was quite easy to check if connected or not.

Unfortunately I don't know where it is, so as Benj kindly shared a chart that does the same job all good, no need to recreate mine :)

ESP32_Config_Wifi.fcfx
(30.74 KiB) Downloaded 214 times

Before modifying the chart to my needs I thought I'd check it worked and tried compiling to chip. Around line 1160/1195 it failed.

ESP32_Config_Wifi.msg.txt
(189.83 KiB) Downloaded 198 times

I'm using IDEv4.2 which seems to work fine with other projects. Any ideas?

Regards

Re: ESP32-Lolin-Lite compile fail

Posted: Thu Aug 31, 2023 10:17 am
by Steve-Matrix
I see the issue. I modified this component recently to allow more flexibility when generating the html page. This was a "Use Callback" option, which required a user macro called "HtmlCallback" which returns a BOOL and has the following parameters:

Code: Select all

  * name - STRING[32] - the name of the web page
  * params - STRING[128] - a string of parameters sent to the webpage
  * idx - UINT - an increasing number
  * html - byref STRING[256] - the returned html to send
If looks like this callback macro is required even if "Use Callback" is set to "No".

The simple workaround is to include a blank "HtmlCallback" macro. I have attached a simple one here. Note that this will not be called unless the "Use Callback" is selected.

If you did you this callback, it serves a very simple html page but you can serve json data or anything else just as easily. If you have a lot of data to send, then you will need to build the data up over a number of iterations of the "idx" variable. The callback will get called multiple times until the return is set to true to allow you to add additional data to the html page.

Re: ESP32-Lolin-Lite compile fail

Posted: Thu Aug 31, 2023 11:02 am
by chipfryer27
Hi Steve

I added in the Macro to the chart and it appears to work a treat :)

Regards

Re: ESP32-Lolin-Lite compile fail

Posted: Thu Aug 31, 2023 11:33 am
by Steve-Matrix
Great, thanks for letting me know. I'll also try to fix that component so you don't need to add the callback macro if you are not using it.