• 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

ESP8266 NodeMCU Async Web Server, extra output-routine function required.

Q&A Forum › Category: ESP8266 › ESP8266 NodeMCU Async Web Server, extra output-routine function required.
0 Vote Up Vote Down
Alex asked 3 years ago

Dear All
Who can advise me to have an extra output routine function applied to : ESP8266 NodeMCU Async Web Server – Control Outputs with Arduino IDE (ESPAsyncWebServer library) I need  to expand one  buttonfunction by sending an IR- code by a preset GPIO- output- pin.
So my suggestion was to add extra functionallity in the space below , marked by “*********”

 // Send a GET request to <ESP_IP>/update?output=<inputMessage1>&state=<inputMessage2>
  server.on("/update", HTTP_GET, [] (AsyncWebServerRequest *request) {
    String inputMessage1;
    String inputMessage2;
    // GET input1 value on <ESP_IP>/update?output=<inputMessage1>&state=<inputMessage2>
    if (request->hasParam(PARAM_INPUT_1) && request->hasParam(PARAM_INPUT_2)) {
      inputMessage1 = request->getParam(PARAM_INPUT_1)->value();
      inputMessage2 = request->getParam(PARAM_INPUT_2)->value();
      digitalWrite(inputMessage1.toInt(), inputMessage2.toInt());

**************************************************************************** }
2 Answers
0 Vote Up Vote Down
Steve Mercer answered 3 years ago

If it were me I would search the web for an ESP8266 IR Remote library (Something like https://github.com/crankyoldgit/IRremoteESP8266). You would also need to search for the IRCodes for the device you want to control as well as the protocol it uses. Then use one of the library examples to place the code where you need it to be.
 
IR control is not as easy as it sounds. There are many different protocols created by many different manufacturers. Phillips is the largest (Or was the last time I checked a few years ago).

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
I answered your question here: https://rntlab.com/question/esp8266-nodemcu-async-web-server-extra-output-routine-function-required-2/
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.