• 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

Obtaining args from a URL

Q&A Forum › Category: ESP8266 › Obtaining args from a URL
0 Vote Up Vote Down
Nigel Cooper asked 11 months ago

I have developed an ESP8266 sketch based on a RNT sketch to control 3 LEDs using WiFiClient. I’ve now added a 2nd web page to collect config variables from an HTML form. I have the URL in a string (http://192.168.104.127/get?DST_ACTIVE=on&PIR_TIME=12&GGE_PIR=on&GGE_LDR=on&GGE_TIME=on&GGE_OFF=on&CLH_PIR=on&CLH_LDR=on&CLH_TIME=on&CLH_OFF=on&GDN_PIR=on&GDN_LDR=on&GDN_TIME=on&GDN_OFF=on&LIGHTS_ON_TIME=23&LIGHTS_OFF_TIME=34&LDR_THRESHOLD=45), but I’m stuck on how to obtain the params & their values as most examples require server.arg – not supported by WiFiClient?

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 11 months ago

Hi.
Can you tell me which tutorial you used as a starting point?
Regards,
Sara

0 Vote Up Vote Down
Nigel Cooper answered 11 months ago

Hi Sara,
I cannot find that tutorial now, it was an old one – displayed two oval buttons, grey for off and red for on and used /1/off, /1/on, /2/off, /2/on to switch switch the associated gpios. There was no web form in that tutorial… Anyhow, between the tutorials on the RNT site, the ebooks I’ve got from you guys, the ESP8266 Beginners Guide (GitHub), I’ve been able to move past that issue – eventually – and the config variables have been successfully written to a LittleFS file.
A completely different question if I may. I’d like to implement OTA updates, as the controller will be in a box mounted high up and not readily accessible. From your “Build Web Servers” ebook, it gives examples for OTA using AsyncWebServer. As I’m using WIFiClient, that is unlikely to work. The ebook does mention 3 methods and focuses on the Async as the simplest. Can OTA be accomplished using WifiClient? Or do I need to rewrite the entire sketch using Async?
Many thanks,
Nigel.

0 Vote Up Vote Down
Sara Santos Staff answered 11 months ago

Hi.
 
Yes.  I believe this method should be compatible: https://randomnerdtutorials.com/esp8266-ota-updates-with-arduino-ide-over-the-air/
 
This tutorial is quite old and I haven’t tested it recently, so I’m not sure. But I think it’s worth giving it a try.
 
Regards,
Sara

0 Vote Up Vote Down
Nigel Cooper answered 11 months ago

Fantastic! Thank you Sara. I’m using PlatformIO, so after a little tweaking with the ini file, it works a treat.
Kind regards,
Nigel.

0 Vote Up Vote Down
Sara Santos Staff answered 11 months ago

That’s 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.