Hi Zbyněk, thanks a lot for testing and sharing your results with us. > I do not know how to do this in the development of drivers, whether it makes > sense to put a filter directly into the driver or at least pull the maximum > distance parameter as a variable? In this case one should read several times, remove spikes and calculate the average. This sounds to me as task for the userspace not for the driver. Regards, Andreas Zbyněk Kocur <zbynek.kocur@xxxxxxxxxxx> schrieb am Mo, 09. Sep 08:53: > Hi Andreas, > > I'm so sorry for the delay. I was working on another project now, and I wasn't entirely devoted to this. I looked at it at the weekend and the modified code is working. I have only tested OpenWRT in build - r10204-38b22b1, kernel 4.14.125. I do not expect complications on other platforms. > > I tried it on several sensors. I was primarily interested in JSN-SR04T (https://www.makerguides.com/jsn-sr04t-arduino-tutorial/). I have also verified other designs (https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/). > > It generally works. Relatively accurate for the area up to 2.5 m. However, if the distance is longer, it starts to fizz, depending on the sensor design. It is a property of used HW and its construction. > > I do not know how to do this in the development of drivers, whether it makes sense to put a filter directly into the driver or at least pull the maximum distance parameter as a variable? > > Anyway, the change made works. > > Zbynek > --- > email: zbynek.kocur@xxxxxxxxxxx > phone: +420 224 354 054 > web: http://www.fel.cvut.cz > Department of Telecommunications Engineering > Faculty of Electrical Engineering > > > On 7 Sep 2019, at 11:46, Andreas Klinger <ak@xxxxxxxxxxxxx> wrote: > > > > Hi Zbynek, > > > > do you have any feedback for us? > > > > Thank you, > > > > Andreas > > > > > > Zbyněk Kocur <zbynek.kocur@xxxxxxxxxxx> schrieb am Mi, 26. Jun 21:50: > >> Thank you, i will write a feedback after testing. > >> > >> > >> Zbynek > >> --- > >> email: zbynek.kocur@xxxxxxxxxxx > >> phone: +420 224 354 054 > >> web: http://www.fel.cvut.cz > >> Department of Telecommunications Engineering > >> Faculty of Electrical Engineering > >> > >>> On 26 Jun 2019, at 21:49, Jonathan Cameron <jic23@xxxxxxxxxx> wrote: > >>> > >>> No rush, it's a clear fix anyway so we can queue this up > >>> in the rc phase of the next kernel cycle! > >> > > > > -- > > Andreas Klinger > > Grabenreith 27 > > 84508 Burgkirchen > > +49 8623 919966 > > ak@xxxxxxxxxxxxx > > www.it-klinger.de > > www.grabenreith.de > -- Andreas Klinger Grabenreith 27 84508 Burgkirchen +49 8623 919966 ak@xxxxxxxxxxxxx www.it-klinger.de www.grabenreith.de