The Problem to Connect A02YYUW Rasbperry Pi

userHead umutcankalkan 2019-12-31 20:23:33 5996 Views4 Replies
I just buy this ultrasonic sensor but sample python code does not work with rasbperry pi 4.
Model of sensor : A02YYUW
DataSheet : ... asheet.pdf
Errors : Traceback (most recent call last):
File "/home/pi/Desktop/DFRobot_RaspberryPi_A02YYUW-master/raspberry/", line 44, in <module>
distance = board.getDistance()
File "/home/pi/Desktop/DFRobot_RaspberryPi_A02YYUW-master/raspberry/", line 73, in getDistance
File "/home/pi/Desktop/DFRobot_RaspberryPi_A02YYUW-master/raspberry/", line 41, in measure
while self.ser.inWaiting() == 0:
File "/usr/lib/python3/dist-packages/serial/", line 590, in inWaiting
return self.in_waiting
File "/usr/lib/python3/dist-packages/serial/", line 467, in in_waiting
s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
OSError: [Errno 25] Inappropriate ioctl for device
2020-08-07 05:25:28 In order to fix this, try using sudo raspi-config, go to Interfacing Options, then Serial, then select No for the login shell and Yes for the serial port hardware to be enabled. Afterwards, reboot. Then adjust the serial port path in , changing it from /dev/ttyAMA0 to either /dev/serial0 or /dev/serial1. (For the Raspberry Pi Zero W, it was /dev/serial1). userHeadPic patxu
2020-02-25 14:38:01 Hi, i got the same problem as described above, but I don't understand the solution. Can you elaborate? userHeadPic hitman164
2020-01-01 16:05:19 I figure out the problem change file name AMA0 to S0 its start to work. userHeadPic umutcankalkan