stefanbode / Sonoff-Tasmota

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE, enhanced with I2C options
GNU General Public License v3.0
126 stars 40 forks source link

HC-SR04 feedback #17

Closed boverby closed 6 years ago

boverby commented 6 years ago

Thank you for adding support for HC-SR04.

I have used it this morning on a christmas tree water level sensor. The only change I needed to make was upping the MAX_DEVIATION_BETWEEN_MEASURES from 0.1 to 75.00. The original value left me wondering if the sensor was fried, but enabling the "HS-SR04 In Duration:" debug showed that it was indeed changing with new depths. The 0.1 value for MAX_DEVIATION_BETWEEN_MEASURES was acting as an intended damping factor , but was so slow that I got confused. I know that the sensor is "noisy" so I was thinking about taking the 10 samples and getting the median value instead.

No changes requested, just feedback that might help another user.
Thanks again

stefanbode commented 6 years ago

Hi @boverby,

yes the noise is quite a pain with the SR04. I already do some compensation in the code. I found out that better than the median/average is to work on the maximum. To don't wast much time I just do 10 loops each measurement. Anyhow also this method does not create good sensor out of a bad one. Therefore introduced the damping factor. this is the maximum change between two measurements between to probes.

junk-barkass commented 6 years ago

Hi. I'm trying to use your code with a regular son off basic. no need for deep sleep how do i disable it? I just need it to talk to my SR04. I red the above and maybe this link will help you to get better reading for the SR04. https://www.youtube.com/watch?v=6F1B_N6LuKw Best Regards Magnus

stefanbode commented 6 years ago

Thanks Magnus, I will give it a try. Maybe it is because of the 3.7V power and startup from Deepsleep that produce the headache. If you do not set deepsleep it should be 0 BY DEFAULT , that means OFF.

junk-barkass commented 6 years ago

Thanks for quick reply. I'm not a programmer myself but i think it was a very good video. I ran your code on nodemcu and it worked fine no deepsleep. But on Sonoff it deepsleep even if it's 0. My problem is not the SR04 sensor yet...

stefanbode commented 6 years ago

Really strange. I’m on holiday. Therefore a bit difficult to test. There should be no difference. Anyhow. What deepsleep ist reporter in the STATUS Message? You can easily override by sending a deepsleep 0. I also have several sonoff without active deepsleep running fine.

junk-barkass commented 6 years ago

Hello. Enjoy your holiday!

I’ve set deep sleep to 0 but it seems not to listen to it. Yes it’s very strange indeed. When are you back home? We can talk more then. Or just send me an email. We can discuss more then. //Magnus

28 dec. 2017 kl. 00:10 skrev stefanbode notifications@github.com:

Really strange. I’m on holiday. Therefore a bit difficult to test. There should be no difference. Anyhow. What deepsleep ist reporter in the STATUS Message? You can easily override by sending a deepsleep 0. I also have several sonoff without active deepsleep running fine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbode/Sonoff-Tasmota/issues/17#issuecomment-354193699, or mute the thread https://github.com/notifications/unsubscribe-auth/AZfTXHBqoO8GuzsmWFW-1hf_yBqt-Shkks5tEs5VgaJpZM4Q8mD5.

stefanbode commented 6 years ago

Can you send the log messages during startup? Seriallog 4 should be sufficient. If it uses deepsleep you should see the corresponding messages here.

junk-barkass commented 6 years ago

Hello. It writes as you can see deep sleep 0, but it is so sleepy... and after a while it restart by itself.

21:20:46 APP: Restarting

ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v09826c6d ~ld � 00:00:00 APP: Boot Count 72 00:00:00 HS-SR04: Device configured: Trig: 14 Echo: 4 00:00:00 Project sonoff Belysning vid spisen (Topic 8, Fallback 8, GroupTopic 8) Version 5.10.0b 00:00:00 CFG: Saved to flash at F8, Count 93, Bytes 1676 00:00:00 WIF: Checking connection... 00:00:00 WIF: Attempting connection... 00:00:00 WIF: Patch issue 2186 00:00:00 WIF: Connecting to AP1 lj3m in mode 11N as s8.larssons.us.to... 00:00:01 WIF: Checking connection... 00:00:01 WIF: Attempting connection... 00:00:02 WIF: Checking connection... 00:00:02 WIF: Attempting connection... 00:00:03 WIF: Checking connection... 00:00:03 WIF: Attempting connection... 00:00:04 WIF: Checking connection... 00:00:04 WIF: Connected 00:00:04 HTP: Web server active on s8.larssons.us.to with IP address 192.168.200.208 00:00:05 MQT: Attempting connection... 00:00:05 MQT: Connected 00:00:05 MQT: tele/8/LWT = Online (retained) 00:00:05 MQT: cmnd/8/POWER = 00:00:05 MQT: Subscribe to cmnd/8/# 00:00:05 MQT: Subscribe to cmnd/8/# 00:00:05 MQT: Subscribe to cmnd/8/# 00:00:05 MQT: tele/8/INFO1 = {"Module":"Sonoff Basic","Version":"5.10.0b","FallbackTopic":"8","GroupTopic":"8"} 00:00:05 MQT: tele/8/INFO2 = {"WebServerMode":"Admin","Hostname":"s8.larssons.us.to","IPAddress":"192.168.200.208"} 00:00:05 MQT: tele/8/INFO3 = {"RestartReason":"Software/System restart"} 00:00:06 MQT: knapp/8/RESULT = {"POWER":"OFF"} 00:00:06 MQT: knapp/8/POWER = OFF 00:00:12 HS-SR04: Device configured: Trig: 14 Echo: 4 00:00:13 MQT: tele/8/STATE = {"Time":"1970-01-01T00:00:13","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":74, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":29144} 00:00:13 HS-SR04: Start measurement: Trig: 14 Echo: 4 00:00:16 APP: (UTC) Thu Dec 28 20:21:03 2017 00:00:16 APP: (DST) Sun Mar 26 02:00:00 2017 00:00:16 APP: (STD) Sun Oct 29 03:00:00 2017 21:21:20 HS-SR04: Avg Distance measured: 0.00 21:21:20 HS-SR04: New Distance: 0.00 21:21:20 MQT: tele/8/SENSOR = {"Time":"1970-01-01T00:00:13","Distance":} 21:21:21 MQT: tele/8/STATE = {"Time":"2017-12-28T21:21:21","Uptime":0,"Vcc":3.109,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":74, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28752} 21:21:21 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:21:41 HS-SR04: Avg Distance measured: 0.00 21:21:41 HS-SR04: New Distance: 0.00 21:21:41 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:21:21","Distance":} 21:21:50 HS-SR04: Device configured: Trig: 14 Echo: 4 21:21:52 MQT: tele/8/STATE = {"Time":"2017-12-28T21:21:51","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":66, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28472} 21:21:52 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:22:12 HS-SR04: Avg Distance measured: 0.00 21:22:12 HS-SR04: New Distance: 0.00 21:22:12 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:21:52","Distance":} 21:22:12 WIF: Checking connection... 21:22:12 WIF: Connected 21:22:21 HS-SR04: Device configured: Trig: 14 Echo: 4 21:22:22 MQT: tele/8/STATE = {"Time":"2017-12-28T21:22:22","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":64, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28384} 21:22:22 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:22:42 HS-SR04: Avg Distance measured: 0.00 21:22:42 HS-SR04: New Distance: 0.00 21:22:42 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:22:22","Distance":} 21:22:51 HS-SR04: Device configured: Trig: 14 Echo: 4 21:22:52 MQT: tele/8/STATE = {"Time":"2017-12-28T21:22:52","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":64, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28336} 21:22:52 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:23:12 HS-SR04: Avg Distance measured: 0.00 21:23:12 HS-SR04: New Distance: 0.00 21:23:12 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:22:52","Distance":} 21:23:12 WIF: Checking connection... 21:23:12 WIF: Connected 21:23:21 HS-SR04: Device configured: Trig: 14 Echo: 4 21:23:22 MQT: tele/8/STATE = {"Time":"2017-12-28T21:23:22","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":66, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28176} 21:23:22 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:23:42 HS-SR04: Avg Distance measured: 0.00 21:23:42 HS-SR04: New Distance: 0.00 21:23:42 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:23:22","Distance":} 21:23:51 HS-SR04: Device configured: Trig: 14 Echo: 4 21:23:52 MQT: tele/8/STATE = {"Time":"2017-12-28T21:23:52","Uptime":0,"Vcc":3.106,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":64, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28048} 21:23:52 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:24:12 HS-SR04: Avg Distance measured: 0.00 21:24:12 HS-SR04: New Distance: 0.00 21:24:12 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:23:52","Distance":} 21:24:13 WIF: Checking connection... 21:24:13 WIF: Connected 21:24:21 HS-SR04: Device configured: Trig: 14 Echo: 4 21:24:22 MQT: tele/8/STATE = {"Time":"2017-12-28T21:24:22","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":58, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":27872} 21:24:22 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:24:42 HS-SR04: Avg Distance measured: 0.00 21:24:42 HS-SR04: New Distance: 0.00 21:24:42 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:24:22","Distance":} 21:24:51 HS-SR04: Device configured: Trig: 14 Echo: 4 21:24:52 MQT: tele/8/STATE = {"Time":"2017-12-28T21:24:52","Uptime":0,"Vcc":3.108,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":66, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":27744} 21:24:52 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:25:12 HS-SR04: Avg Distance measured: 0.00 21:25:12 HS-SR04: New Distance: 0.00 21:25:12 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:24:52","Distance":} 21:25:12 HTP: Command 21:25:12 RSL: Received Topic /Restart, Data Size 1, Data 1 21:25:12 RSL: Group 0, Index 1, Command RESTART, Data 1 21:25:12 MQT: knapp/8/RESULT = {"Restart":"Restarting"} 21:25:13 WIF: Checking connection... 21:25:13 WIF: Connected 21:25:14 APP: Restarting

ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v09826c6d ~ld � 00:00:00 APP: Boot Count 73 00:00:00 HS-SR04: Device configured: Trig: 14 Echo: 4 00:00:00 Project sonoff Belysning vid spisen (Topic 8, Fallback 8, GroupTopic 8) Version 5.10.0b 00:00:00 CFG: Saved to flash at F7, Count 94, Bytes 1676 00:00:00 WIF: Checking connection... 00:00:00 WIF: Attempting connection... 00:00:00 WIF: Patch issue 2186 00:00:00 WIF: Connecting to AP1 lj3m in mode 11N as s8.larssons.us.to... 00:00:01 WIF: Checking connection... 00:00:01 WIF: Attempting connection... 00:00:02 WIF: Checking connection... 00:00:02 WIF: Attempting connection... 00:00:03 MQT: Attempting connection... 00:00:03 MQT: Connected 00:00:03 MQT: tele/8/LWT = Online (retained) 00:00:03 MQT: cmnd/8/POWER = 00:00:03 MQT: Subscribe to cmnd/8/# 00:00:03 MQT: Subscribe to cmnd/8/# 00:00:03 MQT: Subscribe to cmnd/8/# 00:00:03 MQT: tele/8/INFO1 = {"Module":"Sonoff Basic","Version":"5.10.0b","FallbackTopic":"8","GroupTopic":"8"} 00:00:03 MQT: tele/8/INFO2 = {"WebServerMode":"Admin","Hostname":"s8.larssons.us.to","IPAddress":"192.168.200.208"} 00:00:03 MQT: tele/8/INFO3 = {"RestartReason":"Software/System restart"} 00:00:04 WIF: Checking connection... 00:00:04 WIF: Connected 00:00:04 HTP: Web server active on s8.larssons.us.to with IP address 192.168.200.208 00:00:04 MQT: knapp/8/RESULT = {"POWER":"OFF"} 00:00:04 MQT: knapp/8/POWER = OFF 00:00:10 HS-SR04: Device configured: Trig: 14 Echo: 4 00:00:11 MQT: tele/8/STATE = {"Time":"1970-01-01T00:00:11","Uptime":0,"Vcc":3.074,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":72, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28984} 00:00:11 HS-SR04: Start measurement: Trig: 14 Echo: 4 00:00:15 APP: (UTC) Thu Dec 28 20:25:30 2017 00:00:15 APP: (DST) Sun Mar 26 02:00:00 2017 00:00:15 APP: (STD) Sun Oct 29 03:00:00 2017 21:25:46 HS-SR04: Avg Distance measured: 0.00 21:25:46 HS-SR04: New Distance: 0.00 21:25:46 MQT: tele/8/SENSOR = {"Time":"1970-01-01T00:00:11","Distance":} 21:25:47 MQT: tele/8/STATE = {"Time":"2017-12-28T21:25:47","Uptime":0,"Vcc":3.104,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":68, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28720} 21:25:47 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:26:07 HS-SR04: Avg Distance measured: 0.00 21:26:07 HS-SR04: New Distance: 0.00 21:26:07 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:25:47","Distance":} 21:26:16 HS-SR04: Device configured: Trig: 14 Echo: 4 21:26:17 MQT: tele/8/STATE = {"Time":"2017-12-28T21:26:17","Uptime":0,"Vcc":3.109,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":68, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28528} 21:26:17 HS-SR04: Start measurement: Trig: 14 Echo: 4 21:26:37 HS-SR04: Avg Distance measured: 0.00 21:26:37 HS-SR04: New Distance: 0.00 21:26:37 MQT: tele/8/SENSOR = {"Time":"2017-12-28T21:26:17","Distance":} 21:26:39 WIF: Checking connection... 21:26:39 WIF: Connected 21:26:46 HS-SR04: Device configured: Trig: 14 Echo: 4 21:26:47 MQT: tele/8/STATE = {"Time":"2017-12-28T21:26:47","Uptime":0,"Vcc":3.109,"POWER":"OFF", "Wifi":{"AP":1, "SSId":"lj3m", "RSSI":72, "APMac":"10:7B:44:CC:B7:C8"}, "DeepSleep":0, "Heap":28384} 21:26:47 HS-SR04: Start measurement: Trig: 14 Echo: 4

My ping is like this...

64 bytes from 192.168.200.208: icmp_seq=927 ttl=128 time=700.564 ms Request timeout for icmp_seq 928 64 bytes from 192.168.200.208: icmp_seq=929 ttl=128 time=699.003 ms Request timeout for icmp_seq 930 64 bytes from 192.168.200.208: icmp_seq=931 ttl=128 time=697.650 ms Request timeout for icmp_seq 932 Request timeout for icmp_seq 933 Request timeout for icmp_seq 934 Request timeout for icmp_seq 935 Request timeout for icmp_seq 936 Request timeout for icmp_seq 937 Request timeout for icmp_seq 938 Request timeout for icmp_seq 939 Request timeout for icmp_seq 940 64 bytes from 192.168.200.208: icmp_seq=938 ttl=128 time=3693.327 ms Request timeout for icmp_seq 942 64 bytes from 192.168.200.208: icmp_seq=943 ttl=128 time=685.000 ms Request timeout for icmp_seq 944 64 bytes from 192.168.200.208: icmp_seq=945 ttl=128 time=714.717 ms 64 bytes from 192.168.200.208: icmp_seq=946 ttl=128 time=711.767 ms 64 bytes from 192.168.200.208: icmp_seq=947 ttl=128 time=718.168 ms 64 bytes from 192.168.200.208: icmp_seq=948 ttl=128 time=717.876 ms 64 bytes from 192.168.200.208: icmp_seq=949 ttl=128 time=714.138 ms Request timeout for icmp_seq 950 Request timeout for icmp_seq 951 Request timeout for icmp_seq 952 64 bytes from 192.168.200.208: icmp_seq=952 ttl=128 time=1712.311 ms Request timeout for icmp_seq 954 64 bytes from 192.168.200.208: icmp_seq=955 ttl=128 time=713.365 ms 64 bytes from 192.168.200.208: icmp_seq=956 ttl=128 time=708.622 ms Request timeout for icmp_seq 957 64 bytes from 192.168.200.208: icmp_seq=958 ttl=128 time=712.570 ms 64 bytes from 192.168.200.208: icmp_seq=959 ttl=128 time=713.835 ms 64 bytes from 192.168.200.208: icmp_seq=960 ttl=128 time=712.101 ms Request timeout for icmp_seq 961 64 bytes from 192.168.200.208: icmp_seq=962 ttl=128 time=715.999 ms 64 bytes from 192.168.200.208: icmp_seq=963 ttl=128 time=715.304 ms Request timeout for icmp_seq 964 Request timeout for icmp_seq 965 Request timeout for icmp_seq 966 Request timeout for icmp_seq 967 Request timeout for icmp_seq 968 Request timeout for icmp_seq 969 Request timeout for icmp_seq 970 Request timeout for icmp_seq 971 Request timeout for icmp_seq 972 64 bytes from 192.168.200.208: icmp_seq=973 ttl=128 time=215.139 ms

stefanbode commented 6 years ago

This has nothing to do with deepsleep. This is just the normal behavior after getting a restart command. But I assume you did not type it in. It just appear. Do you have a saved command in your mqtt server? One idea. I can say for sure that from somewhere there is. ‚Restart 1‘ coming.

stefanbode commented 6 years ago

Have you switched your trigger an echo pin? I just see the timeout and a measure of 0. this only happens if not connected or wires are wrong

junk-barkass commented 6 years ago

Hi. Oh.. Yes you are so right. My server checks connection with all my son off devices and if it’s not responding to a ping then it will send restart. So YES you are so right on.

Bu why isn’t it responding to ping as all the other? check the ping time very long time for roundtrip.

//Magnus

29 dec. 2017 kl. 01:11 skrev stefanbode notifications@github.com:

Have you switched your trigger an echo pin? I just see the timeout and a measure of 0. this only happens if not connected or wires are wrong

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbode/Sonoff-Tasmota/issues/17#issuecomment-354378134, or mute the thread https://github.com/notifications/unsubscribe-auth/AZfTXN77rdlz1Fkkl8mwGeKyxbwC1Kxpks5tFC46gaJpZM4Q8mD5.

junk-barkass commented 6 years ago

At the moment when the logg was taken the sensor were disconnected.

29 dec. 2017 kl. 01:11 skrev stefanbode notifications@github.com:

Have you switched your trigger an echo pin? I just see the timeout and a measure of 0. this only happens if not connected or wires are wrong

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbode/Sonoff-Tasmota/issues/17#issuecomment-354378134, or mute the thread https://github.com/notifications/unsubscribe-auth/AZfTXN77rdlz1Fkkl8mwGeKyxbwC1Kxpks5tFC46gaJpZM4Q8mD5.

junk-barkass commented 6 years ago

Is it possible that if no sensor/something not correct will take all time from 8266 and therefore not responding to all my ping:s?

29 dec. 2017 kl. 01:11 skrev stefanbode notifications@github.com:

Have you switched your trigger an echo pin? I just see the timeout and a measure of 0. this only happens if not connected or wires are wrong

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbode/Sonoff-Tasmota/issues/17#issuecomment-354378134, or mute the thread https://github.com/notifications/unsubscribe-auth/AZfTXN77rdlz1Fkkl8mwGeKyxbwC1Kxpks5tFC46gaJpZM4Q8mD5.

stefanbode commented 6 years ago

Yes right. If the sensor does not answer, it freezes the ESP for other things. I can reduce the issue a bit , but not general avoid. As soon as there is a device connected everything should be fine.

junk-barkass commented 6 years ago

Aha!!! That’s a fully answer to my problem. Then I know that and can focus on the sensor communication. Thank’s a lot. //Magnus

29 dec. 2017 kl. 11:59 skrev stefanbode notifications@github.com:

Yes right. If the sensor does not answer, it freezes the ESP for other things. I can reduce the issue a bit , but not general avoid. As soon as there is a device connected everything should be fine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbode/Sonoff-Tasmota/issues/17#issuecomment-354431372, or mute the thread https://github.com/notifications/unsubscribe-auth/AZfTXKZi_IapUFI7YQnHCluwSyqX23w5ks5tFMYUgaJpZM4Q8mD5.

junk-barkass commented 6 years ago

To minimize the code which one is needed for my sonoff basic and the SR-04 sensor? There is a lot.. //#define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k3 code)

                                             // WARNING: Select none for default one DS18B20 sensor or enable one of the following two options for multiple sensors

//#define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code) //#define USE_DS18x20_LEGACY // Optional for more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)

//#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram) // #define USE_SHT // Add I2C emulating code for SHT1X sensor (+1k4 code) // #define USE_SHT3X // Add I2C code for SHT3x sensor based on Adafruit (+0k7 code) // #define USE_SHT3X_V2 // Add I2C code for SHT3x sensor based on EspEasy (+0k7 code) // #define USE_SHT3X_V3 // Add I2C code for SHT3x sensor based on Wemos (+0k7 code) // #define USE_HTU // Add I2C code for HTU21/SI7013/SI7020/SI7021 sensor (+1k5 code) // #define USE_BMP // Add I2C code for BMP085/BMP180/BMP280/BME280 sensor (+4k code) // #define USE_BME680 // Add additional support for BME680 sensor using Adafruit Sensor and BME680 libraries (+6k code) // #define USE_BH1750 // Add I2C code for BH1750 sensor (+0k5 code) // #define USE_VEML6070 // Add I2C code for VEML6070 sensor (+0k5 code) // #define USE_TSL2561 // Add I2C code for TSL2561 sensor using library Adafruit TSL2561 Arduino (+1k2 code) // #define USE_ADS1115 // Add I2C code for ADS1115 16 bit A/D converter based on Adafruit ADS1x15 library (no library needed) (+0k7 code) // #define USE_ADS1115_I2CDEV // Add I2C code for ADS1115 16 bit A/D converter using library i2cdevlib-Core and i2cdevlib-ADS1115 (+2k code) // #define USE_INA219 // Add I2C code for INA219 Low voltage and current sensor (+1k code)

//STB mod //#define USE_CHIRP // Add I2C support for CHIRP moisture sensor //#define USE_PCF8574 // Add I2C support for PCF8574 multi GPIO board //end

//#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram) // #define USE_IR_HVAC // Support for HVAC system using IR (+2k code) //#define USE_IR_RECEIVE // Support for IR receiver (+5k5 code, 264 iram)

//#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by // //#define USE_WS2812_CTYPE 1 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW) // #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow

//#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+1k8 code) //#define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code)

//Magnus

stefanbode commented 6 years ago

Added check and support, if SR04 is not connected to avoid the freeze. Will be updated with 5.11 version

junk-barkass commented 6 years ago

Great!!!

15 jan. 2018 kl. 19:34 skrev stefanbode notifications@github.com:

Added check and support, if SR04 is not connected to avoid the freeze. Will be updated with 5.11 version

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbode/Sonoff-Tasmota/issues/17#issuecomment-357759134, or mute the thread https://github.com/notifications/unsubscribe-auth/AZfTXBIzOjCapLQ3A4bXZW3XLajHcYPOks5tK5oygaJpZM4Q8mD5.

stefanbode commented 6 years ago

The sr04 reading is now quite stable and values fit most of the time. No more changes planned for the distance sensor.