Can't get Software to run

Hi all,
after receiving my kit today, I am desperately trying to get the software to work.
This is what I did:

  1. Configuring my own image referring tp Option 1 in the manual p7 (git clone …)
  2. Trying to run the tutorial LED Blink:
    sudo python led_blink.py

Here is what the error is about:

import smbus
>>ImportError: No module named smbus

Any help really appreciated.

Regards Gunhawk

I’m not sure what the booklet tells you to do, as I don’t have it near me.
Here’s the webpage with up to date information on how to install on your own card
http://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/setting-software/

Point 6 shows the python-smbus being installed in the accompanying image.

Update:
I have retried the steps conducting a fresh install.
However, on my system the compilation of the sources failed.

Please find below the logfile of the installation (until system got rebooted)
Regards Gunhawk

Thanks for the log. It seems it dies in something related to Raspbian itself.
Did you run

sudo apt-get update
sudo apt-get upgrade

before attempting the GrovePi install?

Even a fresh card needs to do that step in order to catch up with the latest developments from Raspberry Pi.

Hi,
today I did a fresh install of Noobs Rasperian and make sure to do the updating/upgerading as suggested.
I did the clone of the GrovePi SW from github and installed into Desktop Folder as suggested. However, it still does not seem to function properly.
I tried out the do all Tests and here is the log:

pi@raspberrypi:~/Desktop $ cat log.txt

Check space left

Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 7,7G 3,6G 3,8G 49% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 0 463M 0% /dev/shm
tmpfs 463M 6,4M 457M 2% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p6 63M 20M 43M 32% /boot
tmpfs 93M 0 93M 0% /run/user/1000
/dev/mmcblk0p9 4,8G 9,9M 4,5G 1% /media/pi/fe75b009-8ba8-456d-a7bf-a8b6e6ddb0e5
/dev/mmcblk0p8 512M 125M 388M 25% /media/pi/B052-A48B
/dev/mmcblk0p5 30M 3,9M 24M 14% /media/pi/SETTINGS
/dev/mmcblk0p3 4,3G 23M 4,3G 1% /media/pi/MainOS
/dev/mmcblk0p2 64M 4,0K 64M 1% /media/pi/EFIESP
/dev/mmcblk0p15 1003K 17K 915K 2% /media/pi/MBR_META
/dev/mmcblk0p14 3,0G 16M 3,0G 1% /media/pi/Data
/dev/mmcblk0p13 673M 1,1M 623M 1% /media/pi/scratch
/dev/mmcblk0p12 5,7G 556M 4,9G 11% /media/pi/root-rbp2
/dev/mmcblk0p11 79M 21M 59M 26% /media/pi/boot-rbp2
/dev/mmcblk0p10 488M 2,3M 456M 1% /media/pi/data

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+deb8u2 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.2~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 install ok installed
scratch 1.4.0.6~dfsg1-5 install ok installed

wiringPi Found
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.32
Copyright © 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony

  • Device tree is enabled.
  • This Raspberry Pi supports user-level GPIO access.
    -> See the man-page for more details
    -> ie. export WIRINGPI_GPIOMEM=1

Check the /dev folder

i2c-1
ttyAMA0

USB device status

Bus 001 Device 004: ID 062a:4101 Creative Labs
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 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 12M
Raspbian for Robots Version

cat: /home/pi/di_update/Raspbian_For_Robots/Version: Datei oder Verzeichnis nicht gefunden

Hostname

raspberrypi

Checking for Atmega chip

avrdude: Version 5.10, compiled on Jun 18 2012 at 12:38:29
Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright © 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 not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

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/Desktop/GrovePi/Software/Python/grove_firmware_version_check.py”, line 40, in <module>
print(“GrovePi has firmware version: %s” %grovepi.version())
File “/home/pi/Desktop/GrovePi/Software/Python/grovepi.py”, line 262, in version
return “%s.%s.%s” % (number[1], number[2], number[3])
TypeError: ‘int’ object has no attribute 'getitem
pi@raspberrypi:~/Desktop $

Update:
There is at least another thread “GrovePi not detected” that has a similar output for the i2cdetect Command showing an empty Matrix.
Please help
Gunhawk

Hello, and sorry you were left in the dark so long. I had to dig a bit for this one.

Can you make sure those lines are run on your pi?

cd /tmp
wget http://project-downloads.drogon.net/gertboard/avrdude_5.10-4_armhf.deb
sudo dpkg -i avrdude_5.10-4_armhf.deb
sudo chmod 4755 /usr/bin/avrdude

cd /tmp
wget http://project-downloads.drogon.net/gertboard/setup.sh
chmod +x setup.sh
sudo ./setup.sh

There’s an issue with avrdude on your card. Hopefully this will fix it.

Also you said I did the clone of the GrovePi SW from github and installed into Desktop Folder as suggested.
No mention of running Desktop/Grovepi/Script/install.sh
I’m assuming you followed the steps from here: http://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/setting-software/ but I just want to make certain that you did.

Thanks
Cleo

Hi Gunhawk,
Do let us know if the Cleo’s steps help you solve the problem. If it still does not work, it would be great if you could run our image on another SD card. Here are the instructions to install the Raspbian for Robots image: http://www.dexterindustries.com/howto/install-raspbian-for-robots-image-on-an-sd-card/. That image comes with a utility which let’s us troubleshoot the GrovePi better. Can you run the troubleshooting script and upload the log on the forums by following the guide here: https://www.youtube.com/watch?v=ZMadpIEYq5o.

-Karan

Hi,

tried so but the deb archive isn’t even working - see below:

pi@dex:/tmp sudo dpkg -i avrdude_5.10-4_armhf.deb dpkg-deb: error: `avrdude_5.10-4_armhf.deb' is not a debian format archive dpkg: error processing archive avrdude_5.10-4_armhf.deb (--install): subprocess dpkg-deb --control returned error exit status 2 Errors were encountered while processing: avrdude_5.10-4_armhf.deb pi@dex:/tmp


Correction - did it again by copy pasting and now it seem to work

udo ./setup.sh
Setting up Raspberry Pi to make it work with the Gertboard
and the ATmega chip on-board with the Arduino IDE.

Checking …
Avrdude: OK
Arduino IDE: OK
Fetching files:
boards.txt
programmers.txt
avrsetup
Replacing/updating files:
inittab: cp: cannot stat ‘inittab’: No such file or directory
./setup.sh: line 61: inittab: No such file or directory
mv: cannot stat ‘/tmp/inittab.1663’: No such file or directory
OK
cmdline.txt: Backup exists: not overwriting
boards.txt: Backup of boards.txt exists, not overwriting
programmers.txt: Backup of programmers.txt exists, not overwriting
All Done.
Check and reboot now to apply changes.
pi@dex:/tmp $ sudo ./setup.sh

UPDATE:

Now that I ran the lines provided by CleoQC, I reran the all_tests.sh and this is the outcome.
Bottom line is that the AVRDUDE is still not working!?

Please help - could it be just a Hardware error? I do have another Kit I haven’t unboxed yet (and don’t actually want to)

pi@dex:~/Desktop/GrovePi/Troubleshooting $ sudo ./all_tests.sh

GrovePi Troubleshooting Script

Adding permissions to the scripts

Check space left

Filesystem Size Used Avail Use% Mounted on
/dev/root 3.6G 2.6G 762M 78% /
devtmpfs 427M 0 427M 0% /dev
tmpfs 432M 0 432M 0% /dev/shm
tmpfs 432M 6.1M 425M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 432M 0 432M 0% /sys/fs/cgroup
/dev/mmcblk0p1 60M 21M 40M 35% /boot
tmpfs 87M 0 87M 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+deb8u2 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.2~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 install ok installed
scratch 1.4.0.6~dfsg1-5 install ok installed

wiringPi Found
wiringPi Found
I2C already removed from blacklist
SPI already removed from blacklist

Check for addition in /modules

I2C-dev already there
i2c-bcm2708 already there
spi-dev already there

Hardware revision

gpio version: 2.32
Copyright © 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony

  • Device tree is enabled.
  • This Raspberry Pi supports user-level GPIO access.
    -> See the man-page for more details
    -> ie. export WIRINGPI_GPIOMEM=1

Check the /dev folder

i2c-1
spidev0.0
spidev0.1
ttyAMA0

USB device status

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
Raspbian for Robots Version

V 6.9

This version of Raspbian was modified by Dexter Industries on the Wheezy Raspbian Build.
This version was updated on 2016.05.09

Hostname

dex

Checking for Atmega chip

avrdude: Version 5.10, compiled on Jun 18 2012 at 12:38:29
Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright © 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 not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

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/Desktop/GrovePi/Software/Python/grove_firmware_version_check.py”, line 40, in <module>
print(“GrovePi has firmware version: %s” %grovepi.version())
File “/home/pi/Desktop/GrovePi/Software/Python/grovepi.py”, line 258, 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
pi@dex:~/Desktop/GrovePi/Troubleshooting $

Hi Gunhawk, it’s still not clear from the above: have you tried to run a GrovePi Firmware update? We have two videos that can show you how to do that:

Update GrovePi Firmware With the Command Line - https://www.youtube.com/watch?v=kfTWTmW_tDk&list=PLGXEJ4Ye1qCPqsjkJ0nxbxq-hg2VX4u7o&index=12

Update the GrovePi Firmware Using Raspbian for Robots - https://www.youtube.com/watch?v=VUVvU4YcTvo&list=PLGXEJ4Ye1qCPqsjkJ0nxbxq-hg2VX4u7o&index=11

If you run the Firmware Update, what do you get back?