I cannot get the examples to run. I think it is a clash between Python 2.6 and 2.7. I have tried removing first one and then the other, but apt-get insists on putting them both back.
Here is my latest error:
File “hello_world.py”, line 3, in
import dot3k.lcd as lcd
File “/usr/local/lib/python2.7/dist-packages/dot3k-1.7.1-py2.7.egg/dot3k/init.py”, line 1, in
import lcd, backlight, joystick
File “/usr/local/lib/python2.7/dist-packages/dot3k-1.7.1-py2.7.egg/dot3k/backlight.py”, line 1, in
import sn3218, colorsys, math
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 17, in
i2c = SMBus(i2c_bus_id())
IOError: [Errno 2] No such file or directory
This is curious! As Boeeerb suggest it’s related to i2c communications with the chip that controls the lights, the sn3218, but this error is more typical of problems with i2c not being enabled correctly, or the i2c-dev module not being inserted.
Also try: sudo modprobe i2c-dev
I don’t have a Pi/dot3k with me right now to test, but keep me posted and I’ll try to remember not to forget to have a look into it tomorrow!
Still no luck.
ip install st7036 sn3218 said both were installed
modifying sn3218.py made no difference
modprobe i2c-dev now causes a different error message:
Traceback (most recent call last):
File “hello_world.py”, line 3, in
import dot3k.lcd as lcd
File “/usr/local/lib/python2.7/dist-packages/dot3k-1.7.1-py2.7.egg/dot3k/init.py”, line 1, in
import lcd, backlight, joystick
File “/usr/local/lib/python2.7/dist-packages/dot3k-1.7.1-py2.7.egg/dot3k/backlight.py”, line 1, in
import sn3218, colorsys, math
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 98, in
enable_leds(0b111111111111111111)
File “/usr/local/lib/python2.7/dist-packages/sn3218.py”, line 55, in enable_leds
i2c.write_i2c_block_data(address, CMD_ENABLE_LEDS, [enable_mask & 0x3F, (enable_mask >> 6) & 0x3F, (enable_mask >> 12) & 0X3F])
IOError: [Errno 5] Input/output error
python hello.py
Traceback (most recent call last):
File “hello.py”, line 3, in
import dot3k.lcd as lcd
File “/usr/local/lib/python2.7/dist-packages/dot3k/init.py”, line 1, in
import lcd, backlight, joystick
File “/usr/local/lib/python2.7/dist-packages/dot3k/lcd.py”, line 3, in
lcd = st7036.st7036(register_select_pin=25)
File “/usr/local/lib/python2.7/dist-packages/dot3k/st7036.py”, line 20, in init
self.spi.open(0, spi_chip_select)
IOError: [Errno 2] No such file or directory
root@pi:~# apt-get install python-smbus python-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
python-dev is already the newest version.
python-smbus is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@pi:~# pip install st7036 sn3218
Requirement already satisfied (use --upgrade to upgrade): st7036 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): sn3218 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): spidev in /usr/local/lib/python2.7/dist-packages (from st7036)
Cleaning up…
oh and have done the above-and enabled spi and i2c
root@pi:~# apt-get install i2c-tools
Reading package lists… Done
Building dependency tree
Reading state information… Done
i2c-tools is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@pi:~# apt-get install i2c-detect
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package i2c-detect
root@pi:~# i2c-detect -y 0
-bash: i2c-detect: command not found