Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using this project with a plain MAX485 breakoutboard #14

Closed
s00500 opened this issue Apr 9, 2023 · 3 comments
Closed

Using this project with a plain MAX485 breakoutboard #14

s00500 opened this issue Apr 9, 2023 · 3 comments

Comments

@s00500
Copy link

s00500 commented Apr 9, 2023

Hi Guys,

Just got my new doors installed and made sure I could get them controlled today. I had the 6 pin connectors and some old max485 breakout boards at home. I choose to build this using only a ESP32 since I think it is powerfull enough.

When using just a max485 the direction on the bus needs to be controlled as well. The converter board shown in the readme does this automatically. This caused me some minor troubles and several hours of debugging....

Initially I could not get stuff to work. I modified the code to use Serial2 on 16/17 and added a pin that controls the max 485 direction. Several times I could get it to respond correctly.... but then the door would go into a 4 times red blink pattern till a bus scan was executed again. (I have a promatic 4)

The two things I messed up where:

  • I had added a second 120Ohm resistor, there was already one on the breakout board

  • The hardware UART write operation is asyncronous. The code fills the register but that take much less time than the write. But as I controlled the Direction pin by setting it before and after the write call I screwed up the transmission. The fix here was to add a delay based on the tx buffer length before I released the direction pin again. This finally made it work perfectly fine.

I thought I post this here as an issue in case somebody runs into similar trouble. It works great for me now, and I might play with it to add it to ESPHome in some way as I prefer control via HomeAssistant (although the webui is really pretty, well done @hkiam !!!).
Hope this helps when troubleshooting

Greetings from Vienna,
Lukas

@s00500 s00500 closed this as completed Apr 9, 2023
@MCLW
Copy link

MCLW commented Jul 22, 2023

Hi Lukas,

I have the same issue from time to time. After some hours or days, my pro Matic ran into this error.

Can you please share your code with this fix.

Thank you

Maik

@s00500
Copy link
Author

s00500 commented Aug 1, 2023

Hey @MCLW
I did not work very elegant here yet haha....

I am planning to make a esphome component out of it at some point... For now if you wanna see my modified code check here:
https://git.lbsfilm.at/lbsadmin/HCPBridgeESP32

@MCLW
Copy link

MCLW commented Aug 28, 2023

Thank you, I will try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants