gysmo38 / mitsubishi2MQTT

Mitsubishi to MQTT with ESP8266 module
GNU Lesser General Public License v2.1
390 stars 139 forks source link

Replace deprecated SPIFFS with LittleFS #78

Closed andig closed 3 years ago

andig commented 4 years ago

NOTE: while this PR compiles with the OOTB boards supported, there doesn't seem to be a LittleFS port for ESP32 yet, see https://github.com/espressif/arduino-esp32/issues/3765

gysmo38 commented 4 years ago

Do you think it possible to choose fs type according hardware platform?

andig commented 4 years ago

We would probably need to add a define to redefine the term SPIFFS or LittleFS and use the define as stand-in for the actual implementation? That way we could keep the defines at the Header level without if/elsing the entire file?

andig commented 4 years ago

This is working now except for an esp32 error I cannot quite graps (not a C person):

/Users/andig/htdocs/mitsubishi2MQTT/src/mitsubishi2mqtt/mitsubishi2mqtt.ino: In function 'void setup()':
/Users/andig/htdocs/mitsubishi2MQTT/src/mitsubishi2mqtt/mitsubishi2mqtt.ino:177:39: error: invalid conversion from 'void (*)(byte*, unsigned int, const char*) {aka void (*)(unsigned char*, unsigned int, const char*)}' to 'void (*)(byte*, unsigned int, char*) {aka void (*)(unsigned char*, unsigned int, char*)}' [-fpermissive]
     hp.setPacketCallback(hpPacketDebug);
                                       ^
In file included from /Users/andig/htdocs/mitsubishi2MQTT/src/mitsubishi2mqtt/mitsubishi2mqtt.ino:39:0:
.pio/libdeps/esp32/HeatPump_ID7096/src/HeatPump.h:234:10: note:   initializing argument 1 of 'void HeatPump::setPacketCallback(void (*)(byte*, unsigned int, char*))'
     void setPacketCallback(PACKET_CALLBACK_SIGNATURE);
          ^

Since I'm seeing the same error on master this should be good to go.

gysmo38 commented 4 years ago

Thanks a lot :) I will try it.

andig commented 4 years ago

As you've noticed, esp32 also didn't have a unit_conf. I'm pretty sure that it never worked before?

gysmo38 commented 4 years ago

I do not use esp32 so I never test it. I think it is something I change for esp8266 and forgot to change it for esp32. I try to compil for esp32. I have same issue. I do not understand. This is a part of code that I copy from mitsubishi_heatpump_mqtt_esp8266_esp32.ino. And it work in the example. I have not many time tonight to search more. I hope to find time this week.

dzungpv commented 3 years ago

I think this project LittleFS not have big advantage compare to SPIFFS, which i have fully test on both ESP8266 and ESP32 for function like firmware update over OTA.

gysmo38 commented 3 years ago

I think will keep SPIFFS