Getting a clean serial port to the AVR!

So, heres not only how to disable both the terminal thats on the serial normally, but also how to put the port into raw mode(no echo and preprocessing of data)!

  • SSH into your Yun.
  • Open the file "/etc/sysctl.conf" with your favorite text editor, and add the line "kernel.printk = 0 4 1 7" to the top of the file.
  • Open "/etc/inittab" and change "ttyATH0::askfirst:/bin/ash --login" to "#ttyATH0::askfirst:/bin/ash --login"
  • Open "/etc/rc.local" and add the line "stty -F /dev/ttyATH0 raw -clocal -echo" above "exit 0"
  • Reboot.
  • Enjoy your free, raw serial port!

EDIT: Also please note this doesnt disable the bootloader prompt or the dmesg output

I would appreciate it if you would explain what steps 2 and 4 do.

I have already used step 3.

...R

Step 2: i found it on the the Openwrt wiki: http://wiki.openwrt.org/doc/recipes/terminate.console.on.serial
Step 4: Without this, the port presents a sortof line-editor, where it echos all data thats sent in, and only puts it on /dev/ttyATH0 when it recieves a newline(and also handles things like backspace). This step basically disables all that, so data gets sent straight to /dev/ATH0 (and also don't gets sent back to the AVR)

Thanks.

...R

Wuerfel_21:
So, heres not only how to disable both the terminal thats on the serial normally, but also how to put the port into raw mode(no echo and preprocessing of data)!

::::SNIP::::

@Wuerfel_21,

WOW! Great work. I should be in one of my posting soon. I'm backed up with documentation that should be online or announced.

Jesse

Thank you very much for sharing this info.

Well, it wasn't that hard to obtain...

Wuerfel_21:
Well, it wasn't that hard to obtain...

First of all: sharing is good and worth a compliment.
Secondly: I have been using this stty statement for a long time and sending to mcu stops from time to time.

stty -F ${PortName}  ${SerialSpeed} min 1 time 5  -icrnl  -onlcr -echo  igncr -icanon ignbrk -brkint  -imaxbel -opost -isig -iexten  -echoe -echok -echoctl -echoke

your's looks so much better :slight_smile: and I hope the stopping stops :o
Thirdly: I was experiencing dropping characters and I assumed it was my stty setting. However the same happened with your stty setting so I could skip that option quickly.

Best regards
Jantje

PS My issue of the dropping of characters was related to the use of the adafruit neopixel library stopping interrupts. https://forums.adafruit.com/viewtopic.php?f=25&p=277061