happytm / BatteryNode

Simplest DIY low power, low cost, standalone or web connected IOT sensors network framework using ESP32 or ESP8266 (no third party service required).
MIT License
44 stars 10 forks source link

motionDetector.h #6

Open Terrence77 opened 1 year ago

Terrence77 commented 1 year ago

Attempting to get your great code loaded on 2 esp boards.

Having trouble finding motionDetector.h

Found multistatic_interference_radar.h by the same guy in github, but it's a different file.

Do you know were I can get the motionDetector.h lib?

Thanks.

happytm commented 1 year ago

https://github.com/happytm/MotionDetector/tree/main/motionDetector

Thanks.

Terrence77 commented 1 year ago

Thank you happytm.

Terrence77 commented 1 year ago

It seems I am so close to getting the gatewasy to compile. I am new to iot dev, I wonder if you might help me debug my build error.

googling I found this thread: https://github.com/espressif/arduino-esp32/issues/6332

onEvent is expecting an arduino event, not ESP-IDF system event. See the options here: https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiGeneric.h#L36-L78

Here is the error I am getting.

E:\source\ArduinoProjects\BatteryNode\examples\SimpleGateway\SimpleGateway.ino: In function 'void setup()': SimpleGateway:123:60: error: no matching function for call to 'WiFiClass::onEvent(void (&)(arduino_event_id_t, arduino_event_info_t), system_event_id_t)' WiFi.onEvent(probeRequest, SYSTEM_EVENT_AP_PROBEREQRECVED); Serial.print("Waiting for probe requests ... "); ^ In file included from C:\Users\terre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi\src/WiFiSTA.h:28, from C:\Users\terre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi\src/WiFi.h:32, from E:\source\ArduinoProjects\BatteryNode\examples\SimpleGateway\SimpleGateway.ino:3: C:\Users\terre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi\src/WiFiGeneric.h:159:21: note: candidate: 'wifi_event_id_t WiFiGenericClass::onEvent(WiFiEventCb, arduino_event_id_t)' wifi_event_id_t onEvent(WiFiEventCb cbEvent, arduino_event_id_t event = ARDUINO_EVENT_MAX);

happytm commented 1 year ago

I frankly do not know how to solve this problem. I never had this problem.

Can you try to compile sketches starting with 802.11 from following folder?

https://github.com/happytm/BatteryNode/tree/master/examples/test

Thanks.

happytm commented 1 year ago

You need to upload original "data" folder to make it work.

Thanks.

Terrence77 commented 1 year ago

Oh, Ok, let me try that out. Thank you for your help. Really excited to find a super low power solution.

Terrence77 commented 1 year ago

Could you tell me what WiFi lib you are using? I have 2 installed and both throw errors.

Here are the comments at the top of the .h files

WiFi.h - Library for Arduino Wifi shield. Copyright (c) 2011-2014 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

////////////////////////////////////////////////////////////////////

WiFi.h - esp32 Wifi support. Based on WiFi.h from Arduino WiFi shield library. Copyright (c) 2011-2014 Arduino. All right reserved. Modified by Ivan Grokhotkov, December 2014

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

happytm commented 1 year ago

It is built in library. You do not have to install the library. If you choose esp32 board in Arduino IDE it should work.

Thanks.

Terrence77 commented 1 year ago

I promise I am not and will not use you for tech support.
I just can't seem to get your SimpleGateway to compile.

I have built a brand new windows 10 machine. Installed a fresh version of Arduino. In board manager I have installed esp32 by Expressif Systems.

I am using Arduino Wifi https://github.com/arduino-libraries/WiFi

The Arduino Wifi library does not contain many of the methods you are calling.

'class WiFiClass' has no member named 'onEvent' 'class WiFiClass' has no member named 'waitForConnectResult' no matching function for call to 'WiFiClass::disconnect(bool)' 'class WiFiClass' has no member named 'mode' 'class WiFiClass' has no member named 'softAP' 'class WiFiClass' has no member named 'waitForConnectResult'

We must be using a different library.

Would you mind looking in the Wifi.cpp file you are using and telling me what it says at the top?

Mine Wifi.cpp says:

WiFi.cpp - Library for Arduino Wifi shield. Copyright (c) 2011-2014 Arduino LLC. All right reserved.

Thank you for your help.

happytm commented 1 year ago

There are .bin files you can use if you can not compile. Just upload these files. Thanks.