Tail Arduino console log within Linino

Hi Folks,

I see lots of how-to on tailing /dev/ttyUSB0 from third party Linux, but how do you tail the console log for Arduino from within Linino? I don't have a /dev/ttyUSB0 device, and I don't seem to get appropriate output from ttyS0 or ttyS1.

Currently I go about it a round about way with having the Arduino code write to log file with shell execution, but sometimes when I ssh to Linino, I want to see output from there directly.

Make Yun boot from SD card.

Expand the Yún disk space via sketch.

or

Expand the Storage directly via shell script.

http://www.ibuyopenwrt.com/index.php/11-yun-compatible/expand-the-storage-at-yun/18-expand-the-storage

Edit /etc/inittab at Rootfs on microSD card, comment out:

nano  /etc/inittab
#ttyATH0::askfirst:/bin/ash --login
reboot

Now you have direct access /dev/ttyATH0, bridge is disabled.

Whenever you need rollback, just remove microSD card and reboot.

supersleeper:
Hi Folks,

I see lots of how-to on tailing /dev/ttyUSB0 from third party Linux, but how do you tail the console log for Arduino from within Linino? I don't have a /dev/ttyUSB0 device, and I don't seem to get appropriate output from ttyS0 or ttyS1.

Currently I go about it a round about way with having the Arduino code write to log file with shell execution, but sometimes when I ssh to Linino, I want to see output from there directly.

@supersleeper,
you've got two different subject that often get confused.

#1 Many of the demos you see use UNO, Leonardo, or equivalent.
#2 Those units are connect via USB to a host computer (usually laptop)
#3 If you output via the IDE to the "terminal window", you have the basics done.
#4 then you can trap that port /deve/tty* and commit to your storage of choice.

You can do the same with the YUN, using python. And have your USB connected laptop/computer capture the data via the TTY. Your open call in python would be:

ser = serial.Serial("/dev/ttyACM0", 9600)

HOWEVER, if you want to store that information on the YUN, then you use the Bridge Library to deliver the data to the YUN.

An alternative is to take over the port between the Atmel and the AR9311. There are a few people in this forum who have solutions for this. You have to start an new thread with the subject. "Are there any Bridge Library Alternatives?" Or use the alternative that SonnyYu suggests

Lastly, the solutions for seeing the data while it is writing to the SD might require a named pipe and a tee. The actual solution requires knowing some more details.

In the meantime,

Introduction to Named Pipes
http://www.linuxjournal.com/article/2156

Tee Command Usage Examples

Jesse

Thanks for the replies. Yes, I don't have any intention on storing output, I just want to see in real-time when I choose to for debugging. No /dev/ttyACM0 here on my YUN. So my complete listing of ports are as follows:

crw-rw-rw- 1 root root 5, 0 Dec 31 1969 tty
crw-rw-rw- 1 root root 253, 0 Jul 28 10:01 ttyATH0
crw-rw-rw- 1 root root 4, 64 Dec 31 1969 ttyS0
crw-rw-rw- 1 root root 4, 65 Dec 31 1969 ttyS1
crw-rw-rw- 1 root root 4, 74 Dec 31 1969 ttyS10
crw-rw-rw- 1 root root 4, 75 Dec 31 1969 ttyS11
crw-rw-rw- 1 root root 4, 76 Dec 31 1969 ttyS12
crw-rw-rw- 1 root root 4, 77 Dec 31 1969 ttyS13
crw-rw-rw- 1 root root 4, 78 Dec 31 1969 ttyS14
crw-rw-rw- 1 root root 4, 79 Dec 31 1969 ttyS15
crw-rw-rw- 1 root root 4, 66 Dec 31 1969 ttyS2
crw-rw-rw- 1 root root 4, 67 Dec 31 1969 ttyS3
crw-rw-rw- 1 root root 4, 68 Dec 31 1969 ttyS4
crw-rw-rw- 1 root root 4, 69 Dec 31 1969 ttyS5
crw-rw-rw- 1 root root 4, 70 Dec 31 1969 ttyS6
crw-rw-rw- 1 root root 4, 71 Dec 31 1969 ttyS7
crw-rw-rw- 1 root root 4, 72 Dec 31 1969 ttyS8
crw-rw-rw- 1 root root 4, 73 Dec 31 1969 ttyS9

None of the ones I've tried will show results on a tail -f. Am I missing something?

Thanks,

supersleeper:
Thanks for the replies. Yes, I don't have any intention on storing output, I just want to see in real-time when I choose to for debugging. No /dev/ttyACM0 here on my YUN. So my complete listing of ports are as follows:

::::SNIP::::
None of the ones I've tried will show results on a tail -f. Am I missing something?

Thanks,

@supersleeper,
Sorry a bit tired then.

  • I am using Linux (Ubuntu 14.04 LTE), I think the port is the same on all Linux systems. /dev/ttyACM0.
  • The Yun MUST be connected to your laptop/desktop for this to work.
  • The Yun MUST complete the boot sequence
  • The Yun MUST have a sketch running that outputs data
  • You must make sure the port speed is set on the Yun and the Serial port.

On that last item, This is why I used python to get around the problem. Or you can test the Serial port with the IDE terminal window; this usually sets the port speed. There are other ways to set the port speed. I don't have my notes on this right now.

If you have a question on #3, please ask.

Jesse

Thanks Jesse,

My whole point of the Yun for me is to have a stand-alone unit that is low-power that I can operate in my vehicle. I don't want to have another system running in the car. If I do need to watch the console, I'd simply just use the IDE console interface. Thanks for the your time and input though, it's definitely appreciated.

Tail the console log from Aduino:

Load Example/Bridge/Process into Yun

cat /dev/ttyATH0 |tee console.log
run-bridge


run-bridge


run-bridge

supersleeper:
Thanks Jesse,

My whole point of the Yun for me is to have a stand-alone unit that is low-power that I can operate in my vehicle. I don't want to have another system running in the car. If I do need to watch the console, I'd simply just use the IDE console interface. Thanks for the your time and input though, it's definitely appreciated.

@supersleeper,
You know I should have asked your goal. And now I'm puzzled. How did you plan on watching the system run without a console, or some type of monitor. What was your original plan?
Jesse

Linino was my answer. It's powerful and capable. Matter of fact, you can loop the console usb port into itself and read the serial that way, but my usb console port broke quite a while ago.

To better answer, I ssh into linino

Found it!

telnet localhost 6571

This was exactly what I was looking for.