olehs / PZEM004T

Arduino communication library for Peacefair PZEM-004T Energy monitor
MIT License
226 stars 114 forks source link

Error when compiling with linux based Arduino compiler #57

Closed geev8 closed 4 years ago

geev8 commented 5 years ago

Hi am receiving this error msg when compiling my codes with makefile on linux but no problem with IDE compiler

/usr/share/arduino//libraries/PZEM004T/PZEM004T.cpp: In member function ‘bool PZEM004T::recieve(uint8_t, uint8_t*)’: /usr/share/arduino//libraries/PZEM004T/PZEM004T.cpp:148:15: error: ‘yield’ was not declared in this scope yield(); // do background netw tasks while blocked for IO (prevents ESP watchdog trigger) ^ /usr/share/arduino//libraries/PZEM004T/PZEM004T.cpp:162:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<RESPONSE_DATA_SIZE; i++) ^ /usr/share/arduino/Arduino.mk:1186: recipe for target 'build-uno/libs/PZEM004T/PZEM004T.cpp.o' failed make: *** [build-uno/libs/PZEM004T/PZEM004T.cpp.o] Error 1

vortigont commented 5 years ago

You need to include arduino SDK or (better) use platformio to build under linux.