Yun using console to output sketch info

This is a basic question. I am using the Yun with a NFC shield to read outputs from the sketch via the USB connected cable. I wish to have the Leonardo part output the sketch results via the Console (Bridge?) so that I can use the Yun in full WiFi mode with only power connected to the USB connector. I plan to use an iPad on the same WiFi network so that I can recieve sketch outputs.
I'm sure this is a simple thing but my complications of my modified sketch on the IDA always fail due to syntax issues.

Thx

sonnyyu posted an interesting example of using the console with a bit of Linux port management trickery to simplify remotely accessing the console. His posts start here: Yun to labview TCP/IP wireless - #26 by sonnyyu - Arduino Yún - Arduino Forum

The basic idea with the console is that once you start the Bridge (Bridge.begin()) you use Console.begin() instead of Serial.begin(), and then anywhere you would use Serial.print() or Serial.println() just use Console.print() or Console.println().

Be aware that the sample sketch that sonnyyu posted has a construct at the beginning to wait until the console is connected:

 while (!Console);   // Wait for the Console port to connect

You aren't going to want to include that in your sketch, unless you will ALWAYS have the console connected. If you leave that in, and restart the sketch, it will do nothing until something opens the console connection.

Thx ShapeShifter for the info. I'll checkout the link you posted. The simple Console sketch works fine. (Console Read Example). However as I am getting a number of compile errors with my modified NFC sketch I was now wondering that one of the include libraries could be the issue.

#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
#include <Console.h>

The "NFcAdapter.cpp" file contains "Print" statements in it. Will these have to changed to "Console" as well?

ianwj:
The "NFcAdapter.cpp" file contains "Print" statements in it. Will these have to changed to "Console" as well?

I'm not familiar with that library, but I took a quick look at it. Unfortunately, it has Serial.print() statements sprinkled throughout it. I think that was a poor design decision, it would've been a lot better if they accepted a Stream object in the constructor so that you could pass in Serial, Serial1, Serial2, SoftwareSerial, etc, or even a Console object. That way you could've decided where you want the output to go.

But since they made the unilateral decision that all output goes to Serial, and that's not what you want, you will have to go in there and change any calls of the Serial object into calls of the Console object. You will likely have to also add some header files to that source file, perhaps only #include <Console.h>

Thx. FYI, some info on the compile errors being thrown up:

Arduino: 1.6.4 (Mac OS X), Board: "Arduino Yún"

In file included from /Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Console.h:22:0,
from ReadTagExtended.ino:6:
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h: In member function 'uint16_t BridgeClass::transfer(const uint8_t*, uint16_t)':
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h:54:43: error: invalid conversion from 'void*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
return transfer(buff1, len1, NULL, 0);
^
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h:56:14: error: initializing argument 3 of 'uint16_t BridgeClass::transfer(const uint8_t*, uint16_t, uint8_t*, uint16_t)' [-fpermissive]
uint16_t transfer(const uint8_t buff1, uint16_t len1,
^
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h: In member function 'uint16_t BridgeClass::transfer(const uint8_t
, uint16_t, uint8_t*, uint16_t)':
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h:59:58: error: invalid conversion from 'void*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]
return transfer(buff1, len1, NULL, 0, rxbuff, rxlen);
^
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h:61:14: error: initializing argument 3 of 'uint16_t BridgeClass::transfer(const uint8_t*, uint16_t, const uint8_t*, uint16_t, uint8_t*, uint16_t)' [-fpermissive]
uint16_t transfer(const uint8_t buff1, uint16_t len1,
^
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h: In member function 'uint16_t BridgeClass::transfer(const uint8_t
, uint16_t, const uint8_t*, uint16_t, uint8_t*, uint16_t)':
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h:65:71: error: invalid conversion from 'void*' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]
return transfer(buff1, len1, buff2, len2, NULL, 0, rxbuff, rxlen);
^
/Users/ianwj/Desktop/Arduino.app/Contents/Java/libraries/Bridge/src/Bridge.h:47:14: error: initializing argument 5 of 'uint16_t BridgeClass::transfer(const uint8_t*, uint16_t, const uint8_t*, uint16_t, const uint8_t*, uint16_t, uint8_t*, uint16_t)' [-fpermissive]
uint16_t transfer(const uint8_t *buff1, uint16_t len1,
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

As you say, I'll probably need to scour the code for "Print" and add "include Console.h" header in the source.

ianwj:
Thx. FYI, some info on the compile errors being thrown up:

::::SNIP::::
As you say, I'll probably need to scour the code for "Print" and add "include Console.h" header in the source.

@ianwj,
please use code markup (see image below). It will help everyone that might want to lend a hand in you project.

TIA
Jesse

arduino_markup.png