logo elektroda
logo elektroda
X
logo elektroda

How do I integrate WebServer with Remote Control IR for ON/OFF channel control?

maystero 546 10
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18256693
    maystero
    Level 24  
    Hello,
    I need help with a project. I have googled myself a Web Server. I have extended it with two additional channels of type: ON/OFF.

    Additionally, I connected an IR receiver to the circuit in order to be able to control the same ON/OFF channels with an IR remote control.
    For example: if I have the remote control handy at the moment, I press button "1" and switch the first channel on or off. And if necessary, using a smartphone or a computer via a browser, I do the same analogously.
    Circuit diagram:
    How do I integrate WebServer with Remote Control IR for ON/OFF channel control? .


    Porgram code:
    Code: C / C++
    Log in, to see the code
    .

    I don't know how to make use of the two IF conditions.
    I would like the ON/OFF status to refresh automatically on the web page if I use the RC remote instead of the browser.
  • ADVERTISEMENT
  • #2 18256719
    khoam
    Level 42  
    maystero wrote:
    I would like the ON/OFF status to refresh automatically on the web page if I use the RC remote control instead of the browser.

    The easiest way to do this is to "simulate" (in code) the channel selection by the smartphone in the event of this channel being selected by the RC remote.:)
  • ADVERTISEMENT
  • #3 18256760
    maystero
    Level 24  
    Thanks for the reply, but I must have messed something up....

    So, has IR remote I press a button -> remote sends a command->receiver receives a signal->this in turn goes to ESP.
    Here I have the functions:
    Code: C / C++
    Log in, to see the code
    .

    and wants to combine this:

    Code: C / C++
    Log in, to see the code
    .

    it does not work for me :(
  • #4 18256930
    oskar777

    Level 26  
    I deleted that post because I didn't notice that output5State has some default value though. So my previous comment was pointless.

    I would start by giving Serial.println(results.value) for testing; then Serial.println(output5State) some more;
  • #5 18258821
    maystero
    Level 24  
    oskar777 wrote:
    I deleted that post because I didn't notice that output5State has some default value though. So my previous comment was pointless.

    I would start by giving Serial.println(results.value) for testing; then still Serial.println(output5State);
    .

    Dear colleague - I don't quite understand what you mean....

    Code: C / C++
    Log in, to see the code


    I did this thing and there are no results on the RS port monitor:

    I am very much asking for help to complete the idea.
  • ADVERTISEMENT
  • #6 18260518
    khoam
    Level 42  
    Please write what values you get in the serial port monitor when you press the selected channels with the IR remote. I'm referring to the code snippet below (I'm referring to the first post) and the 'results.value' value:
    Code: C / C++
    Log in, to see the code
    .
  • #7 18260804
    maystero
    Level 24  
    Value 801
    How do I integrate WebServer with Remote Control IR for ON/OFF channel control? .
  • ADVERTISEMENT
  • #8 18260833
    oskar777

    Level 26  
    I can already see old age is no joy
    is
    Code: C / C++
    Log in, to see the code

    should be
    Code: C#
    Log in, to see the code
  • #9 18262337
    maystero
    Level 24  
    oskar777 wrote:
    I can already see old age is no joy
    is
    Code: C / C++
    Log in, to see the code
    .
    should be
    Code: C#
    Log in, to see the code
    .

    I don't know exactly if this is what my colleague meant....

    Code: C / C++
    Log in, to see the code


    This is the kind of thing I've painted.
    I checked it, it doesn't work.
    The port monitor outputs something like this:
    Code: C / C++
    Log in, to see the code
    .

    I hope I have stated my purpose correctly.
    I mean to write the function somehow like this
    Code: C / C++
    Log in, to see the code
    .
    so that the state of GPIO 5 can be changed via the browser and in parallel with the RC remote control.
    E.g. through the browser I change the state of GPIO 5 from "0" to "1" and with the RC remote control I change the state of GPIO 5 from "1" to "0".
  • #10 18262675
    khoam
    Level 42  
    maystero wrote:
    E.g. via browser I change the state of GPIO 5 from "0" to "1" and with RC remote control I change the state of GPIO 5 from "1" to "0".
    .
    The state of the pins defined as OUTPUT and controlled by digitalWrite(), can also read with the digitalRead() function.
    Hint: digitalWrite(pin, !digitalRead(pin))
  • #11 18264280
    maystero
    Level 24  
    khoam wrote:
    maystero wrote:
    E.g. via the browser I changed the state of GPIO 5 from "0" to "1" and with the RC remote control I change the state of GPIO 5 from "1" to "0".
    .
    The state of the pins defined as OUTPUT and controlled by digitalWrite(), can also read with the digitalRead() function.
    Hint: digitalWrite(pin, !digitalRead(pin))


    I'm sorry, but I don't understand.
    Can you give me a clear example?

Topic summary

The discussion revolves around integrating a Web Server with an IR remote control for ON/OFF channel management. The user has set up a circuit with an IR receiver and an ESP8266 microcontroller, aiming to control GPIO pins via both an IR remote and a web interface. Issues arise with the code logic, particularly in handling the IR signal and HTTP requests. Participants suggest debugging techniques, such as printing values to the serial monitor and correcting conditional statements. The user struggles with the implementation of the logic to ensure that both control methods function correctly, particularly in synchronizing the IR input with the web commands.
Summary generated by the language model.
ADVERTISEMENT