linux-hc-sro4 icon indicating copy to clipboard operation
linux-hc-sro4 copied to clipboard

Invalid argument

Open Lonewoelf opened this issue 4 years ago • 2 comments

Dear johannesthoma,

First of all thanks for this really well writen driver. It was up and running on my Beagle Bone Black, really easily. But whenever I actually try to read a value from the connected HC-SR04 it seems to return Invalid Argument. Which situations could cause this measurement result?

Lonewoelf avatar Jun 24 '20 11:06 Lonewoelf

Hi Lonewoelf,

Thank you for your message. Do you think you configured the device correctly (see README.md a little bit further down). It is very important to get the GPIO numbers right, please double check that first.

Other than that, there is a HC-SR04 driver in mainline Linux meanwhile (not my driver unfortunately). It is called srf04.c and is located in drivers/iio/proximity in the kernel source tree. I never tried that driver (I don't have the hardware any more) but from reading the source I can understand that it should be HC-SR04 compatible. Can you please check with your hardware if this driver is working with the HC-SR04? I then can put a note in the README.md.

Thanks a lot,

  • Johannes

johannesthoma avatar Jun 24 '20 15:06 johannesthoma

Hello johannes,

Thanks for the quick reply!

I am sure that I configured the right pins, but I was wondering if the driver might be incompatible with a beaglebone black (running debian)? I was indeed able to find and compile srf04.c but I have no clue how to configure or actually use it, since it does not show up in /sys/class/. I'm pretty new to linux drivers so any help would be appreciated.

Thanks in advance,

Lonewoelf

Lonewoelf avatar Jun 24 '20 16:06 Lonewoelf