eloquentarduino / EloquentSurveillance

GNU General Public License v3.0
40 stars 10 forks source link

as at 1May23 your top "Motion Detection Example" and "MotionDetectionSaveToSpiffs.ino" won't compile #9

Open Rob58329 opened 1 year ago

Rob58329 commented 1 year ago

Using your "github.com/eloquentarduino/EloquentSurveillance" software as at 1May23 and "github.com/espressif/arduino-esp32" as at 1May23 with the arduino-IDE, compiling the above example (or your "MotionDetectionSaveToSpiffs.ino" example) fails to compile with the error messages:

In file included from C:\Users\Arduino\libraries\github_eloquentarduino_EloquentSurveillance-main\src/EloquentSurveillance.h:14,
                 from C:\Users\Arduino\motion_v1\motion_v1.ino:2:
c:\users\arduino\libraries\github_eloquentarduino_eloquentsurveillance-main\src\motion.h:443:104: error: 'uitn16_t' has not been declared
         void forEachBlock(Callback callback, Reducer& reducer, uint16_t x, uint16_t y, uint16_t width, uitn16_t height, uint8_t size) {
                                                                                                        ^~~~~~~~
c:\users\arduino\libraries\github_eloquentarduino_eloquentsurveillance-main\src\motion.h: In member function 'void EloquentSurveillance::Motion::locate2()':
c:\users\arduino\libraries\github_eloquentarduino_eloquentsurveillance-main\src\motion.h:412:61: error: expected primary-expression before ';' token
             for (uint16_t y = _location.y > blockSize / 2 ? ; y < _location.y + blockSize; y += blockSize / 2) {
                                                             ^
c:\users\arduino\libraries\github_eloquentarduino_eloquentsurveillance-main\src\motion.h:412:60: error: expected ':' before ';' token
             for (uint16_t y = _location.y > blockSize / 2 ? ; y < _location.y + blockSize; y += blockSize / 2) {
                                                            ^~
                                                            :
c:\users\arduino\libraries\github_eloquentarduino_eloquentsurveillance-main\src\motion.h:412:61: error: expected primary-expression before ';' token
             for (uint16_t y = _location.y > blockSize / 2 ? ; y < _location.y + blockSize; y += blockSize / 2) {
                                                             ^
c:\users\arduino\libraries\github_eloquentarduino_eloquentsurveillance-main\src\motion.h:418:47: error: 'W' was not declared in this scope
                         uint32_t offset = j * W;
stuppert commented 1 year ago

I have the same issue. I think there is a typo at line 443 and 412:

I managed to run the code by changing "uitn16_t" in line 443 to "uint16_t" and deleting the ? in line 412. Also delete the "?" at line 412.

Rob58329 commented 1 year ago

Also I needed to change line "motion.h:418" from "uint32_t offset = j * W;" to "uint32_t offset = j * (getWidth()/8);"

Patriboom commented 1 year ago

Thanks all of you, your corrections work. Digest of those three corrections in src/Motion.h file goes like that:

Line 412 for (uint16_t y = _location.y > blockSize / 2 ; y < _location.y + blockSize; y += blockSize / 2) {

Line 418 uint32_t offset = j * (getWidth()/8);

Line 443 void forEachBlock(Callback callback, Reducer& reducer, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t size) {


File WifiHelper.h Line 58 return String(ip[0] + '.' + ip[1] + '.' + ip[2] + '.' + ip[3])

marketviable commented 1 year ago

Fix available pull request #14