Comments (9)
I turned on all logging & I got this:
15:57:24 HS-SR04: Avg Distance measured: 8.80, loops: 20
15:57:24 HS-SR04: New Distance: 3445.62
15:57:27 HS-SR04: Avg Distance measured: 9.12, loops: 20
15:57:27 HS-SR04: New Distance: 3445.52
15:57:29 HS-SR04: Avg Distance measured: 17.69, loops: 20
15:57:29 HS-SR04: New Distance: 3445.42
15:57:31 HS-SR04: Avg Distance measured: 22.23, loops: 20
15:57:31 HS-SR04: New Distance: 3445.32
15:57:34 HS-SR04: Avg Distance measured: 31.06, loops: 20
15:57:34 HS-SR04: New Distance: 3445.22
15:57:36 HS-SR04: Avg Distance measured: 18.63, loops: 20
15:57:36 HS-SR04: New Distance: 3445.12
You see that Avg distance measured is the right distance.
I'll check the code within a day or two to see what went wrong.
WH
from sonoff-tasmota.
Ahh,now I see clearly. There is damping factor that ensures values do not vary that much from one measure tot he other. Is described in the Wiki. Your first measurement was 3m. Now any additional measurement will change the value maximum 0.1mm. If you repower or change the limit from e.g. 0.1 to 1000 you should see the measured values. Anyhow the deviation is really high
from sonoff-tasmota.
It is working :)
The deviation is for testing - moving hand :)
The intended application for the sensor will be to monitor a container & it is building up rapidly so the deviation will be high also.
Thanks for your great work
from sonoff-tasmota.
I'm measuring distances which can varies about 10-20cm between two measurings.
Usage:
Device is in deepsleep for 1hour, than measuring
Example
12:00 distance is 180cm
13:00 distance is 181cm
14:00 distance is 200cm
15:00 distance is 182cm
16:00 distance is 183cm
Which settings should I do?
Have set deepsleep to 3600 and teleperiod to 10 (seconds)
How should I set MAX_DEVIATION_BETWEEN_MEASURES, and how must i define it in user_conf_override.h?
from sonoff-tasmota.
For the override. Please put the right spelling just posting from my iPad the concept
#ifdef MAX_DEVIA......
#undef MAX_DEVI.....
#endif
#define MAX_DEVIATIO...... = 100
from sonoff-tasmota.
Hi again,
tried these setting in user_conf_override.h:
#ifdef MAX_DEVIATION_BETWEEN_MEASURES
#undef MAX_DEVIATION_BETWEEN_MEASURES
#endif
#define MAX_DEVIATION_BETWEEN_MEASURES 100
The following compile error occurs:
Arduino: 1.8.5 (Windows 10), Board: "Generic ESP8266 Module, Serial, 80 MHz, 26 MHz, 40MHz, DOUT, 115200, 1M (no SPIFFS), nodemcu, Disabled, None"
In file included from C:\xxxxxxxxxxxxxxxxxx\sonoffAkku.ino:34:0:
user_config_override.h:38: error: expected unqualified-id before numeric constant
#define MAX_DEVIATION_BETWEEN_MEASURES 100
^
C:\xxxxxxxxxxxxxxxxxx\xsns_19_HC-SR04.ino:23:7: note: in expansion of macro 'MAX_DEVIATION_BETWEEN_MEASURES'
float MAX_DEVIATION_BETWEEN_MEASURES = 0.1;
^
exit status 1
expected unqualified-id before numeric constant
Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
If i comment out the line "#define MAX_DEVIATION_BETWEEN_MEASURES 100" I can compile without error.
I also tried the followin lines:
#define MAX_DEVIATION_BETWEEN_MEASURES=100
#define MAX_DEVIATION_BETWEEN_MEASURES=100;
All lines bring me compile errors.
Can you please help?
from sonoff-tasmota.
Hi helmar74,
MAX_DEVIATION_BETWEEN_MEASURES is a float variable - you cannot override it in user_config_override.h.
In the file xsns_19_HC-SR04.ino you just change the number from 0.1 to 100 - like that:
float MAX_DEVIATION_BETWEEN_MEASURES = 100;
from sonoff-tasmota.
I made the value dynamically by getting an idea how strong your values change. the measured value is sometimes a little behind the current value if this changes at a constant rate. Anyhow better than before. Also removed some timing issues, if there is no echo detected.
from sonoff-tasmota.
This now part of the main project. Behavior is different now
from sonoff-tasmota.
Related Issues (20)
- SetOption80 1 HangUp the Device HOT 13
- Can´t connect to WIFI after upload your Firmware HOT 2
- SHUTTER50PERCENT not work HOT 7
- Erratic Behaviour when Slow Blinds - includes fix HOT 1
- Dim the lights in the switch? HOT 6
- Shutter dead time support HOT 11
- Vcc in state HOT 3
- Alexa Dimming doesnt work HOT 4
- PCF8574 on master HOT 2
- PCF8574: ports on at startup HOT 9
- MQTT Report during movement HOT 1
- DeepSleep consumption HOT 1
- MQT: TLS connection error: 0 HOT 4
- Calibration 2nd shutter HOT 1
- Shutter with LC-TECH X2 in mode 1 allows changing direction without power removal HOT 5
- MQT: TLS connection error: 0 HOT 1
- Mq sensor
- Sonoff touch TX T3 Us
- upgrading from Sonoff-Tasmota 6.5.0.11 stb-1.5 by Theo Arends HOT 7
- Shutter - inverse mode - slider not correct HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonoff-tasmota.