NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Redirecting output from terminal to LCD
July 24, 2009 by pedroh96 |
Hey guys! I wrote a code that when I type any message after typing 'screen /dev/cu.PL2303-0000101D 115200 115200', the message appears in my LCD. I'd like to redirect a text file (using cat or something like that) to the LCD. How can I do it? Oh, my code:
Regards, pH |
---|---|
July 24, 2009 by wayward |
It's a Mac, right? You can do:
and have fun with things like:
If you need to set the baud rate, character size, parity, stop bits, etc. before this will work, you can do this:
|
July 25, 2009 by pedroh96 |
:( . I can't get it working. When I use 'cat file > $LCD', many || appears in my screen, and I can't use the last command. How can I use the last command (with echo, for exemple). Thanks for helping, pH |
July 26, 2009 by pedroh96 |
What should I do to get it working? This (echo Hi from $(hostname) > /dev/cu.PL2303-0000101D 115200), works, but in my screen, i'm getting many '|| || ||' instead of characters. What should I do to fix it? Regards, pH |
July 27, 2009 by mcai8sh4 |
Hi pedroh96 - I know we discussed this on IRC last night/day (depending on timezone), but since we didn't reach a definate answer, I thought I'd post our findings here to see if anyone else could shed some light on it. The '||' appear due to the '\n' character (or \n \r) I would think that you could incorporate something in the code to avoid this - however I've tried and failed! There is another post (http://www.nerdkits.com/forum/thread/35/) that deals with a similar issue - but that uses python to send the data across. So, since this issue is annoying me (I thought it would have been quite simple), I hope someone else out there might be able to shed some light. Our basic goal is this : Using echo "testing" > /dev/ttyUSB0 (or similar) how can you get the text displayed on the LCD. I would rather not use the printf idea, something along the lines lcd_write_data(uart_read()); <- but that doesn't work. I'll try and have another play tonight - I'll post my findings. -s |
July 27, 2009 by wayward |
A quick and dirty solution would be to tell echo not to send the terminating newline:
As for ignoring newlines on the receiving end, that shouldn't really be a problem; just skip the entire "command" subset of ASCII:
Canonical HTH, Zoran |
August 01, 2009 by pedroh96 |
Can't get it working. I have opened a new thread in Ubuntu Forums: http://ubuntuforums.org/showthread.php?p=7716858#post7716858 I think they can help me better. |
August 01, 2009 by wayward |
pedroh96,
won't do what you're hoping to achieve, since 115200 is seen by echo as just another thing to write to the output device -- not as a specific baud rate parameter. Screen knows it is supposed to "talk" to serial devices, so it has provisions for specifying baud rate and suchlike, but echo is blissfully ignorant in that department. Did you try setting the communication parameters before writing using echo? What error did you get when you tried
By the way, I assumed you were using a Mac, but since you appear to be on Ubuntu which is a GNU/Linux distribution, the syntax will be a little different:
Do try one of these two, depending on what OS you have, and let us know what the result was. Simply "doesn't work" can't help us help you! Oh, and you may need to prefix the command with sudo, so
before you try echo. Zoran |
August 03, 2009 by pedroh96 |
Hi Zoran, Here is what happens:
When I type this, I still get the || || || || on the LCD. Here is an image of the LCD when trying sudo stty -f /dev/cu.PL 115200 -parity -cstopb; echo -n HEY > /dev/cu.PL: Thanks for helping! |
September 14, 2009 by wayward |
hey pedroh96, I forgot about this thread :) Any progress here? Did you get it to work? |
Please log in to post a reply.
Did you know that NerdKits believes in the importance of a mixture of meaningful topics, clear instruction, and engaging projects? Learn more...
|