nekromant/esphome-lctech-4chanel-modules

Support for x2 relays board

Opened this issue · 11 comments

Hi,

I have a lot of lctech relays x2 boards with nuvoton 76e003 mcu.... Programmed with the .hex provided here but pinout is totally different for the x4 relays version.

Can you please tell me how to compile the source code? Tried with platformio but can't find the board, tried with keil but will put some errors on compiling....

Please help me, thanks in advance!!!

I had some modifications to platformio support for these nuvoton thingies, but I haven't sent the pull request upstream. I'll have a look at the weekend.

I had some modifications to platformio support for these nuvoton thingies, but I haven't sent the pull request upstream. I'll have a look at the weekend.
Hi
A have alaso suche a relay 2 ports
do you have any news with that schedule ?
regards

Hi Aladin, Hi Nekromant,
today evening i try to reverse engineering the lctech 2 relay board, have to desolder alla components and follow traces to make a schematic, because it seem to differ from the 4 relay board.
Tomorrow I will post a sort of schematic or a text file with the connections.
I'm not interested for business, i'm interested because i have 20 of these boards to control blinds and curtains in my home and i would take the advantage of full control of it via esphome and home assistant.
See you

Hi all
Desoldered Nuvoton mcu to see traces behind it, result is completely different for the 4 relays board, so:
RL 1 is Nuvoton pin 13
RL 2 is Nuvoton pin 10
S1 is Nuvoton pin 16
S2 is Nuvoton pin 15
Green Led is Nuvoton pin 20
Blue Led is Nuvoton pin 19
Red Led is Nuvoton pin 17
Found unpopulated R13 and R14 respectively to GPIO0 and GPIO2 of the esp01 module.
For the author of the code (Nekromant, great job of course), can be easy to change pins on the sketch and compile a firmware for the 2 channel board, to unlock all the functions.
I want to use S1 and S2 to control RL1 and RL2 and have the state on Home assistant via esp01.

Nekromant please help us!
Thanks!!!

Okay, folks. It seems you've done mostly everything. For a custom firmware for nuvoton, grab my fork of platform-intel_mcs51 for platformio at http://github.com/nekromant/platform-intel_mcs51.git
I'll send the merge request upstream shortly (Seems like I have forgotten to do that earlier)

Adjust my custom firmware for your 2-relay boards: https://github.com/nekromant/lctech-relay-altfw

For platformio it's just a matter of typing pio run. Just don't forget to adjust the path in platformio.ini

N.B. You'll still have to use the weird bu-link or nu-link programmer (~7$ at aliexpress) and windows software to flash the resulting hex file.

Afterwards you can use the esphome configs. Really sorry I can't support you any more than that, really busy ;(

Thanks,

compiled with these variables:

#define RELAY4 P11
#define RELAY3 P05
#define RELAY2 P15
#define RELAY1 P12

#define RED P01
#define GREEN P04
#define BLUE P03

#define PWM_GREEN PWM3L
#define PWM_BLUE PWM5L
#define PWM_RED PWM4L

#define BUTTON1 P00
#define BUTTON2 P10

Tomorrow I will test, If the test goes well, I can send the firmware.hex for the 2 relais version.
BR

Please send the MR to the altfirmware repo, so that we have everything in one place. Thanks!

Thanks,

compiled with these variables:

#define RELAY4 P11
#define RELAY3 P05
#define RELAY2 P15
#define RELAY1 P12

#define RED P01
#define GREEN P04
#define BLUE P03

Tomorrow I will test, If the test goes well, I can send the firmware.hex for the 2 relais version.
BR

for my best read wasn't it

RL 1 is Nuvoton pin 13
RL 2 is Nuvoton pin 10
S1 is Nuvoton pin 16
S2 is Nuvoton pin 15
Green Led is Nuvoton pin 20
Blue Led is Nuvoton pin 19
Red Led is Nuvoton pin 17

?