Lyve1981 / GrowattUsbModbus

Growatt ModBus => MQTT translation service
MIT License
23 stars 6 forks source link

Compile error #6

Closed schwaigi closed 1 year ago

schwaigi commented 1 year ago

Hy allways get a Code error:

C:\Users\Schwaigi\Downloads\GrowattUsbModbus-main (2)\GrowattUsbModbus\GrowattUsbModbus.ino: In function 'bool sendError(const ArduinoJson6201_F1::StaticJsonDocument<1024>&, const char)': C:\Users\Schwaigi\Downloads\GrowattUsbModbus-main (2)\GrowattUsbModbus\GrowattUsbModbus.ino:95:1: error: no return statement in function returning non-void [-Werror=return-type] 95 | } | ^ C:\Users\Schwaigi\Downloads\GrowattUsbModbus-main (2)\GrowattUsbModbus\GrowattUsbModbus.ino: In function 'bool sendError(const char)': C:\Users\Schwaigi\Downloads\GrowattUsbModbus-main (2)\GrowattUsbModbus\GrowattUsbModbus.ino:99:1: error: no return statement in function returning non-void [-Werror=return-type] 99 | } | ^ cc1plus.exe: some warnings being treated as errors

exit status 1

Compilation error: no return statement in function returning non-void [-Werror=return-type]`

ilikebeer commented 1 year ago

HI i have the same Problem

Some Solution?

frankewi commented 1 year ago

Just got the same error,

both functions bool sendError(const StaticJsonDocument<1024>& request, const char error) bool sendError(const char error) won't return anything:

change: add a "return" in both functions:

bool sendError(const StaticJsonDocument<1024>& request, const char* error) { return sendError(&request, error);

} bool sendError(const char* error) { return sendError(nullptr, error); }

ilikebeer commented 1 year ago

Hi,

i got the same Error, but i deleted all of them. Here the modifid Code it works fine.

I use a Growatt MOD15KTL3-X I can write messages in the Growatt like active power and i can read meassages like the String Power

GrowattUsbModbus_insalled.zip

Lyve1981 commented 1 year ago

fixed via PR #9