nekromant / esphome-lctech-4chanel-modules

ESPHome configs for LC-tech 4 channel modules.
12 stars 6 forks source link

Support for x2 relays board #5

Open mgcomp81 opened 4 years ago

mgcomp81 commented 4 years ago

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!!!

nekromant commented 4 years ago

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.

mgcomp81 commented 4 years ago

Hi Andrew, thanks for reply.

Please let me know what i have to modify to get platformio full support fo this nuvoton 76003.

Thank you very much.

Have a nice day

Il mer 9 set 2020, 15:07 Andrew notifications@github.com ha scritto:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nekromant/esphome-lctech-4chanel-modules/issues/5#issuecomment-689550859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQW5RKLODF7NX7ULV53AUPTSE54ZDANCNFSM4Q27HJVQ .

aladin2000 commented 3 years ago

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

mgcomp81 commented 3 years ago

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

aladin2000 commented 3 years ago

Hi Thks a lot In fact i have the original firmware and using esp2relay app both  relays work with it I  hope to control it with esphome Regards Aladin

20 mars 2021 17:26:14 mgcomp81 @.***>:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub[https://github.com/nekromant/esphome-lctech-4chanel-modules/issues/5#issuecomment-803399356], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AD7K4I7OFIACLRPQA2TGC53TETD7ZANCNFSM4Q27HJVQ]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAYAAABXXxDfAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAmSURBVGiB7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAJwY+QwABivJx1AAAAABJRU5ErkJggg==###24x24:true###][Image de pistage][https://github.com/notifications/beacon/AD7K4I2UJMG24SRGBKDZM2LTETD7ZA5CNFSM4Q27HJV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF7RONPA.gif]

mgcomp81 commented 3 years ago

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!!!

nekromant commented 3 years ago

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 ;(

mgcomp81 commented 3 years ago

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

nekromant commented 3 years ago

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

aladin2000 commented 3 years ago

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

?

mgcomp81 commented 3 years ago

Hi Aladin, pinout is different from micro ports... See it on https://pic-microcontroller.com/simple-gpio-functions-on-nuvoton-n76e003-led-blinking-and-controlling-led-using-a-push-button/ for example.

Bye!