Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running the script #2

Open
ixforcesxi opened this issue Jan 31, 2021 · 6 comments
Open

Error when running the script #2

ixforcesxi opened this issue Jan 31, 2021 · 6 comments

Comments

@ixforcesxi
Copy link

ixforcesxi commented Jan 31, 2021

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

@doug-burrell
Copy link
Owner

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?

@ixforcesxi
Copy link
Author

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 .

@abenko
Copy link

abenko commented Mar 20, 2021

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?

@doug-burrell
Copy link
Owner

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.

@Srivathsa-Bharadwaj
Copy link

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

@logiferguson124
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants