Hopefully quick question.
I have an LCD using the 4bit library. when I type something into the serial console in the IDE, it echos the string to the LCD
in the end, everything's going to be plugged into a gentoo box (doing the programming on a windows box) and i'd like to be able to just
echo "something" > /dev/ttyUSB0
what do I need to do on the Linux side to make this work. I can echo stuff to the screen using minicom just fine, but is there anyway to echo things to a serial port w/o any flow control/parity checking/etc from the command line?
my wife has my ibook, and she's at home visiting at the moment, but i'll tell you in a few days if someone doesn't beat me to it
it should since darwin is BSD at heart, and Linux took the tty system from BSD. I know OSX has the stty command, just unsure if it's as functional as the Linux one
quick related question,
I need the arduino plugged into USB so it can talk to the computer, but the computer won't be on all the time. Is it safe to power it with a power plug (with the jumper set to power plug) while it's plugged into USB as well?
quick related question,
I need the arduino plugged into USB so it can talk to the computer, but the computer won't be on all the time. Is it safe to power it with a power plug (with the jumper set to power plug) while it's plugged into USB as well?
Yes that should be ok. When that jumper is set to power plug, the FTDI chip is the only thing powered by USB.
That looks great
But how can I send now a String from the Terminal to Arduino? I would like to send just a single letter. I tried to read the original php file, but I don't understand it... I need translation!!!
Ouuu, yes... I've found a little bash script, which is for the oposite: How to read from the Terminal over the RS232 in Linux:
#!/usr/bin/expect
spawn picocom -b 115200 /dev/ttyS0 ;
expect "L" #the script will terminate when the letter L arrives...
in- and out-puts from and to arduino over serial - interface in console mode
I'll update this playground section with my serial-to-analog-out.pde and the tiny python script.
I tried now the code echo -n "x" but even the TX LED on Arduino doesn't blink... so I can't connect the pc on this way with the Arduino.
Thanx.
Ups... I tried now the echo "x" > /dev/ttyUSB0TX is blinking, but "x" doesn't arrive...
I'll use python but it still interressts me... thanx.
I am trying to set up an Arduino Diecimila to power-cycle a device under control of a Linux application. The hardware is working. The Arduino code (using 0015) looks like this:
int outputPin = 3;
int val;
void setup()
{
Serial.begin(9600);
pinMode(outputPin, OUTPUT);
}
void loop()
{
if (Serial.available()) {
val = Serial.read();
if (val == 'R') {
digitalWrite(outputPin, HIGH);
delay(5000);
}
digitalWrite(outputPin, LOW);
}
}
Everything works fine from the Arduino development environment. On Linux, I set up the /dev/ttyUSB3 port using the stty command above with the correct baud rate and then echo "R" > /dev/ttyUSB3. However, the only way I can get the Arduino program to recognize the "R" is if I start another Linux session and invoke tail -f /dev/ttyUSB3 first.
Without the tail command, sending the "R" character causes the Rx LED to blink, quickly followed by the 'L' (Pin 13) LED. Starting the tail command causes the 'L' LED to blink. Sending the "R" now causes just the Rx LED to blink. I tried throwing in a Serial.flush() but that did not seem to do anything.
Am I missing something obvious? Running a tail command in the background is not a big deal, other than it 'holds' the ttyUSB3 port. If I unplug/replug the Arduino, I end up on /dev/ttyUSB4.
Thanks, Norbert
So the tail[/] command kept the serial connection open? Now that I know what to look for, there are a lot of forum posts on this subject. I will try the 120 ohm resistor technique.
** Thanks for the fast response!**
** Norbert**