Blink LED runs, LED stays off, i2cdetect does not detect D4

Software is installed and rebooted. GrovePi board is seated firmly on Pi 2b and powered up. Grove Pi+ green power LED on the board is on.

LED is plugged into D4. Running grove_led_blink.py executes OK but does not illuminate the attached LED.

Ran a firmware update, no errors, and rebooted just in case. Running the blink LED application still does not cause the LED to blink. Here are results from all_tests.sh. The i2cdetect command does not detect D4, and there are what appears to be a couple of other errors in the log meblow.

Please assist. Thank you.

root@raspberrypi:/home/pi/GrovePi/Troubleshooting# ./all_tests.sh 
=============================
GrovePi Troubleshooting Script
=============================

Adding permissions to the scripts
=================================

Check space left
================
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.2G  5.9G  941M  87% /
devtmpfs        483M     0  483M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  6.6M  481M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/mmcblk0p1   60M   24M   37M  40% /boot
tmpfs            98M  4.0K   98M   1% /run/user/1000

Check for dependencies
======================
python 2.7.9-1 install ok installed
python-pip 1.5.6-5 install ok installed
git 1:2.1.4-2.1+deb8u3 install ok installed
libi2c-dev 3.1.1+svn-2 install ok installed
python-serial 2.6-1.1 install ok installed
python-rpi.gpio 0.6.3~jessie-1 install ok installed
i2c-tools 3.1.1+svn-2 install ok installed
python-smbus 3.1.1+svn-2 install ok installed
arduino 2:1.0.5+dfsg2-4 install ok installed
minicom 2.7-1+deb8u1 install ok installed
scratch 1.4.0.6~dfsg1-5 deinstall ok config-files

wiringPi Not Found (ERR)
wiringPi Found
I2C still in blacklist (ERR)
SPI still in blacklist (ERR)


Check for addition in /modules
==============================
I2C-dev already there
i2c-bcm2708 already there
spi-dev already there


Hardware revision
=================
gpio version: 2.36
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Embest 
  * Device tree is enabled.
  *--> Raspberry Pi 2 Model B Rev 1.1
  * This Raspberry Pi supports user-level GPIO access.


Check the /dev folder
=====================
i2c-1
spidev0.0
spidev0.1
ttyAMA0

USB device status
=================
Bus 001 Device 005: ID 046d:c063 Logitech, Inc. DELL Laser Mouse
Bus 001 Device 004: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
Raspbian for Robots Version
===========================
cat: /home/pi/di_update/Raspbian_For_Robots/Version: No such file or directory


Hostname
========
raspberrypi


Checking for Atmega chip
========================


avrdude: Version 5.10, compiled on Jun 18 2012 at 12:38:29
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : unknown
         Using Programmer              : gpio
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : GPIO
         Description     : Use sysfs interface to bitbang GPIO lines

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK

avrdude done.  Thank you.


Checking I2C bus for devices
============================

Checking I2C bus 0
==================
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory

Checking I2C bus 1
==================
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Checking for firmware version
=============================
Traceback (most recent call last):
  File "/home/pi/GrovePi/Software/Python/grove_firmware_version_check.py", line 40, in <module>
    print("GrovePi has firmware version: %s" %grovepi.version())
  File "/home/pi/GrovePi/Software/Python/grovepi.py", line 266, in version
    return "%s.%s.%s" % (number[1], number[2], number[3])
TypeError: 'int' object has no attribute '__getitem__'
Log has been saved to Desktop. Please copy it and send it by email or upload it on the forums
root@raspberrypi:/home/pi/GrovePi/Troubleshooting#

Hello,
Your Grovepi is not detected, am I right in saying you’re using Raspbian but not Raspbian for Robots?
If that is the case, what did you do to install the software?

Cleo

Hi.

That is correct. It is Raspbian, not Raspbian for Robots. Running uname says the kernel is from Dec 2016, so not the most recent patch level, but it is still newer than the Grovepi release date. I did not install the OS, but I assume my coworker who owns it used one of the two methods on the Raspbian website, perhaps download and image to the SD card without NOOBS.

There is a pre-existing application running on the Pi2b, so I cannot reimage the OS. I was asked to implement a feature request to add an LED to the Pi, to show application state. The application will be enhanced to call out to python scripts to turn the light on or off, based on code snippets from grove_led_blink.py.

This was my first time using a Grovepi and python. I had errors the first time running the Grovepi install, but I assumed they might be expected if not all slots were filled on the Grovepi board. I eventually found better instructions online, including a note to install without the board attached. The installer ran without error after I did that, and I hoped that would fix things. It did not.

Here is everything I did based in order.

  • Power down the running Pi2b and attached the Grovepi board.
  • Power on the Pi, and note the Grovepi has an illuminated green pwr light on the board.
  • Login as user pi. Clone from git into /home/pi/GrovePi.
  • sudo to run the installer bash script. Install ran very quickly, and I noticed a few errors on the console, but I assumed that might be expected if not all gadgets were plugged into the Grovepi.
  • Run sudo grove_led_blink.ph. It errors out saying smbus was not found.
  • Googled the python error since I am unfamiliar with python. Found an answer on a blog entry that said python-smbus needs to be installed. Checked the pi and found it is not installed.
  • Run sudo apt-get python-smbus to install. It refused due to missing dependencies. It seems strange the dependencies do not resolve automatically, and adding -f option does not help.
  • Run sudo apt-get python-smbus opencryptoki opencryptoki0 to get past the install warnings.
  • Re-run sudo grove_led_blink.ph. It runs and outputs ON/OFF messages on the console, but the D4 LED attachment does not illuminate.
  • Google the grove_led_blink.py issue. Found another blog than recommends running i2cdetect to verify D4 is detected. It is not installed, so I ran sudo apt-get install i2c-tools.
  • Re-ran i2cdetect, no D4 detected. All entries show as double dashes --.
  • Google some more. Found Grovepi instructions at official website. They are more detailed compared to the instructions in the booklet with the Grovepi. This is the first time I notice something saying to do the install without the board attached.
  • Power down the pi, and detach the Grovepi.
  • Power on the pi, and re-run the installer as root. No errors this time, and it takes much longer to finish the install. Reboot the pi and hope i2cdetect will work.
  • Power down the pi, and re-attach the Grovepi.
  • Power on the pi and run i2cdetect. Grovepi board has green pwr LED, but D4 still not detected.
  • Google some more. Find Grovepi forum, including an entry to try a Grovepi firmware update to resolve issues with certain Pi2 models. The issue mentioned was Pi2, not Pi2b, but I figure a firmware update should not hurt and could be worth a shot. So I try it.
  • Run the firmware command as root, no errors. Retry i2cdetect but D4 not detected.
  • Reboot the pi in case a reboot is needed after firmware update. Re-run i2cdetect but D4 is still not detected.
  • Browser more Grovepi forum entries. I found an entry mentioning all_tests.sh. I try it, and notice certain outputs looks different than the forum entry.
  • Sign up to the forum and post my all_tests.sh results.

I am hoping there is a way to recover that does not require reinstall Raspbian and the custom application.

Hi @justincranford,

Thank you for describing your situation accurately.
It seems like your installer didn’t do the job.


We have a new way of installing our dependencies.
Can you execute the following command on a terminal on your Raspberry Pi:

  • sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_grovepi.sh | bash

This command will update / install your GrovePi correctly onto your Raspberry Pi.

After you do this, I’d suggest running all_tests.sh again and come back here and tell us how it went.


Thank you!

I ran the suggested command and rebooted at the end as prompted. The GrovePi D4 port is still not detected. Here is the new output of all_tests.sh.

root@raspberrypi:/home/pi/GrovePi/Troubleshooting# ./all_tests.sh 
=============================
GrovePi Troubleshooting Script
=============================

Adding permissions to the scripts
=================================

Check space left
================
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.2G  5.9G  912M  87% /
devtmpfs        483M     0  483M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  6.6M  481M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/mmcblk0p1   60M   24M   37M  40% /boot
tmpfs            98M     0   98M   0% /run/user/1000

Check for dependencies
======================
python 2.7.9-1 install ok installed
python-pip 1.5.6-5 install ok installed
git 1:2.1.4-2.1+deb8u3 install ok installed
libi2c-dev 3.1.1+svn-2 install ok installed
python-serial 2.6-1.1 install ok installed
python-rpi.gpio 0.6.3~jessie-1 install ok installed
i2c-tools 3.1.1+svn-2 install ok installed
python-smbus 3.1.1+svn-2 install ok installed
arduino 2:1.0.5+dfsg2-4 install ok installed
minicom 2.7-1+deb8u1 install ok installed
scratch 1.4.0.6~dfsg1-5 deinstall ok config-files

wiringPi Not Found (ERR)
wiringPi Found
I2C still in blacklist (ERR)
SPI still in blacklist (ERR)


Check for addition in /modules
==============================
I2C-dev already there
i2c-bcm2708 already there
spi-dev already there


Hardware revision
=================
gpio version: 2.36
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Embest 
  * Device tree is enabled.
  *--> Raspberry Pi 2 Model B Rev 1.1
  * This Raspberry Pi supports user-level GPIO access.


Check the /dev folder
=====================
i2c-1
spidev0.0
spidev0.1
ttyAMA0

USB device status
=================
Bus 001 Device 005: ID 046d:c063 Logitech, Inc. DELL Laser Mouse
Bus 001 Device 004: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
Raspbian for Robots Version
===========================
cat: /home/pi/di_update/Raspbian_For_Robots/Version: No such file or directory


Hostname
========
raspberrypi


Checking for Atmega chip
========================


avrdude: Version 5.10, compiled on Jun 18 2012 at 12:38:29
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : unknown
         Using Programmer              : gpio
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : GPIO
         Description     : Use sysfs interface to bitbang GPIO lines

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK

avrdude done.  Thank you.


Checking I2C bus for devices
============================

Checking I2C bus 0
==================
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory

Checking I2C bus 1
==================
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Checking for firmware version
=============================
Traceback (most recent call last):
  File "/home/pi/GrovePi/Software/Python/grove_firmware_version_check.py", line 40, in <module>
    print("GrovePi has firmware version: %s" %grovepi.version())
  File "/home/pi/GrovePi/Software/Python/grovepi.py", line 266, in version
    return "%s.%s.%s" % (number[1], number[2], number[3])
TypeError: 'int' object has no attribute '__getitem__'
Log has been saved to Desktop. Please copy it and send it by email or upload it on the forums
root@raspberrypi:/home/pi/GrovePi/Troubleshooting#

Just want to make sure that when you updated the firmware on the GrovePi, you followed these instructions (here), specifically:

sudo chmod +x firmware_update.sh
sudo ./firmware_update.sh```

Is that right?  If you run it again, what does the output look like?

I agree with @RobertLucian and @cleoqc on this one: the device is clearly not responding since you're not seeing a return on the 0x04.  However, the fuses look set correctly, so the only other thing to check to rule out a hardware issue is to rewrite the firmware (and make sure it was re-written).

If after re-writing the firmware we don't see a response, we should look at replacing the hardware.