UnravelTEC / Raspi-Driver-SCD30

Software to read out Sensirion SCD30 CO₂ Sensor values over I2C on Raspberry Pi
GNU General Public License v3.0
24 stars 10 forks source link

'int' object has no attribute '__getitem__' #1

Closed javed222 closed 5 years ago

javed222 commented 5 years ago

hello i can this code one time, and all is right but when i can try in a loop, after minutes have an error: 'int' object has no attribute 'getitem'

i am noobee, have you an successfully code with an loop for read sensor each 15 seconds for example?? Thanks Javier

species commented 5 years ago

Hi Xavier,

please provide the changes to did in your code, so we can reproduce your problem.

Please post your code, the commands to run your program and your error message.

Thanks, Michael

javed222 commented 5 years ago

Thanks Michael

I’m attached my code to the email.

This python code run on a raspberry pi zero w, with raspbian stretch Desktop and a 4d system display model 4dpi-24.

Based in your code, I made one, with a loop for read the sensor 4 times for minute..

When run the code, after minutes stop with de follow error:

Maybe my code is wrong.. I don’t know…

How does you that code may run several times per minute ?

Thanks

Best regards

Javier

De: Michael Maier [mailto:notifications@github.com] Enviado el: viernes, 30 de noviembre de 2018 5:45 a. m. Para: UnravelTEC/Raspi-Driver-SCD30 Raspi-Driver-SCD30@noreply.github.com CC: javed222 vazquezeja@yahoo.com; Author author@noreply.github.com Asunto: Re: [UnravelTEC/Raspi-Driver-SCD30] 'int' object has no attribute 'getitem' (#1)

Hi Xavier,

please provide the changes to did in your code, so we can reproduce your problem.

Please post your code, the commands to run your program and your error message.

Thanks, Michael

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/UnravelTEC/Raspi-Driver-SCD30/issues/1#issuecomment-443132958 , or mute the thread https://github.com/notifications/unsubscribe-auth/AbYKND2RaIYzlQOFUAZCznLFuQ78s4rWks5u0PApgaJpZM4Y67CI . https://github.com/notifications/beacon/AbYKNJUo6XQ9g_2hrs-hFa2Gf3qX715kks5u0PApgaJpZM4Y67CI.gif


El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus

javed222 commented 5 years ago

here is the code

species commented 5 years ago

Hi Xavier,

Unfortunately, attaching via Email doesn't seem to work here. Could you please either fork this repository and commit your changes to your fork, or post the code inline here?

Thanks, Michael

javed222 commented 5 years ago

Thanks Michael, To have a better understanding of the problem, perform a clean install of raspbian desktop on my pi zero. In this case I run exactly your code, with the following script: script now have the follow error: error What could be the problem? Thanks!

javed222 commented 5 years ago

the sensor are OK. I run on arduino without errors...

species commented 5 years ago

As pigpio.error says: 'I2C write failed', I guess it's a problem with your I2C bus - let's nail the problem down, please answer the following questions:

We should rule out electrical or other hardware problems first, or write a software fix instead...

How often does the error occur? In your screenshot, there were 167 iterations before, did the error occur before too? Does the loop work again in the next iteration?

javed222 commented 5 years ago

OK Thank you!

javed222 commented 5 years ago

error2 in interaction 287 and 288 have an error again.. 50min after the first error...

javed222 commented 5 years ago

error3 in interaction 521 have an error again.. 78min after the first error...

species commented 5 years ago

I've added some error-catching code around all used pigpiod functions. Could You try if You can handle your errors better now?

javed222 commented 5 years ago

Thanks I´m testing...

javed222 commented 5 years ago

i try the code with an new SCD30, and a new raspberry pi 3A+. All was right!! 0 errors... Thanks

species commented 5 years ago

Many thanks for your feedback, closing ticket for now.

Have a good day :-)