aminsadati1374
Posts: 2
Joined: Sun Jan 19, 2020 4:44 pm

When I run source code the sensor Max30100, I get an error remote i/o error

Sun Apr 26, 2020 3:12 pm

I want to connect the sensor max30100 to the Raspberry Pi board.I think everything is accurate.When I run the code, the red light flashes.I activated I2C.max30100 device address 0x57 is detected.
When I put my hand on the sensor, I get the following error.

Error:

Code: Select all

    max30100 got exception [errno 121] remote i/o error

I use the source code below.

Code: Select all

    import os
    import sys
    import time
    import max30100
    
    def main():
    	try:
    		mx30 = max30100.MAX30100()
    		mx30.set_mode(max30100.MODE_SPO2)
    		# mx30.reset()
    		# time.sleep(1)
    		# mx30.startup()
    		# time.sleep(1)
    
    		i = 0
    		while i < 30:
    			mx30.set_mode(max30100.MODE_HR)
    			mx30.read_sensor()
    			# # The latest values are now available via .ir and .red
    			# print("HeartRate sensor .ir: {} and .red: {}".format(mx30.ir, mx30.red))
    
    			# time.sleep(2)
    			mx30 = max30100.MAX30100()
    			mx30.reinit()
    			mx30.set_mode(max30100.MODE_SPO2)
    			# time.sleep(1)
    			mx30.read_sensor()
    			# The latest values are now available via .ir and .red
    			print("HRate sensor .ir: {} and SpO2 .red: {}".format(mx30.ir, mx30.red))
    
    			# temp = mx30.get_temperature()
    			# print("Temperature {}\n".format(temp))
    			mx30.reset()
    			time.sleep(1)
    
    			i = i + 1
    		mx30.reset()
    		# mx30.shutdown()
    
    	except Exception as e:
    		print("Max30100 got exception {}".format(e))
    
    if __name__ == "__main__":
      main()
https://github.com/whilemind/MAX30100u



connection PINS GPIO and sensor max30100

(3.3V -VIN)
(I2C SDA1 - SDA)
(I2C SCL1 - SCL)
(PIN7 - INT )
(GND - GND)

Can anyone help me to fix this issue?
Last edited by aminsadati1374 on Sun Apr 26, 2020 7:01 pm, edited 1 time in total.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: When I run source code the sensor Max30100, I get an error remote i/o error

Sun Apr 26, 2020 6:34 pm

Edit your post and put the code in [code ] tags.
Then post the *full* error message, also in code tags

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13095
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: When I run source code the sensor Max30100, I get an error remote i/o error

Sun Apr 26, 2020 7:52 pm

added code tags to first post.

Return to “Python”