Comments (13)
This issue is new. Can you please recheck, if the behavior is reproduce able with a different SR04. Currently I assume a hardware defect, that causes the nodemcu wait to long for a sound reply. The behavior is known, if you disconnected the device.
from sonoff-tasmota.
Hi,
Nodemcu is fine, I can run a lot of different sketches on it, and also "normal" tasmota firmware
It doesn't matter if a SR04 is connected or not. I only selected as Device "18-generic) and for
D2 GPIO4 - 68 SNS_TRIG
D1 GPIO5 - 69 SNS_ECHO
the SR04 isn't connected. After saving the settings the device isn't reachable any longer or really slow:
from sonoff-tasmota.
As mentioned a disconnected device will always behave this way. The esp is a single core CPU. Is it wait for the signal nothing else will work. The sketch will only work with a connected and well working SR04
from sonoff-tasmota.
OK understood. I also figured out, that the distance is not measured correctly. A 70cm Distance is show 35cm:
from sonoff-tasmota.
Hi Helmar,
Do you still connect the sensor as:
D2 GPIO4 - 68 SNS_TRIG
D1 GPIO5 - 69 SNS_ECHO
I am trying this fork but I am getting strange behavior from the sensor - distance always > 1000 cm!!!
I am connecting the sensor as:
D1 GPIO5 - 68 SNS_TRIG
D5 GPIO14 - 69 SNS_TRIG
Did you manage to figured it out?
Thanks,
from sonoff-tasmota.
I haven’t seen this behavior on my SR04. Some of the GPIO on the wemos have 10k pull-up or Pulldown resistors. But I do not believe that this causes the issue. Do you have connected the SR04 to the 5V. This is important because the module does not work with 3.3V. My configuration also uses D5 as echo pin.
from sonoff-tasmota.
The reported value is the timeout value, if there is no response detected
from sonoff-tasmota.
The module is connected to the 5V & I tried with & without a capacitor on the Vcc but same results.
I noticed that the large values are obtained when the sensor is covered or facing a distant wall (I think more than 2 meters or so)
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.
from sonoff-tasmota.
As posted in the other issue there is a limit defined about the maximum change between two values. Please take a look in the wiki here.
from sonoff-tasmota.
Hi @stefanbode @whhsn,
connected that way:
Always get round about 22cm Distance, no matter how long it is in real ...
Check of Power Supply doesn't helped, I have exactely 5V.
Replace HC-SR04 same issue. Both HC-SR04 works with my own code...
from sonoff-tasmota.
Take a look at the WIKI here. There is a 0.1mm max deviation between two measurements. If you don't want to have this change the constant: MAX_DEVIATION_BETWEEN_MEASURES . You can override the value in user_config_override.ino
Otherwise, you should see on the MAIN Web page that the value will constantly change by 0.1mm. Please feedback
from sonoff-tasmota.
I changed the timing and now also a disconnected sensor should not cause a headache.
from sonoff-tasmota.
Changed CODE to main project because SR04 now supported in original project
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.