Display-O-Tron 3000

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:

root@bplus2:/usr/src/dot3k/python/examples/basic# python hello_world.py         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 17, in
i2c = SMBus(i2c_bus_id())
IOError: [Errno 2] No such file or directory

Any ideas?

You beat me to it! I’m also having this error. Any ideas?

Try the command:

sudo pip install st7036 sn3218

As from the looks it’s falling at something related to connecting to the sn3218 chip, but can’t see any recent code changes that’ll affect it.

– Unfortunatly I don’t have a DOT3K to test, so be warned! —

As a test, try the following:

sudo nano /usr/local/lib/python2.7/dist-packages/sn3218.py

Go down to line

i2c = SMBus(i2c_bus_id())

And change it to:

i2c = SMBus(1)

CTRL + X, Y and then enter and try again

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

Leo

An IO error is at least progress on the last error. But I haven’t been able to replicate it. What era of Raspberry Pi do you have?

Has it been like that from day 1? Perhaps a connection on the header has come loose from putting on and unplugging the board a few times?

Only software wise left is to check blacklist and modules file, perform i2cdetect otherwise hardware?

Hey Leo,

Do you want to try a replacement unit?

I have been having similar problems to @leol.

I’ll try and have a play tomorrow, since I haven’t been able to try @Boeeerb’s fixes.

Thanks, but I have just got it working.
Not sure what was wrong but started from a clean install of Raspbian and removed and replaced unit.

Leo

Result! Nice work :-)

That’s fortunate. I was at a complete loss! I wonder what got Raspbian into such a state.

In which case, I will have a go at reflashing raspbian.

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

any ideas ??

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

Ahoy @irnbru

Could you try the following:

sudo apt-get install i2c-tools 
sudo i2c-detect -y 1
sudo i2c-detect -y 0

And let me know if you get output from either of the latter commands, or just errors.

If you get errors, give this a try and try again:

sudo modprobe i2c-dev

thanks for swift reply-

so …

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

???

root@pi:~/dot3k# i2cdetect -y 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: – -- – -- – -- – --
root@pi:~/dot3k# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

Heya! Phil meant “i2cdetect” (not “i2c-detect”) - the commands should be:

sudo i2cdetect -q 1
sudo i2cdetect -q 0

[quote=“jon, post:39, topic:29”]
i2cdetect -q 1
[/quote]root@pi:~/dot3k# i2cdetect -q 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using quick write commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
root@pi:~/dot3k# i2cdetect -q 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using quick write commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- 54 – -- – -- – -- – -- – -- –
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --