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

[Request] Support for Huawei R4850G2 via SN64HVD230DR #999

Closed
drahdiwaberl opened this issue May 22, 2024 · 13 comments · Fixed by #1482
Closed

[Request] Support for Huawei R4850G2 via SN64HVD230DR #999

drahdiwaberl opened this issue May 22, 2024 · 13 comments · Fixed by #1482
Assignees
Labels
enhancement New feature or request

Comments

@drahdiwaberl
Copy link

drahdiwaberl commented May 22, 2024

Describe the solution you'd like

there's a new - potentially simpler and safer - option for adding a CAN-bus with
this extension for the Fusion board which is using a TI SN65HVD230DR

also the upcoming pcb of @swingstate #541 uses this transceiver chip

it would be nice to have the option to configure a Huawei PSU connected to this.

Describe alternatives you've considered

tried the current implemented solution with a MCP2515/TJA1050 with the Fusion Board and one other ESP-board - but got neither to work (or stopped trying due to magic smoke in the air).

so for now i'm running it without issues a SN65HVD230DR board with esphome

@drahdiwaberl drahdiwaberl added the enhancement New feature or request label May 22, 2024
@drahdiwaberl
Copy link
Author

there's an esphome component for connecting that way
https://github.com/mb-software/esphome-huawei-r4850

@drahdiwaberl drahdiwaberl changed the title [Request] Support for OpenDTU Fusion CAN/Iso Shield with Huawei PSU [Request] Support for Huawei R4850G2 via SN64HVD230DR Jun 11, 2024
@AndreasBoehm
Copy link
Member

I think that this should not be too big of a deal but we will need someone that can write code and has the hardware. I thought about buying a Huawei PSU but I am not sure if i will actually use it.

@drahdiwaberl
Copy link
Author

assuming you're the one who could write code? ;)

schätz mal du würdest es easy wieder anbringen.. meins rennt schon ziemlich viel, hab aber auch einiges an ac-überschuss aus 800+1500W microwechselrichtern - mal schaun wie's dann mit weniger sonne und dafür extremeren schwankungen beim dynamischen import-preis ausschaut..

@schlimmchen
Copy link
Member

assuming you're the one who could write code? ;)

eeeeer, yes?! one of only two actually active contributors right now. sooo... where is your pull request?

@LennartF22
Copy link

@schlimmchen If there is need for it, I could implement this. I don't have a Huawei PSU, but I could do some mocking on the CAN bus and at least make sure that there is nothing obvious broken before giving a build to someone to test.

@schlimmchen
Copy link
Member

If there is need for it

@LennartF22 Well, I am not sure if "need" is the right word here, but this is a valid request and implementing it would be highly appreciated, so I would certainly want to merge it. I would love to use the AC charging feature myself one day and using the OpenDTU Fusion CAN shield would definitely be a great plus. So please go ahead 😊 I can probably contribute some matching updates to the documentation.

@drahdiwaberl
Copy link
Author

and well (again), it would be the only way to allow NRF+CMT+huaweiAC, isn't it?

btw i'm thinking about getting a second huaweiAC to spread load on two phases - which a. will probably make my next feature request ;) and b. allow me to more easily test if anyone starts working on this..

@schlimmchen
Copy link
Member

and well (again), it would be the only way to allow NRF+CMT+huaweiAC, isn't it?

No, as @LennartF22 is also hard at work with the SpiManager, which will eventually allow to use this combination -- as far as I understand.

@LennartF22
Copy link

@drahdiwaberl With the new SpiManager it is possible to support up to three devices on the same SPI master peripheral. The driver for the SPI devices must support this though:

  • nRF: not supported yet, but in the works
  • CMT: supported
  • W5500 (Ethernet): supported
  • Huawei-CAN (via MCP2515): not supported yet, but in the works

Devices that don‘t support shared SPI buses yet still need a dedicated SPI bus. Therefore, nRF + CMT (+ W5500) + Huawei-CAN currently need 3 SPI buses, which is one too many. In the future, nRF + CMT + Huawei-CAN will work via the same SPI bus, so that one bus is completely free for 1/3 more devices, depending on whether these additional devices support sharing.

Still, implementing support for ESP32’s internal CAN controller makes sense, not only because of the Fusion CAN/ISO shield, also because it’s a bit absurd that one must add an external CAN controller while the ESP32 already comes with it. Only when a second CAN bus is needed, one should have to add an additional, external CAN bus controller.

@schlimmchen I will start working on the implementation next week. I just wanted to make sure that nobody is working on that yet.

@drahdiwaberl
Copy link
Author

because it’s a bit absurd that one must add an external CAN controller while the ESP32 already comes with it.

word! 🤗

also - while it's nice that they exist and are available - all these extra boards and cheap components are potential points of failure in the whole system which makes the systems less reliable and errors possibly hard to find..

@schlimmchen
Copy link
Member

@LennartF22 Are you far along with adjusting the MCP2515 driver for SpiManager? I started but did not get far, yet. The MCP2515 lib is a hot mess (my opinion) and I am planning to re-implement the parts that are needed to support the Huawei PSU. skippermeister's fork includes a version compatible with SpiManager, however it's unrecognizable from the original lib and I am unsure if it even works, as his TWAI implementation was broken in at least two places... Maybe I can copy'n'paste some tricky bits.

@drahdiwaberl
Copy link
Author

might add this https://github.com/mjpalmowski/CAN-BUS-control-R4875G1-with-ESPHome-and-MQTT

also using SN65HVD230 transceiver, but seems to have gotten further with reversing the can bus, even seems to have worked out how to identify and likely even assign IDs to multiple devices on the bus..

@schlimmchen
Copy link
Member

@Manos1966 pointed out that project to me as well. I will gladly take a look. For now, I am happy to be able to soon release VP203 support to talk to the Huawei PSU at all.

@schlimmchen schlimmchen linked a pull request Dec 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants