max30102 icon indicating copy to clipboard operation
max30102 copied to clipboard

Error when running the script

Open ixforcesxi opened this issue 4 years ago • 6 comments

Hi, I have this error when running the script, what is caused by ?

the sensor turned on, however no output

asdf

https://imgur.com/a/xSIN3Y1

ixforcesxi avatar Jan 31 '21 08:01 ixforcesxi

The error is occurring during an I2C write, have you got I2C enabled on your Rasberry Pi? And secondly have you got the Raspberry Pi Python libraries installed for I2C?

doug-burrell avatar Feb 01 '21 13:02 doug-burrell

Hi, i fix my problem however, i have another problem: I will explain:

I'm using adafruit.io to display information from this sensor, I have modified your code such that in the self.print_result: is the following. if self.print_result: print("BPM: {0}, SpO2: {1}".format(self.bpm, spo2)) heartratefeed= aio.feeds('heart-rate') spo2feed=aio.feeds('spo2') aio.send_data(heartratefeed.key, self.bpm) aio.send_data(spo2feed.key, spo2)

However, adding this code for the aio makes the program run once, and then stop. (It will take one reading, then turn off the sensor.) Do you have knowledge why this behaviour is happening? How I can fix it? is there a way to extract the information from the main.py program?

Sorry to bother you .

ixforcesxi avatar Mar 01 '21 17:03 ixforcesxi

The error is occurring during an I2C write, have you got I2C enabled on your Rasberry Pi? And secondly have you got the Raspberry Pi Python libraries installed for I2C?

Hey Doug!

Thank you for the code!

I also receive the same error.

I have enabled I2C and I have also installed all libraries.

I also think that my wiring is okay: VIN -> pin 4 SDA -> pin 3 SCL -> pin 5 GND -> pin 6

What do you think the problem could be?

abenko avatar Mar 20 '21 20:03 abenko

The error is occurring during an I2C write, have you got I2C enabled on your Rasberry Pi? And secondly have you got the Raspberry Pi Python libraries installed for I2C?

Hey Doug!

Thank you for the code!

I also receive the same error.

I have enabled I2C and I have also installed all libraries.

I also think that my wiring is okay: VIN -> pin 4 SDA -> pin 3 SCL -> pin 5 GND -> pin 6

What do you think the problem could be?

Hi, have you rebooted your Pi since you enabled I2C? That is a necessary step when enabling I2C on a Pi. Also if that doesn't solve it then I'd suggest installing i2ctools, it's a Linux tool for debugging I2C communications. There is an option to scan all slaves on the bus, I would suggest trying that to see if it sees your heartrate monitor.

doug-burrell avatar Mar 22 '21 12:03 doug-burrell

Hi, i fix my problem however, i have another problem: I will explain:

I'm using adafruit.io to display information from this sensor, I have modified your code such that in the self.print_result: is the following. if self.print_result: print("BPM: {0}, SpO2: {1}".format(self.bpm, spo2)) heartratefeed= aio.feeds('heart-rate') spo2feed=aio.feeds('spo2') aio.send_data(heartratefeed.key, self.bpm) aio.send_data(spo2feed.key, spo2)

However, adding this code for the aio makes the program run once, and then stop. (It will take one reading, then turn off the sensor.) Do you have knowledge why this behaviour is happening? How I can fix it? is there a way to extract the information from the main.py program?

Sorry to bother you .

Hi,

Can you please elaborate on how you solved OSerror 121 because even I am getting the same error, but I am unable to solve the issue.

Thank you

Srivathsa-Bharadwaj avatar Mar 31 '21 13:03 Srivathsa-Bharadwaj

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/home/raspberrypi/Documents/max30102/heartrate_monitor.py", line 50, in run_sensor red, ir = sensor.read_fifo() File "/home/raspberrypi/Documents/max30102/max30102.py", line 128, in read_fifo reg_INTR1 = self.bus.read_i2c_block_data(self.address, REG_INTR_STATUS_1, 1) OSError: [Errno 121] Remote I/O error

when i use your code

logiferguson124 avatar Jan 02 '24 07:01 logiferguson124