I am having a hard time trying to talk with my Arduino on a Debian system. I am a linux noob. It seems that these unix/linux systems are holding on to their serial terminals tight. Every option in the termios struct is about using serial ports with a terminal (like VT100 or something). I seriously doubt there's such usage nowadays. Trying to use a serial port for unbuffered and un-processed data is just so hard. I just learned today that by turning off flow control, I was finally able to send bytes from Debian PC to Arduino. The Arduino -> Debian worked out of the box.
I wonder if there exists a c/c++ library for linux to run Arduino fashion Serial ports, such as Serial.begin, available, read, write. I am just hacking up code I found online and hoping it will hold together.
Here is what I found, from a member on the beagle board forum (probably also on pi forum):
I really can't understand why a FILE pointer is used and why one needs to open the serial port with open and then use the file descriptor to fopen again and only fread and fwrite with the FILE pointer instead of read and write with the file descriptor. I was using the file descriptor and it worked fine. Looks like the code disables buffering on FILE object so isn't that becoming just read and write?
Thanks, I know about python library but I don't use python. I use c/c++. It is much more powerful and faster. I have had enough trouble using Processing because it is slow and won't do static methods. I should be better off learning Java but then c is always my choice of language. If there are very good python scripts I can call them with system command. I envy people with good bash shell programming skills. They can do a lot with it. But I don't think I will learn bash that much, because of that. Too old to learn a language. What I will try is to cal python code from c so if I can understand a bit of python I can make use some good python scripts.