Ubuntu serial output.

Hi
i basically want to know how i can make Ubuntu output to the serial port every min the CPU Load

You can run this command to find the load

uptime | sed -e "s/.load average: (....), (....), (....)/\1/" -e "s/ //g"

How would i do this?

Not sure, try:
uptime | sed -e "s/.load average: (....), (....), (....)/\1/" -e "s/ //g" > /dev/ttyACM0

Here's an example doing something trivial:

$ while true; do echo wibbly; sleep 10; done

This works in bash. You might need to enclose your command in parentheses. Like

$ while true; do (uptime | sed -e "s/.*load average: \(.*\...\), \(.*\...\), \(.*\...\)/\1/" -e "s/ //g" > /dev/ttyACM0); sleep 60; done

Also, I don't think you'll be guaranteed that ACM0 will always be your Arduino. On my Ubuntu sytem, it's always the next higher number everytime I unplug/plug it in.

Changed to my arduino number and this command worked :slight_smile:

Now i just got to make it a looping SH Script :slight_smile:

Tyvm - Ryan