logo elektroda
logo elektroda
X
logo elektroda

Light control via ESP8266 relay with SUPLA - how to program?

maciacho 8319 26
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17820964
    maciacho
    Level 11  
    Hello,
    I have such a relay with wifi and I don't know how to program it under SUPLA to switch the light on/off.
    All the ESP programming and control e.g. via domoticz is by wemos and a separate switch on GPIO.
    Here the GPIO does not work, and a request for where to get the software for this ESP to control the relay from?
    Thanks but I can't find the right software anywhere.
  • ADVERTISEMENT
  • #2 17820996
    mipix
    Level 38  
    Check it out: Link "InCan Easy" is quite versatile software with configurable features. Author: Espablo .
  • #3 17821085
    maciacho
    Level 11  
    Thanks,
    I understand that I have to upload to esp this software multiboard_1024_dout_eagle.flash.bin ?
    Then connect via wifi and select the model? And which model to choose in this case ? InCan ?
  • #4 17821090
    mipix
    Level 38  
    No. You have "InCan Easy" uploaded. "Multiboard" is for off-the-shelf commercial modules and has peripherals rigidly assigned to GPIOs. In "InCan Easy" you set up yourself where you have what connected.
  • #5 17821096
    maciacho
    Level 11  
    OK, and after uploading it should connect to the registered Supla?
  • #6 17821100
    mipix
    Level 38  
    Yes, once configured.
  • #7 17821104
    maciacho
    Level 11  
    And does the relay work on the GPIO?
  • ADVERTISEMENT
  • #9 17821211
    maciacho
    Level 11  
    And what GPIOs does this relay work on? Because in Domoticz it wouldn't work for me when I set GPIO2 and GPIO5.
  • ADVERTISEMENT
  • #11 17821234
    kaczakat
    Level 34  
    The ESP01 theoretically has two GPIO 0 and 2 so I don't know where 5 comes from, in addition it has TX and RX , which are the IO 1 and IO 3 pins.
    Helpful post? Buy me a coffee.
  • #12 17821296
    maciacho
    Level 11  
    I'm sorry, I was mistaken and meant GPIO2 and GPIO0. After configuring the relay nothing happens.
    Maybe the relay itself is faulty?
    After activating the rules I entered the code:
    on Button#Switch to
    if [Relay#Switch]=0
    gpio,0,1
    else
    gpio,2,0
    endif
    endon
  • #13 17821547
    kaczakat
    Level 34  
    Ok, all in all I found such a module in the cupboard with everything, after all it would be enough to short GPIO 0 or 2 to GND without the ESP8266 module and everything would be clear. But on my board these pins are not connected to anything. Instead, there is a stc15f104 chip, which is a separate MC and connected to the ESP via UART, the ESP sends it the appropriate message, and it turns on the relay. Now all you have to do is find what message it is and there you go. Here is a Soviet technical solution to the problem: https://www.youtube.com/watch?v=f8kW5INQMPU :D . There are also more civilised solutions https://www.hackster.io/makerrelay/esp8266-wi...nnel-relay-delay-module-iot-smart-home-e8a437, the commands are something like "A00101A2 open relay, A00100A1 closed relay, command format must be hex".
    Helpful post? Buy me a coffee.
  • #14 17821599
    maciacho
    Level 11  
    Well, that's exactly what I meant, because this relay is connected to the esp a little differently to the usual one.
  • ADVERTISEMENT
  • #15 17821826
    kaczakat
    Level 34  
    It is communicated differently, but it works quite simply, just send these hexes to a serial set to 9600. If you have another ESP you can check if the relay clicks with this code, "it works for me":
    Code: C / C++
    Log in, to see the code
    .
    Unless you don't need the original software anyway, and I don't know where to get it from. But all in all it's trivial, it receives a command from the server and simply writes that code on the serial to turn the relay on or off. If you have something working from the supla then just replace the digitalWrite() type commands in the code with Serial.write() from the example above and it will be the same.
    Helpful post? Buy me a coffee.
  • #16 17823155
    maciacho
    Level 11  
    Thanks very much, I'll check it out today.
  • #18 17843243
    maciacho
    Level 11  
    Well I uploaded inCan Easy and I can hear the relay constantly switching like it's going crazy. I don't know about MQTT but I have a question if somehow in supli it is possible to configure this with inCan Easy?
  • #20 18333949
    madiz08
    Level 14  
    I would like to refresh the topic slightly and refer to the example provided by khoam .
    Could you please explain to me what is the following data that needs to be filled in:
    Code: C / C++
    Log in, to see the code
    .
    I recently bought two modules from Zamel, I am logged in on Supla.org, or rather I have my account there. Is mqttUser my login and mqttPassword the password from supla?
    I've tried typing that in. My ESP8266 connects to my home wifi but does not connect to the server

    Light control via ESP8266 relay with SUPLA - how to program? .
    I don't know how to check the server ip, port number and I also don't know what mqttQos is

    Added after 2 [minutes]:


    Light control via ESP8266 relay with SUPLA - how to program? .
    is that what needs to be put in there?

    Added after 1 [hour] 55 [minutes]: .

    Okay, I get it. the configuration can be done completely outside of the arduino. I downloaded the files from the beginning of the topic and uploaded this to my Node MCU 1.0 ESP-12. After typing 192.168.4.1 I entered all the data but you can see that the LED doesn't light up permanently when the esp8266 is switched on again, just flashes every so often, so I guess it's not making the connection. . Are there any current supli files that I should play through nodecu firmware programmer?
  • #21 18335541
    madiz08
    Level 14  
    If he wants to play it on the board:
    Light control via ESP8266 relay with SUPLA - how to program? .
    via:
    Light control via ESP8266 relay with SUPLA - how to program? .
    Then could I ask you for the corresponding BIN files to podegrate to my ESP8266? When I tried the ones from the supli website, nothing happens, when I tried the ones from the beginning of this topic, it detects my wifi network, on 192.168.4.1 I can enter settings and save. After restarting the ESP no longer connects to my wifi. As with zamela products, the light does not come on all the time, it just goes off every 2 seconds or so, which I guess is when it starts looking for a connection again.
  • #22 18335778
    khoam
    Level 42  
    Did you clear the flash before uploading the new firmware?
    Also, it would be good for you to connect to the ESP with some sort of terminal and see what messages occur during boot.

    Which firmware are you using from https://www.supla.org/pl/download ?
  • #23 18335807
    madiz08
    Level 14  
    Yes, I clean the flash by uploading blank_1MB.bin .
    As for the supli files, I downloaded these:
    Light control via ESP8266 relay with SUPLA - how to program? .
    But after loading them and turning them back on, nothing happens. No wifi network appears
  • #24 18335816
    khoam
    Level 42  
    madiz08 wrote:
    But after loading them and switching them back on, nothing happens. No wifi network appears
    .
    So plug in a serial terminal e.g. putty and show what ESP spits out when booting.
  • #25 18335817
    madiz08
    Level 14  
    Light control via ESP8266 relay with SUPLA - how to program? wrgrwam wifisocket_eagle.flash for address 0x000 and wifisocket_eagle.irom0text for ardes 0x4000
    Light control via ESP8266 relay with SUPLA - how to program? .
    on the above settings
    Ok, I'll download it right away

    Added after 12 [minutes]:

    Light control via ESP8266 relay with SUPLA - how to program? .
    Unfortunately I get the same bushes, regardless of the selected speed. I've never used this putty, but I think I only set the serial, COM5, and speed there, I've tried, 115200, 9600, 57600 and still the same thing
    On the Serial monitor of the Arduino the same thing. When I played the Arduino code, both on Serial monitor and on putty I got the same, I mean already correct messages

    Added after 21 [minutes]:

    Light control via ESP8266 relay with SUPLA - how to program? .
    I have now checked on speed 74880 and have the above.

    Aj, sorry the open wifi network came on after a while and it just didn't cause the LED on the ESP to glow, and could you tell me if it's ok based on that?
    Light control via ESP8266 relay with SUPLA - how to program? .
    because neither in the app nor on the website do I see the new device
    In the open wifi configuration there was something like this:

    Light control via ESP8266 relay with SUPLA - how to program? .
  • #26 18336003
    khoam
    Level 42  
    It connects and immediately disconnects to the supla server (svr27.supla.org) - I don't have an account there (yet), so I can't check it at the moment.

Topic summary

The discussion revolves around programming an ESP8266 relay module to control lighting using the SUPLA platform. The user seeks guidance on uploading the correct firmware, specifically "InCan Easy," to enable Wi-Fi control of the relay. Participants clarify that the "Multiboard" firmware is unsuitable for this application, as it is designed for commercial modules with fixed GPIO assignments. Instead, "InCan Easy" allows for custom GPIO configurations. The conversation includes troubleshooting GPIO connections, relay activation codes, and the need for serial communication to send commands to the relay. Users share code snippets for testing relay functionality and discuss MQTT configurations for server connectivity. Issues with firmware uploads and server connections are also addressed, emphasizing the importance of using the correct BIN files and clearing the flash memory before new uploads.
Summary generated by the language model.
ADVERTISEMENT