Dangerous Prototypes

Other projects => Past projects => USB serial LCD backpack => Topic started by: Xusqui on March 01, 2014, 11:23:26 am

Title: Newbe. Serial connection on Raspberry pi
Post by: Xusqui on March 01, 2014, 11:23:26 am
Hi neighbours and friends.

I have an HD44780 connected to the GPIO pins of my raspberry pi, with an OpenELEC distro for it and running fine. The one thing I don't like is having so many wires messing up in the back of my TV, so I purchased this module to drive the LCD through USB.
My problem now is that LCDproc only drives Matrix Orbital devices via serial port. So My questions are:

1. Does anybody knows about a driver for LCDproc to drive USB MtxOrb?

2. If not, how can I connect the backpak via serial port to the RaspI? So I can avoid several wires and the protoboard circuit.

Thanks in advance!!
Title: Re: Newbe. Serial connection on Raspberry pi
Post by: 240glt on March 03, 2014, 10:57:03 pm
Hi,

I managed to get it (almost) working. As long as you put the right path to the port, it works with USB also. If you run "dmesg" after you plug in your USB lcdbackpack, you will get the address. This is what i got:

[27156.008038] usb 3-1: new full-speed USB device number 2 using uhci_hcd
[27156.197120] usb 3-1: New USB device found, idVendor=04d8, idProduct=fa97
[27156.197125] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[27156.197128] usb 3-1: Product: HD44780 LCD CDC-232
[27156.197131] usb 3-1: Manufacturer: DangerousPrototypes.com
[27156.216397] cdc_acm 3-1:1.0: This device cannot do calls on its own. It is not a modem.
[27156.216435] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[27156.219225] usbcore: registered new interface driver cdc_acm
[27156.219229] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

So I tried this parameter:
Device=/dev/ttyACM0

And that worked. But I have some problems with the backlight. Se my post in another thread: viewtopic.php?f=60&t=3675&start=15#p56975 (http://dangerousprototypes.com/forum/viewtopic.php?f=60&t=3675&start=15#p56975)
Title: Re: Newbe. Serial connection on Raspberry pi
Post by: TonyD on March 06, 2014, 05:47:36 pm
On the Pi, the hardware UART is set to "console mode" by default, so it is used by the OS. If you want to use it you'll first need to disable the OS from using it.

Here's some notes from my blog (http://http://zuzebox.wordpress.com/2013/11/26/minipiiio-rs232-set-up/) that might help. Make a backup of the two files we’ll be changing.

sudo cp /boot/cmdline.txt /boot/cmdline.bak
sudo cp /etc/inittab /etc/inittab.bak


In the LXterminal shell type the command:

sudo leafpad /boot/cmdline.txt

Find and remove “console=ttyAMA0,115200” and “kgdboc=ttyAMA0,115200” parameters.

The cmdline.txt will probably contain the default configuration line:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait


Find and remove “console=ttyAMA0,115200” and “kgdboc=ttyAMA0,115200” configuration parameters so it looks something like this:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Make sure to save the file and quit the editor.

Finally edit the “/etc/inittab” file to disable the use of the “ttyAMA0? serial port. In LXterminal type this command:

sudo leafpad /etc/inittab

Near the bottom of the file, look for a configuration line that includes the “ttyAMA0” port address.

Type a hash (or pound) sign (“#”) in front of the line “ttyAMA0“.

Save the file and exit the editor. Once done to reboot your Pi.


<shameless plug>

If you need a RS232 connection then here's a board that connects to the pi and provides the RS232 interface.



You can get them from Tindie.com here (http://https://www.tindie.com/products/DTronixs/piio-minipiio-rs232-for-raspberry-pi-kit-only/)

</shameless plug>

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01042063200session_write_close ( )...(null):0
20.01062194792ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01072195568Database_MySQL->query( ).../DatabaseHandler.php:119
40.05382334304Database_MySQL->error( ).../Db-mysql.class.php:273