MAX30102 sensor SEN0344 i cannot read data through UART on raspberry pi

Following the information available on the page https://wiki.dfrobot.com/Heart_Rate_and_Oximeter_Sensor_V2_SKU_SEN0344
i have download the program in my raspberry pi device and connected the sensor to the UART port which is at dev/ttyS0
all the connections are correct using the library available at https://github.com/DFRobot/DFRobot_BloodOxygen_S/tree/master/python/raspberry
made all the required changes still showing error
Traceback (most recent call last):
File "/home/pi/Desktop/dfrobot_max30102/max30102_test.py", line 50, in <module>
setup()
File "/home/pi/Desktop/dfrobot_max30102/max30102_test.py", line 36, in setup
while (False == max30102.begin()):
File "/home/pi/Desktop/dfrobot_max30102/DFRobot_BloodOxygen_S.py", line 64, in begin
rbuf = self.read_reg(0x04,2)
File "/home/pi/Desktop/dfrobot_max30102/DFRobot_BloodOxygen_S.py", line 205, in read_reg
return self.read_holding_registers(0x20,int(math.ceil(reg_addr/2)),int(math.ceil(length/2)))[1:]
File "/home/pi/Desktop/dfrobot_max30102/DFRobot_RTU.py", line 264, in read_holding_registers
self._send_package(l)
File "/home/pi/Desktop/dfrobot_max30102/DFRobot_RTU.py", line 385, in _send_package
self._clear_recv_buffer()
File "/home/pi/Desktop/dfrobot_max30102/DFRobot_RTU.py", line 361, in _clear_recv_buffer
remain = self._ser.inWaiting()
File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 590, in inWaiting
return self.in_waiting
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 467, in in_waiting
s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
OSError: [Errno 25] Inappropriate ioctl for device
please help me solving the issue