Serial MCU controlled relay/switch

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: Serial MCU controlled relay/switch

#451 Post by Dondolo » 28 Sep 2021, 17:02

The build you flashed is for 4M flash, so not really strange to see it won't boot.

Currently there is no pre-build file for 1M using that plugin.
So we have to make a custom build for it.

What else do you need in that build?
yes that's right, are just 1MB.

It would be nice if the custom build the standard of
ESP_Easy_mega_20210802_normal_ESP8266_1M.bin
contains.

If that is enough from the amount of memory.
Dondolo

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: Serial MCU controlled relay/switch

#452 Post by Dondolo » 30 Sep 2021, 20:45

Currently there is no pre-build file for 1M using that plugin.
So we have to make a custom build for it.

What else do you need in that build?
Hi Td-ler,
do you find the time to create a customer version for the ESP01?

Greetings Dondolo

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#453 Post by TD-er » 30 Sep 2021, 21:55

Dondolo wrote: 30 Sep 2021, 20:45
Currently there is no pre-build file for 1M using that plugin.
So we have to make a custom build for it.

What else do you need in that build?
Hi Td-ler,
do you find the time to create a customer version for the ESP01?

Greetings Dondolo
Sorry had missed your post, or at least not placed it on my mental todo list.
Here you are:
https://www.dropbox.com/s/vtltocbc96p6f ... M.bin?dl=0

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: Serial MCU controlled relay/switch

#454 Post by Dondolo » 30 Sep 2021, 22:23

Sorry had missed your post, or at least not placed it on my mental todo list.
Here you are:
Hi
thank you very much.
I flashed it right away and it works wonderfully.
I will test tomorrow.
Thank you Dondolo

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: Serial MCU controlled relay/switch

#455 Post by Dondolo » 02 Oct 2021, 14:23

Sorry had missed your post, or at least not placed it on my mental todo list.
Here you are:
Unfortunately I cannot switch the relay.
I use the following relay

https://cdn.shopify.com/s/files/1/1509/ ... 1614874417

The Arduino code according to
on
byte open [] = {0xA0, 0x01, 0x00, 0xA1};
Serial.write (open, sizeof (open));

off
byte close [] = {0xA0, 0x01, 0x01, 0xA2};
Serial.write (close, sizeof (close));

Does it even work with the "Serial MCU controlled switch" plug-in?

User avatar
enesbcs
Normal user
Posts: 582
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: Serial MCU controlled relay/switch

#456 Post by enesbcs » 21 Oct 2021, 13:47

Dondolo wrote: 02 Oct 2021, 14:23 The Arduino code according to
on
byte open [] = {0xA0, 0x01, 0x00, 0xA1};
Serial.write (open, sizeof (open));

off
byte close [] = {0xA0, 0x01, 0x01, 0xA2};
Serial.write (close, sizeof (close));

Does it even work with the "Serial MCU controlled switch" plug-in?
Yes, this is the standard LCTECH command sequence, it is contained in this plugin. If you choose LCTECH, selected the correct baud rate, enable serial in ESPEasy settings, and disable serial logging, it should work. There were a bad batch which needs "Use IPD preamble" option. There were also a faulty batch which needs "command doubling" option to work.

Also there are several pieces of these LCTECH relays which are not original (clones) and even the other chip onboard is not programmed, so it can not be controlled by the ESP, does not matter, which firmware you use. And if it is not enough there are also some faulty ones, which has a power supply inadequate to even power on the relay. :D Not to mention soldering issues.

So although it is a very challenging and interesting game to try to make them work, but i will never buy from this kind of device.

anton.tkachenko
Normal user
Posts: 1
Joined: 22 Jun 2022, 10:54

Re: Serial MCU controlled relay/switch

#457 Post by anton.tkachenko » 22 Jun 2022, 11:04

Hello colleagues,

Is it possible to get status of "Serial MCU controlled relay/switch" via http get request? For example, for gpio-controlled relay it looks like http://192.168.1.1/control?cmd=status,gpio,0.

Also is it possible to pulse such relay (turn on for a defined time)? http://192.168.1.1/control?cmd=Pulse,14,1,500

All is according to https://www.letscontrolit.com/wiki/inde ... _Reference

User avatar
Ath
Normal user
Posts: 1809
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Serial MCU controlled relay/switch

#458 Post by Ath » 22 Jun 2022, 11:11

There is some documentation, though not very elaborate, on that plugin in the new (preferred and regularly updated) ReadTheDocs site: https://espeasy.readthedocs.io/en/lates ... #p091-page
/Ton

_Cyber_
Normal user
Posts: 100
Joined: 20 Oct 2019, 09:46

Re: Serial MCU controlled relay/switch

#459 Post by _Cyber_ » 29 Jun 2022, 07:06

the status is possible with: http://192.168.10.244/json?view=sensorupdate&tasknr=1

pulsing the relay (at least with longpulse) currently does only work with the firmware attached in this forum thread.
it does not work with the released testing firmware - see https://github.com/letscontrolit/ESPEasy/issues/3385

TD-er
Core team member
Posts: 6349
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Serial MCU controlled relay/switch

#460 Post by TD-er » 29 Jun 2022, 09:29

As linked in the previous post, this is (apparently) an still open issue which slipped my attention (again...)
You can however time these things using rules

A bit of pseudo code, as I have not looked at the exact syntax of the plugin switch on and off commands.
N.B. you need to include the switch on and off commands yourself at the places where it is noted to do so.

Code: Select all

on serSwitchPulse do
  // here command to turn the switch on
  timerSet_ms,1,%eventvalue1|100% // Set timer #1 for the given nr of msec, or default 100 msec when no eventvalue given
endon

On Rules#Timer=1 do  //When Timer1 expires, do
  // here command to turn the switch off
endon
Then you call this via an event called serSwitchPulse, with an optional argument to set the pulse duration.

Code: Select all

event,serSwitchPulse=200

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests