logo elektroda
logo elektroda
X
logo elektroda

How to control the Sonoff MINI R3 with ESP8266 via WiFi with BL602?

Tuseras_09 723 13
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20903929
    Tuseras_09
    Level 12  
    Hey, I would like to use the simple input dependency logic of the ESP8266 to control two SONOFF MINI R3 modules via WIFI.
    I have already bought the hardware, because unfortunately it turned out that in the sonoffs sit BL602L20 and not ESP as I expected.
    I am completely green with both smarto home and arduino.

    I mean, for clarity, I have the ESP8266 in one location and it has to switch on the relay in the sonoffs depending on the signal given to the ESP input. And the MINI R3 is only supposed to receive a command over WiFi to switch the relay on or off. Can someone please explain this to me in a spatial way, what I need to do to make it work. I have already extracted the programming signals from the MINI R3, but I don't even know what to upload there since the BL602 is sitting there ;(
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • ADVERTISEMENT
  • Helpful post
    #2 20903970
    p.kaczmarek2
    Moderator Smart Home
    Here you have BL602 flashing tutorials:







    Are all devices on the same LAN?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20903987
    Tuseras_09
    Level 12  
    Thanks, I watched but didn't know what to upload there and if it would be suitable.

    Yes, all devices in one local network. Close enough that they could talk to each other, but to be sure I will use the APs that are in both rooms (mesh network).

    So on the BL602 I should upload as in the video? How do I further communicate the ESP8266 with the sonoffs with this uploaded software?
  • ADVERTISEMENT
  • #4 20904068
    p.kaczmarek2
    Moderator Smart Home
    And what on ESP do you have uploaded?
    Helpful post? Buy me a coffee.
  • #5 20904131
    Tuseras_09
    Level 12  
    Nothing yet, first I wanted to solve the control issues then I will divide with the logic (basically just the product of 3 input signals).
    For the moment hardware ready to flash, after downloading one BLDevCube.exe file, transferring to C:/ the message "Failed to execute script BLDevCube" pops up, so I guess I haven't downloaded something yet.
  • Helpful post
    #6 20904277
    p.kaczmarek2
    Moderator Smart Home
    I haven't seen this error yet. Where did you download from? Do you have administrator rights?
    Helpful post? Buy me a coffee.
  • #7 20905676
    Tuseras_09
    Level 12  
    My error was due to not downloading the entire directory. In the end I managed to upload the flash for one module, I managed to find that P5- button, P22- relay and diode. I didn't find the second diode, it doesn't matter - it looks like the issue with the relay and communication is solved.

    Now just the key question, how to control these converted sonoffs using the ESP8266?
    Simply speaking, I would like to connect 2 inputs to the ESP8266:
    if on the 1st input of the ESP there is a high state, then the ESP turns on sonoff number 1,
    if on the 2nd input of the ESP there is a high state, then the ESP turns on sonoff number 2.
    But, I will develop the logic of the inputs later ;) .
  • ADVERTISEMENT
  • Helpful post
    #8 20906127
    p.kaczmarek2
    Moderator Smart Home
    And what on ESP is

    You can send them commands over HTTP, the submission is Tasmota style. Just like Tasmota you can send a POWER ON or OFF or TOGGLE command via HTTP, the same here.
    Helpful post? Buy me a coffee.
  • #9 20906152
    Tuseras_09
    Level 12  
    At the moment I have the 8266 as I took it "out of the box". I don't have anything uploaded there. I will need 3 conditions to handle the outputs, but I wanted to start with device control first, I will develop the code later.
    Could you give me a hint on what is easiest to put on the 8266 and how to send such a command frame?
  • #10 20906538
    p.kaczmarek2
    Moderator Smart Home
    If you can, please provide the solution you used and then close the topic.

    I would think either PlatformIO with ArduinoOTA, or about sending HTTP cm/cmnd GET from Tasmota.
    Helpful post? Buy me a coffee.
  • Helpful post
    #11 20906843
    Tuseras_09
    Level 12  
    Code: C / C++
    Log in, to see the code


    Recommendations after http.
  • #12 20907235
    p.kaczmarek2
    Moderator Smart Home
    Ok, now the topic can be closed. I would add that analogously you can execute commands on a device with Tasmota. By the way, here is a list of OBK commands:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Helpful post? Buy me a coffee.
  • #13 20908120
    Tuseras_09
    Level 12  
    Finally, I have a question about control from the android platform. I am also concerned with the simplest possible way, I was thinking of a single widget for one device- on/off.

    Have you any ideas on how to implement this for devices with OpenBeken?
  • #14 20908203
    p.kaczmarek2
    Moderator Smart Home
    OpenBeken and Tasmota are compatible with Tasmota Control and similar applications, these applications work via HTTP:



    In your own project you can also get compatibility with this application relatively easily, you just need to respond in a certain way to GET requests, just like Tasmota does.
    My relay controller on the PIC18F67J60 is compatible with it, the code is available on the forum:
    https://www.elektroda.pl/rtvforum/topic3789324.html
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around controlling two Sonoff MINI R3 modules using an ESP8266 via WiFi, particularly after discovering that the Sonoff devices contain a BL602 chip instead of the expected ESP chip. The user seeks guidance on how to upload the necessary firmware to the BL602 and establish communication between the ESP8266 and the Sonoff modules. Various responses provide insights into flashing the BL602, using HTTP commands for control, and suggest programming approaches, including the use of Tasmota firmware. The user successfully uploads the firmware and outlines a plan to implement input conditions for controlling the relays on the Sonoff devices. Additionally, there is a query about controlling the devices from an Android platform, with suggestions for compatibility with existing applications.
Summary generated by the language model.
ADVERTISEMENT