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

CAN controller #2

Open
alesha76 opened this issue Nov 14, 2020 · 9 comments
Open

CAN controller #2

alesha76 opened this issue Nov 14, 2020 · 9 comments

Comments

@alesha76
Copy link

Hello there! Interesting project. I've been looking for how to manage Logamatic 4211 for a long time. Thank you for your work. This topic is relevant. I have a few questions. Which CAN controller can be used for ESP (NodeMCU), and why is Raspberry used as a server?

@flyingflo
Copy link
Owner

I put everything together and published the embedded source code as well.

Here you go: https://github.com/flyingflo/heat_can

@flyingflo
Copy link
Owner

I'm going to put together some additional information in the wiki on github. It is a NodeMCU-compatible board. All I needed was the SPI interface and a digtial input and one output.

There are also ESP32 chips with an integrated CAN controller. I'd probably prefer one of those, but I had those boards at home, so I took this one.

The Raspberry runs the MQTT broker (the central server in MQTT jargon), and the protocol service. But these could be on any computer anywhere in the network. No hardware requirements here.

Of course the CAN protocol could also be implemented on the ESP board, but the reverse engineering took a lot of iterations, which were much faster with python on a workstation compared to building and flashing the embedded MCU each time.

@alesha76
Copy link
Author

Hello there! I looked up the implementation of Logamatic management on C+ from the repository link you gave me. I have all the NodeMCU boards and MCP2515 CAN Bus module TJA1050 SPI receiver. I will try to repeat your scheme. Can I see a video of your circuit working? This is interesting to me and some other Logamatic enthusiasts.

@alesha76
Copy link
Author

Hello! I managed to implement the Logamatic 4211 monitor on the esp8266. As a monitor, everything works fine, but when transmitting mode change commands (AUT, Day, Night), an error occurs on the CAN Bus "71 Adresskonflikt auf CAN-Bus !". Is this how it should be? Or I did something wrong.

@flyingflo
Copy link
Owner

flyingflo commented Mar 31, 2021

Hi, cool!
The error is not how it should be, quite sure. I guess the command has no effect consequently?

The address of the bus nodes can be set with a hardware switch (a circular switch, operated with a screw driver).
This program assumes two ids:

CAN_ID_SOURCE = 0x11

CAN_ID_DEST = 1

Where it's own is 0x11, because it is most likely free, and the controller hardware having 0x1 because this is the default.

Probably your setup is different? You should see the id of the controller in the message dump from the montoring messages.

And: There is an option in the common settings menu of the Logamatic 4000 called "Fernsteuerung" or "Fernwirksystem" or something similiar, iirc, which must be enabled to allow commands from the CAN bus.

hope this helps,
Flo

@flyingflo
Copy link
Owner

And: There is an option in the common settings menu of the Logamatic 4000 called "Fernsteuerung" or "Fernwirksystem" or something similiar, iirc, which must be enabled to allow commands from the CAN bus.

I just checked that: On the MEC2 in the settings menu the first point is "Alg. Kenndaten" then enable "Fernverstellung".
Probalby yours has a different language?

@alesha76
Copy link
Author

Thanks. Yes, I have a Russian language. I will try the settings.

@alesha76
Copy link
Author

I checked the "Fernsteuerung" option is enabled, I have the modes switched only gives the error 71 CanBus address conflict

@alesha76
Copy link
Author

alesha76 commented Apr 1, 2021

Flo Thank you!
Yes, everything turned out to be in the addresses, I played with them a little and the error no longer appears. Your experience has helped me well in my Logamatic 4000 management project. Thank you very much! I used the wemos d1 mini and the mcp2515 shield to integrate the web interface into the esp. The control functions were used to a minimum (modes Ain, Ua, Auto), I will add modes, hot water temperature change, Prog, winter/summer, vacation mode.
Alexey

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