Open allebone opened 11 years ago
Hi,
I think there is some confusion.
clock.py is an example to be used with the SPI_7segment board, and not with the UI.
For I2C you will need to connect to an I2C bus object.
make sure you have SMBus installed
(apt-get install smbus as I recall)
in your program:
i=I2C(1) (or nothing depending on revision RPi) ui=RPi_Ui_16x2(I) ui.Cls() ui.Print("Test")
It seems that you have not enabled the SPI bus so indeed there is no /dev/spidev0.0 on your system.
Please let me know if you need more help.
Kind regards,
Martijn Moeling
On Aug 30, 2013, at 16:34 , allebone notifications@github.com wrote:
Error from attempt at running clock.py:
Traceback (most recent call last): File "clock.py", line 5, in c = LED7Segment(SPI()) File "/usr/local/lib/python2.7/dist-packages/BitWizard/bw.py", line 337, in init self.File = posix.open(self.Device, posix.O_RDWR) OSError: [Errno 2] No such file or directory: '/dev/spidev0.0'
Makes a little sense, as I am using a RevB Pi, and the I2C Bitwizard RPi V1.1 UI. 16X2 LCD, with 6 buttons.
I read the instructions thoroughly, and I can send individual text and clear via bw_tool to the LCD. All bw_tool commands work, but since its using /dev/i2c-1 as its destination, I have to use the bw_tool -y 1 for all commands to work.
OS Version: Linux version 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #528 PREEMPT Tue Aug 20 00:25:53 BST 2013
Let me know how I can help. I've got 5 of these LCDs for testing and I'm fielding a small-scale open-source energy management product to some friends with this setup.
— Reply to this email directly or view it on GitHub.
also,
Make sure you update the bwlib on a regular basis as the development is ongoing. I am working hard on getting the documentation done.
The latest Docs are available @ http://pb0ner.nl/BitWizardDoc/
Also have a look at the menu demo example. It does not seem to work on 16x2 UI and it has been written tested on my SPI_20x4_Ui. but you can get some inspiration from that!
You might look into the SetAutoDetectUi function: http://pb0ner.nl/BitWizardDoc/namespaceBitWizard_1_1bw.html#a5c641bb5732c9f25fe92f1ae63e8667e
Function if you plan on using the bus scan feature!
Martijn
On Aug 30, 2013, at 16:34 , allebone notifications@github.com wrote:
Error from attempt at running clock.py:
Traceback (most recent call last): File "clock.py", line 5, in c = LED7Segment(SPI()) File "/usr/local/lib/python2.7/dist-packages/BitWizard/bw.py", line 337, in init self.File = posix.open(self.Device, posix.O_RDWR) OSError: [Errno 2] No such file or directory: '/dev/spidev0.0'
Makes a little sense, as I am using a RevB Pi, and the I2C Bitwizard RPi V1.1 UI. 16X2 LCD, with 6 buttons.
I read the instructions thoroughly, and I can send individual text and clear via bw_tool to the LCD. All bw_tool commands work, but since its using /dev/i2c-1 as its destination, I have to use the bw_tool -y 1 for all commands to work.
OS Version: Linux version 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #528 PREEMPT Tue Aug 20 00:25:53 BST 2013
Let me know how I can help. I've got 5 of these LCDs for testing and I'm fielding a small-scale open-source energy management product to some friends with this setup.
— Reply to this email directly or view it on GitHub.
Thank you for your quick and detailed response! Its more obvious than ever that I am not savvy in python or linux at all. Also, it appears that I would have been best off with the SPI version of the UI. The interfacing part was something I left to the end of my application/project, so this appears to be my hang-up.
I'll try some more things using the I2C suggestions you made above. If it can't work for me, I may need to consider moving to either a 4D touchscreen or the SPI version.
The former seems like a "slick" way of fixing the problem, but destroys my keeping it under $100US rule.
Thanks Again,
Bryan
Bryan,
Thank you for using our solution!
The main goal of this library is that there is a low learning curve to get started with the BitWizard boards and get away from the 1's and 0's for the not so experienced.
The Raspberry Pi has one usable I2C bus and two useable SPI busses. Most Bitwizard boards are available for both I2C en SPI. and The library can talk to all devices on those busses. It is even possible to run the library (See daemon example,new since yesterday) in deamon mode. If you install the bw_library on your PC (mac/linux/windows) you can even connect to the daemon over TCP/IP. Once your application is done, you can install it on the Pi.
There is absolutely no need to change you I2C UI for an SPI version. I have 20x4 SPI ui here but sometimes when I need an 16x2 LCD and UI pushbuttons, I connect an I2C 16x2 LCD and tell the UI object that it's display is another device…
s=SPI() i=I2C(1)
UI=Rpi_Ui_16x2(s) lcd=i2c_LCD_16x2(i) Ui.Display=lcd
After this… all output is on an other LCD, even on a different bus!
Interfacing the Ui is really easy, let me know where I can help if you get stuck!
Martijn
On Aug 30, 2013, at 19:57 , allebone notifications@github.com wrote:
Thank you for your quick and detailed response! Its more obvious than ever that I am not savvy in python or linux at all. Also, it appears that I would have been best off with the SPI version of the UI. The interfacing part was something I left to the end of my application/project, so this appears to be my hang-up.
I'll try some more things using the I2C suggestions you made above. If it can't work for me, I may need to consider moving to either a 4D touchscreen or the SPI version.
The former seems like a "slick" way of fixing the problem, but destroys my keeping it under $100US rule.
Thanks Again,
Bryan
— Reply to this email directly or view it on GitHub.
Error from attempt at running clock.py:
Traceback (most recent call last): File "clock.py", line 5, in
c = LED7Segment(SPI())
File "/usr/local/lib/python2.7/dist-packages/BitWizard/bw.py", line 337, in init
self.File = posix.open(self.Device, posix.O_RDWR)
OSError: [Errno 2] No such file or directory: '/dev/spidev0.0'
Makes a little sense, as I am using a RevB Pi, and the I2C Bitwizard RPi V1.1 UI. 16X2 LCD, with 6 buttons.
I read the instructions thoroughly, and I can send individual text and clear via bw_tool to the LCD. All bw_tool commands work, but since its using /dev/i2c-1 as its destination, I have to use the "bw_tool -I -D /dev/i2c-1" for all commands to work.
OS Version: Linux version 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #528 PREEMPT Tue Aug 20 00:25:53 BST 2013
Let me know how I can help. I've got 5 of these LCDs for testing and I'm fielding a small-scale open-source energy management product to some friends with this setup.