Analog Sensors Not Working

Hello - I am having a similar problem as the user who originally posted in http://www.dexterindustries.com/forum/?topic=sensors-dont-work

None of my analog sensors work. I have Raspberry Pi Model B. The GrovePi+ came with the starter kit I purchased a few weeks ago (order 7694). The Weezy image and GrovePi firmware installed are 2015.03.20_Dexter_Industries_wheezy and 1.2.2 respectively.

I can get the LED to blink using the test program. But I get errors when I use any of the analog sensors in the kit.

Attached are a couple of screen shots of my system.

Thanks

David

Hey,
Can you post the errors that you are getting when you try using the sensors.

-Karan

Hello Karan - thanks for your help. Attached is a screen shot of the Python program I used - “grove_analog_read”. I have attached the Rotary Angle Sensor § from the starter kit to the analog A0 port.

The zip file also contains two screen shots of the output. When I used Snagit to capture the screen, it seems like the program was paused… the second screen shot shows that a successful read was achieved… But only once.

Thanks again.

David

Hey David,
Can you run https://github.com/DexterInd/GrovePi/blob/master/Software/Python/grove_firmware_version_check.py and let us know which version is the firmware on the GrovePi. Also run sudo i2cdetect -y 1 a couple of times and make sure that you see 04 all the times.

Is the blink working perfectly or does it show some errors too. Which sensor are you trying to use and are you using the Dexter Industries raspbian Image or your own.

-Karan

Hello Karan - I am using 2015.03.20_Dexter_Industries_wheezy and 1.2.2 image I downloaded 2 days ago.

I just ran the “i2cdetect -y 1” about 10 times in rapid succession and all looks good (04 in the right place).

However, when I ran the firmware check - from the image I have as well as the version you asked me to run - I get the following output:

GrovePi has firmware version:
Traceback (most recent call last):
File “check.py”, line 16, in <module>
print “GrovePi has firmware version:”, grovepi.version()
File “/home/pi/Documents/GrovePi/Software/Python/grovepi.py”, line 218, in version
return “%s.%s.%s” % (number[1], number[2], number[3])
TypeError: ‘int’ object has no attribute ‘getitem

Thanks for your help.

David

Hey,
Looks like you might be running an old version of the firmware on the GrovePi. Can you run the firmware update http://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/updating-firmware/ and check if you get a firmware version back when you run the script.

-Karan

Hello Karan - I get the same results.

David

Hey,
Can you run the python program to check the firmware a couple of times and see if you get the same result.

Also, can you make sure that the local Grove repo is updated so that you have the latest firmware. Also, can you post the output of the firmware update that you get on the terminal.

-Karan

Hello Karan - just to make certain, I cloned the repository again using this command:

git clone https://github.com/DexterInd/GrovePi.git

The content of the file GrovePi/Firmware/version.txt is 1.2.2

I ran the Python program to check the firmware 10 times in a row before running the firmware update and in all case, the output is the same as I shared above.

The output of running the firmware update is:

Updating the GrovePi firmware

Do you want to update the firmware? [y,n]y
Make sure that GrovePi is connected to Raspberry Pi
Firmware found
Connect the jumper to the Reset pin and Press any key to start firmware update
. . .

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "grove_pi_firmware.hex"
avrdude: input file grove_pi_firmware.hex auto detected as Intel Hex
avrdude: writing flash (14480 bytes):

Writing | ################################################## | 100% 14.57s

avrdude: 14480 bytes of flash written
avrdude: verifying flash memory against grove_pi_firmware.hex:
avrdude: load data flash data from input file grove_pi_firmware.hex:
avrdude: input file grove_pi_firmware.hex auto detected as Intel Hex
avrdude: input file grove_pi_firmware.hex contains 14480 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 13.38s

avrdude: verifying …
avrdude: 14480 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

I rebooted my RPi and I ran the Python program to check the firmware 10 times in a row after running the firmware update and in all case, the output is the same as I shared above.

Thanks

David

Hey,
If you are running the Dexter Industries SD card, can you go the GrovePi folder on the desktop /home/pi/Desktop/GrovePi/Software/Python and run the firmware check script there sudo python grove_firmware_version_check.py .

I just did tried the firmware update script at my end and the version check along with the analig read and it works great. I am not sure what the problem is at your end but I suspect that it is related to the software setup rather than something on the hardware.

Do let us know how it goes.

-Karan

Same Karan.

Karan - I also did the following two things following the instructions in the "Getting Started with the GrovePi+ Starter Kit booklet:

Option 1: Configured my own image. I used the NOOB Raspian as the starting point. Cloned the GrovePi git repository. Ran the install script to bring in the dependencies. After the reboot, I ran the Python Script to determine the firmware version. Same error message. I then install the firmware and ran the script once more. Same error message.

Option 2: Downloaded a new modified Raspian Image (2015.03.20_Dexter_Industries_wheezy). Ran the raspi-config, apt-get update and apt-get upgrade. Once that was completed, I ran the script to determine the Firmware version and received the same error message. I then installed the Firmware and then ran the script once more with the same results.

Thanks

David

Hey David,
Hopping in here. I’ve been lurking a bit the past few days. I think you’ve been in touch with our shipping team and they’re going to ship you a replacement.

Karan has been working on this and we’ve been a little mystified about the problem. This is kind of curious because the board seems to be working, but not working.

Anyways, I’m sorry for the slow pace and I really appreciate you working with us on this. As I said, we’ve been a little mystified and hope that replacing the hardware solves the problem.

Thanks David and thanks Karan.

John

Hey David,
I am attaching a test package which I just tested on my GrovePi. Just unzip the package and copy all the files in a folder. Then make the script executable chmod +x firmware_update.sh and run it ./firmware_update.sh. You should see something similar to the attached output.

It would be great if you could try this out before the new hardware reaches you and also post an update of what you see when you run the script and if it solves your problems.

-Karan

Trying right now. Will post result as soon as possible. Thanks for your help.

No luck :frowning: See output

pi@raspberrypi ~/grovepi_repair_package $ ./firmware_update.sh
Updating the GrovePi firmware

Firmware found
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "grove_pi_fw_1_2_2.hex"
avrdude: input file grove_pi_fw_1_2_2.hex auto detected as Intel Hex
avrdude: writing flash (14480 bytes):

Writing | ################################################## | 100% 15.26s

avrdude: 14480 bytes of flash written
avrdude: verifying flash memory against grove_pi_fw_1_2_2.hex:
avrdude: load data flash data from input file grove_pi_fw_1_2_2.hex:
avrdude: input file grove_pi_fw_1_2_2.hex auto detected as Intel Hex
avrdude: input file grove_pi_fw_1_2_2.hex contains 14480 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 13.22s

avrdude: verifying …
avrdude: 14480 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

Testing Firmware version and analog read

GrovePi has firmware version:
Traceback (most recent call last):
File “grove_script.py”, line 3, in <module>
print “GrovePi has firmware version:”, grovepi.version()
File “/home/pi/grovepi_repair_package/grovepi.py”, line 218, in version
return “%s.%s.%s” % (number[1], number[2], number[3])
TypeError: ‘int’ object has no attribute 'getitem
pi@raspberrypi ~/grovepi_repair_package $

David, just saw this and talked to Taryn. We should test a replacement, which is on the way.

Thanks John as well as to Karan and the person I was speaking to via Twitter DM. I really appreciate your help in sorting this out.

I just received my replacement GrovePi+ board and everything is working like a charm. Thanks!!!