Page 1 of 1

wemos D1 R2 + two HC-SR04

Posted: 17 Jun 2019, 18:18
by sator86
Hello,
I'm trying to make working a demos with ESPEasy-mega (the latest)
I tried to install who HC-SR04, however, only one works at time
as you can see at the enclosed pictures, I tried other GPIO, same issue, one at time
any one can help please ?
thank you

the FIRST
Capture d’écran 2019-06-17 à 18.15.52.png
Capture d’écran 2019-06-17 à 18.15.52.png (234.75 KiB) Viewed 18802 times
the SECOND
Capture d’écran 2019-06-17 à 18.16.13.png
Capture d’écran 2019-06-17 à 18.16.13.png (244.7 KiB) Viewed 18802 times
THE RESULT:
Capture d’écran 2019-06-17 à 18.19.28.png
Capture d’écran 2019-06-17 à 18.19.28.png (199.37 KiB) Viewed 18801 times

Re: wemos D1 R2 + two HC-SR04

Posted: 17 Jun 2019, 19:43
by waspie
This was supposedly fixed a long time ago but it never really was. I've attached a copy of the sketch from last year that i slightly modified to work with whatever big architecture change they made around april of 2018 i think ( i don't remember).

Anyway, replace the sketch with the same name with the file i've attached and recompile and it'll work fine.
http://h8rs.com:5000/sharing/HiiGlHIpY

Re: wemos D1 R2 + two HC-SR04

Posted: 18 Jun 2019, 08:00
by sator86
ah ok,
thank you,
I'll try to compile tonight, I'll let you know
thank's again

Re: wemos D1 R2 + two HC-SR04

Posted: 20 Jun 2019, 21:24
by sator86
hello,
I tried to compil it with ATOM
but I still have the same issue, only one is working ..
I don't know if it's correct
Capture.PNG
Capture.PNG (11.43 KiB) Viewed 18676 times
or if you have already a compiled version ?
thank you

Re: wemos D1 R2 + two HC-SR04

Posted: 20 Jun 2019, 21:43
by waspie
sator86 wrote: 20 Jun 2019, 21:24 hello,
I tried to compil it with ATOM
but I still have the same issue, only one is working ..
I don't know if it's correct
Capture.PNG
or if you have already a compiled version ?
thank you
http://h8rs.com:5000/sharing/9pbu3JjWL
This is built on 2.6 SDK3 for a 4m version with ONLY switch, dallas, mcp, hcsr04, tsl2561, and dummy plugins.

Test that to make sure your setup is working. I use this firmware and know it to be working.

Re: wemos D1 R2 + two HC-SR04

Posted: 22 Jun 2019, 01:07
by sator86
hello,
I think I'm doing somethig wrong
I still have the same issue with your firmware
sometime one detector stay at 0, and sometimes the same freez at a different value like (high value) which not corresponding to a measure :roll:

Re: wemos D1 R2 + two HC-SR04

Posted: 23 Jun 2019, 03:27
by waspie
Not all gpio ports seem to work right.
Are you making sure you use a voltage divider?

Re: wemos D1 R2 + two HC-SR04

Posted: 23 Jun 2019, 18:21
by sator86
hello,
I think this is my problem
I have read that hc-SR04 works on 5v, so I connect each one on +5v and gnd on the board
do you have a enample how must they to be connected ?
thank you

Re: wemos D1 R2 + two HC-SR04

Posted: 23 Jun 2019, 19:26
by Shardan
sator86 wrote: 23 Jun 2019, 18:21 hello,
I think this is my problem
I have read that hc-SR04 works on 5v, so I connect each one on +5v and gnd on the board
do you have a enample how must they to be connected ?
thank you
Hello,

take a look here: https://letscontrolit.com/wiki/index.ph ... _Converter

If you scroll down a bit you'll find a schematic for HC-SR04 and Wemos.

Re: wemos D1 R2 + two HC-SR04

Posted: 24 Jun 2019, 18:38
by sator86
thank you for your help Shardan
I don't have diode to test it, I'll let you know,
thank you again for your assistance ;)