Ziyatoe / DTUsimMI-Hoymiles

Hoylmoly DTU for Hoymiles MI and TSUN microinverter
19 stars 8 forks source link

ESP32 #9

Closed seanco1 closed 1 year ago

seanco1 commented 1 year ago

Would it be possible to get this working on an ESP32 instead of the mentioned 8266? Arduino code won't compile with ESP32 board selected

Ziyatoe commented 1 year ago

no, it wouldnt work. but try this https://discord.com/channels/984173303147155506/1086180225341198388/1094204670697811988, we put the hm and mi code together in ahoydtu.

seanco1 commented 1 year ago

no, it wouldnt work. but try this https://discord.com/channels/984173303147155506/1086180225341198388/1094204670697811988, we put the hm and mi code together in ahoydtu.

I tried the ahoy version however is seems it does not support 1060xxxxxxxx serial numbers (just received a test file from them so I will try that later today). I got an ESP 8266 chip and your code is now running, there were some adjustments needed for 1060xxx serial number inverters I would like to share for anyone interested or perhaps I did it wrong?

I am using MI-1200 (gen 1), on the web interface my inverter shows as MI1500 but I guess that's because of my change below but without that case change the inverter is unknown. All stats seem to be working as expected though.

If this could support multiple inverters and MQTT credentials that would be awesome. However at the price of 8266 and NRF unit you can just buy multiples I guess.

NRF24_DTUMIesp.ino (line 307) original - case 0x61: WhichMI = MI1500; //MI1500 change to - case 0x60: WhichMI = MI1500; //MI1500

(line 120) original - static uint8_t WhichMI = 0 change to - static uint8_t WhichMI = 2

Settings.h (line 46) - I changed because my MQTT needs credential and I don't know where to set them original - static bool WITHMQTT = true; change to - static bool WITHMQTT = false;

(line 64) - using 4 PV original - uint8_t NRofPV = 0 change to - uint8_t NRofPV = 4

(line 105) - 1060xxx serial numbers seem to use 2M datarate and not the default 250K original - #define DEFAULT_RF_DATARATE (RF24_250KBPS) change to - #define DEFAULT_RF_DATARATE (RF24_2MBPS)

Ziyatoe commented 1 year ago

ahoy in dev version 0.6.4 is supporting mi1200 and up to 10 inverters. you can get the dev version only from this link, what i gave to you before sorry, i stopped the dev on my repo, so please try to use ahoy-dtu with mi support: https://discord.com/channels/984173303147155506/1086180225341198388