hoylabs / OpenDTU-OnBattery

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters, VE.Direct devices, battery management systems, and related peripherals
GNU General Public License v2.0
301 stars 63 forks source link

Bugfix/deviceprofile dtufusion with cmt and w5500 #1259

Closed vaterlangen closed 3 weeks ago

vaterlangen commented 3 weeks ago

Fixed device profile for OpenDTU Fusion v2 to allow usage of CMT2300A with W5500. Also added missing LED mapping and explicitly disabled ETH for W5500 profiles.

Fixes #1257

schlimmchen commented 3 weeks ago

The eth object really is redundant for the opendtufusion boards. The ESP32-S3 does not even have an Ethernet MAC. See #1253.

Please explicitly unset the CMT2300 pins for the NRF+W5500 variant, as it has the same issue as you observed (when using the opendtufusionv2 environment).

Also added missing LED mapping

Good catch, thanks!

AndreasBoehm commented 3 weeks ago

Should we actively disable the CMT2300 within the config OpenDTU Fusion v2 with NRF24 and W5500 ethernet as well?

vaterlangen commented 3 weeks ago

Already thought about that - but it seems to be disabled by default

vaterlangen commented 3 weeks ago

The ESP32-S3 does not even have an Ethernet MAC

Of course not - thats why we need the W5500 ;) I just missed out #1253 and was annoyed by the highlighting

schlimmchen commented 3 weeks ago

Thanks :muscle:

schlimmchen commented 3 weeks ago

Should we actively disable the CMT2300 within the config OpenDTU Fusion v2 with NRF24 and W5500 ethernet as well?

@AndreasBoehm Yes, that's what I meant.

Already thought about that - but it seems to be disabled by default

I did not check the code to be absolutely sure, but I think Ethernet is initialized first, occupying one SPI bus, then the NRF24 is initialized, using the second SPI bus, and then the CMT2300 is not initialized as no more SPI bus is available. To avoid a message "no more SPI bus available" and to make it absolutely clear that the CMT2300 is unusable in this case, we set the pns to -1.