Object not subscriptable (anaologRead)


#1

Hi,
I have the GrovePi Board running with temp/hum Sensor, Lightsensor, Led, Button and LCD. Everything works fine- till I get the following error message:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/home/pi/Desktop/GrovePi2Socket/GrovePiConnector.py", line 78, in run
    light = grovepi.analogRead(sensor_light)
  File "/home/pi/Dexter/GrovePi/Software/Python/grovepi.py", line 227, in analogRead
    return number[1] * 256 + number[2]
TypeError: 'int' object is not subscriptable

This happens after an hour or two of running this script. Restart of the Script does not help. Reboot of the Raspberry also does not help.
What helps is starting the firmware_upgrade.sh then it again works for an hour or two.
But this is not really a solution.
Has somebody an idea?
Thanks and Kind Regards,
Marco


Again: Object not subscriptable
Again: Object not subscriptable
#2

Hello @marco.ertel

From what you’re saying it seems the firmware is crashing. Can you run a troubleshooting test for me?
If you’re on Raspbian for Robots, there’s a Test and Troubleshoot icon on the desktop.
If you’re not on Raspbian for Robots , then open a terminal window and enter the following:
sudo bash ~/Dexter/GrovePi/Troubleshooting/all_tests.sh

Either of those will generate a log file on the desktop. Please share the results.

Thank you,
Cleo


#3

Hi,
thanks for looking in the issue. I am not on Raspbian for Robots but on a normal Raspbian and installed the stuff in addition. So I started the script you mentioned.
Here you can find the log file: log.txt (6.3 KB)

Thanks and Kind Regards,
Marco


#4

Thank you @marco.ertel

It seems there may be a couple of issues. Could you send me the contents of
/etc/modprobe.d/raspi-blacklist.conf to be certain?

Thanks,
Cleo


#5

Hi Cleo,
the raspi-blacklist.conf you mentioned is empty.

Kind Regards,
Marco


#6

Instead of just rebooting the Raspberry Pi, does it make any difference if you shut down the RPi, remove power, and then boot it back up (full power cycle for the RPi and GrovePi)?


#7

Hi Matt,
after power off and on again the sensors are working again.
Thanks and Kind Regards,
Marco

Unfortunately that thread has been closed and marked as solved- but the power cycle does only help for an hour or so and then the problem occurs again.
Who can reopen this thread?


#8

#9

Hi,
I opened the thread (Object not subscriptable (anaologRead)) a few days ago and before I was able to add the latest things it was closed (and marked as solved). As I can’t reopen it let me try it here as a new thread.

Yes I had written that the power off-on cycle has helped. But even after power-off-on the complete stuff only works again one hour or so.

Who can help or has an idea?

Thanks and Kind Regards,
Marco


#10

#11

@marco.ertel, @matt, I’ve moved @marco.ertel’s new thread into this one as he requested and now, this thread is open again.

I was searching for similar cases and the only report of this issue was with this guy here:

He only seems to partially match your situation @marco.ertel and he didn’t came with further replies to the supposed issue.

Really curios, but can you tell me what is the kernel version that you have? Command uname -a will tell you. And I think it’s safe to assume that once you get that exception, there’s no going back, so to speak - that tells me there’s a dead-end somewhere in the firmware.

And I have an idea based on the fact that you may be running multiple sensors simultaneously along with some analog sensor: please run each sensor/device on your GrovePi separately until one of them triggers that exception. What I’m thinking is that maybe some sensor is causing analogRead to fail.

Let’s see where this takes us.

Thank you!


#12

Hi Robert,
thanks for reopen the thread.
uname -a answers:

Linux planthouse300 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

(oh- it seems that the time of the machine is not correct. For my scripts this is not a problem- can this be a problem for the GrovePi stuff?)

The other test is right now running (only checking one sensor). As it everytime takes one or two hours to run into the exception I am still waiting for this exception.
I also checked if it is a hardware related issue (different Raspberry, different GrovePi Board, same sensors connected but the problematic image with scripts). And yes there it also crashes.

Thanks and Kind Regards,
Marco
(If it helps I can also send you a link to the image of the Raspberry and the used scripts)


#13

Hi @marco.ertel,

The difference in time should not pose a problem.

The other test is right now running (only checking one sensor). As it everytime takes one or two hours to run into the exception I am still waiting for this exception.

Well, then, I’m going to wait and see where you’re getting to. Just make sure to run a sensor at a time.

I also checked if it is a hardware related issue (different Raspberry, different GrovePi Board, same sensors connected but the problematic image with scripts). And yes there it also crashes.

This might indicate an issue with the firmware.

If it helps I can also send you a link to the image of the Raspberry and the used scripts

It would be cool if you could show us some scripts though and tell us the order in which they occur.
Until then, I’m waiting to see where your tests take you.

Thank you!