Hi! I’m creating a product and following the SoftAP HTTP Pages to get users set up on WiFi. When I use the “Complete Example”, things work great and I can claim a device, and set it’s WiFi credentials from the device-hosted SoftAP server.
In production, however, I will want to re-skin the page so that it has the same style as our web app. I also want to add additional logic so that the page javascript can interpret query strings for a claim_code and redirect_url (to send redirect a user back to our web app from http://192.168.0.1/.
@mebrunet has produced an awesome repo, softap-setup-page, that allows you to adjust html, js, and css to reskin that page. I’ve had good luck using it as a local python server, but when I try to stringify the assets to include in my cpp firmware, I get a whole lot of compiler errors. I get errors even if I use the repo as-is, without modifying the html, js, and css assets.
Has anyone had luck using this repo? Is there something I’m missing? Debugging long compressed strings is pretty maddening, so any help would be great!
The ideas in @mebrunet 's code were built-in to system firmware for Soft-AP so I don’t think you need that old code (and it caused some problems with a name collision in another thread).
When you stringify the HTML, JS and CSS, you are running a program to handle the internal single and double quotation marks, right? You can’t just throw that stuff between double quotes and expect it to be converted to legal C syntax.
Hi @bko. Thanks again for the response. You are really all over this forum!
Wouldn't I need to override the built-in system firmware if I'm reskinning and adding new logic to the Soft-AP page? Is there an established, newer way of doing that?
Below is the script that is stringifying them. I had noticed it before, but it does explicitly say not to use double quotes on line 4. I just tried removing all the double quotes in script.js and the stringified code compiles. I'll test it now to see if it works!
@bko Not the answer I was hoping for, but a place to start! And thanks again!
Do you remember where the thread with the name collision is? I've been searching for it, but can't seem to find it. Would be great to see what caused the issue as the "old code" has some nice features that the code in the Particle docs does not.