Startup - Clarify Sketch DL and Serial Monitor Please

OK I've read many forum posts, and FAQ's and examples.... Sorry for being clueless....

1. Can I download a sketch via WiFi, reset/ start that sketch and see debug output (Serial.print() or Console.print() remotely without physically touching the Yun?

  1. I've downloaded Blink via WiFi... It works. I downloaded WiFiStatus.ino but see no output on the Serial Monitor window (using the port selection: "myYun at 192.168.1.48". But I DO see the output when I use the serial monitor downloaded and connected as /dev/tty.usbmodem411.

3 I tried to connect to the serial port by ssh root@... then once in, entering "telnet localhost 6571" and all I get is "telnet: can't connect to remote host (127.0.0.1): Connection refused". What the heck is up with that. Shouldn't that connect to the serial port? Is there some web page that will explain thin to me? The Getting Started is superficial at best. And yes, during this time I do NOT have the Serial Monitor window open.

  1. What is the difference between Serial.print() and Console.print()? Or, more importantly, where in the docs is this explained?

Anyone have any ideas?

awardblvr:
OK I've read many forum posts, and FAQ's and examples.... Sorry for being clueless....

  1. Can I download a sketch via WiFi, reset/ start that sketch and see debug output (Serial.print() or Console.print() remotely without physically touching the Yun?

Yes, see answers below....

awardblvr:
2. I've downloaded Blink via WiFi... It works. I downloaded WiFiStatus.ino but see no output on the Serial Monitor window (using the port selection: "myYun at 192.168.1.48". But I DO see the output when I use the serial monitor downloaded and connected as /dev/tty.usbmodem411.

Yes, this is what should happen.

awardblvr:
3 I tried to connect to the serial port by ssh root@... then once in, entering "telnet localhost 6571" and all I get is "telnet: can't connect to remote host (127.0.0.1): Connection refused". What the heck is up with that. Shouldn't that connect to the serial port? Is there some web page that will explain thin to me? The Getting Started is superficial at best. And yes, during this time I do NOT have the Serial Monitor window open.

No comment, I haven't played with this.

awardblvr:
4. What is the difference between Serial.print() and Console.print()?

Serial works over the USB, Console works over the WiFi or Ethernet.
Here are a couple of examples that may help understand-
Here is a modified Blink sketch that reports led status through the USB.

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;


// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  Serial.begin(115200);
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);
  Serial.println("On");  // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);
Serial.println("Off");  // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

You can upload through either USB or WiFi but after that you must have the Yun attached to the computer through a USB cable, select the Port relevant to USB in the Tools menu (for me this is /dev/ttyACMx, I use Ubuntu, it looks like you are on another distro)
The sketch will report on/off in the Serial Monitor working through the USB

Here is a sketch that does the same just over WiFi/Ethernet-

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;


#include "Console.h"
// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  Bridge.begin();
  Console.begin();
  while (!Console);
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);
  Console.println("On");  // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);
Console.println("Off");  // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Again, you can upload through either USB or WiFi but after that you don't need to have the Yun attached to the computer through a USB cable, select the Port relevant to WiFi or Ethernet in the Tools menu (for me this is <your yun's name>@ 192.168.xxx.xxx (Arduino Yun)
The sketch will report on/off in the Serial Monitor working through the WiFi or Ethernet.
You can ssh into the Yun at this point and the serial connection is at /dev/ttyATH0 but I haven't worked out the details of baud rate etc yet, you can see that it is trying by using cat /dev/ttyATH0

awardblvr:
Or, more importantly, where in the docs is this explained?
Anyone have any ideas?

No slight intended to the Arduino and Yun bunch, but documentation doesn't cover everything about the Yun. In their defense, there is A LOT of stuff to explain and I think they have/are doing an excellent job.

I knew there was a way I had used the serial port in the Linino side to connect to the Leonardo side, it took me a while to remember here is what you need to do:

Disable the console as described here:
http://forum.arduino.cc//index.php?topic=191820.msg1422155#msg1422155
Press the reset button by the leds and give Linino plenty of time to reboot (it takes over 60 seconds).

Caution: I have made problems for myself doing this, mainly because I had issues on my wireless network the Yun was trying to connect to and I didn't have access to the console anymore so I had to do this to get back to normal:
http://forum.arduino.cc//index.php?topic=192830.msg1425139#msg1425139
As long as you have a stable setup on your WiFi Network you shouldn't have problems.

ssh into the Yun as root and

opkg update
opkg install picocom

Now upload this sketch to the Yun:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;



// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  Serial1.begin(115200);
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);
  Serial1.println("On");  // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);
  Serial1.println("Off");  // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Finally go back to your ssh session and:

picocom -b 115200 /dev/ttyATH0

And now the sketch reports LED status to picocom. BTW- to exit picocom use [ctrl]a[ctrl]x
Notice that this eliminates the ability to connect through the bridge and/or console. I sure you can reenable this with out rebooting but I usually reenable the console in inittab and reboot.

So to summarize - Serial works through the USB connection, Console/Bridge works through the WiFi and Arduino IDE's Serial Monitor on the IP port but interferes with connecting in Linino, and Serial1 connects to /dev/ttyATH0 in Linino but you have to disable the Console/Bridge.

awardblvr:
2. I've downloaded Blink via WiFi... It works. I downloaded WiFiStatus.ino but see no output on the Serial Monitor window (using the port selection: "myYun at 192.168.1.48". But I DO see the output when I use the serial monitor downloaded and connected as /dev/tty.usbmodem411.

There is output: it says it can't connect and it's retrying, after 5 retries it says it's giving up and asks you "Is your sketch using the bridge?"
That also answers your third question about the telnet and connection refused. If your sketch is not using the bridge there won't be anything to connect to. And you won't see any output even if you do use the bridge but do NOT use Console