I am trying to utilize the Yun without having to write a sketch. I have followed the steps in the following thread (Tty for serial port to Arduino from Linino - Arduino Yún - Arduino Forum) and was able to write a simple sketch for the Yun using the Serial1 class that read data I just echoed from the Linux command line (i.e. Type command "echo {some_string} > /dev/ttyATH0).
I was also able to write a sample sketch (Yun had to be in AP mode for this to work) that transmitted data using the Serial1 class to another Arduino connected to the Rx/Tx (0,1) pins of the Yun. Once I configured the onboard wifi I was unable to SSH into the Yun until I stopped using the Serial1 class. Once I restored SSH log in capability Serial1 no longer works to transmit data to the other Arduino board.
Is it possible to write data directly from a Linux script to another Arduino board connected to the Yun's Rx/Tx pins? This means that there wouldn't be any need for a sketch running on the Arduino Yun.
jfullen:
Is it possible to write data directly from a Linux script to another Arduino board connected to the Yun's Rx/Tx pins? This means that there wouldn't be any need for a sketch running on the Arduino Yun.
Answer is no since ar9331 direct connect with ATmega32u4 plus 2.5V to 5.0 V voltage shift is needed.
This made me think in a different direction. I have been playing with other AR9331 based platforms (routers or Carambolas) connected to Arduinos (Megas or Dues) using the Linino work as a base, never thought about not using the Leonardo side of the Yun.
I have been using a level shifter https://www.sparkfun.com/products/11978 even though some people report be able to get by without Serial Cables [Old OpenWrt Wiki]. But since the level shifter is already there at pin 0 & 1 on the Yun I just put a couple of jumpers from the Yun to a Mega (0<->19 & 1<->18) after uploading this to the Yun to prevent any conflict with two outputs fighting:
void setup() {
// put your setup code here, to run once:
pinMode(0,INPUT);
pinMode(1,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
}
Then I uploaded the YunSerialTerminal sketch to the Mega and all works as expected. I then disconnected the Mega and uploaded the YunSerialTerminal sketch to the Yun and again all works as expected.
noblepepper:
...
But since the level shifter is already there at pin 0 & 1 on the Yun I just put a couple of jumpers from the Yun to a Mega (0<->19 & 1<->18) after uploading this to the Yun to prevent any conflict with two outputs fighting:
void setup() {
// put your setup code here, to run once:
pinMode(0,INPUT);
pinMode(1,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
}
...
Nice, It is Plan A.
Plan B.
Wire a jumper from a AVR ground pin to the AVR reset pin. This will hold the processor in reset and free all it's I/O into tri-state mode. You are then free to use the serial pins.
from a shell or script. This is stolen from the /usr/bin/reset-mcu script, it just never releases the reset which would be done with the rest of reset-mcu:
On Plan C- You can connect to the "main" serial with just a USB cable, one of the first things I did with my Yun was plug Arduinos into the USB host connector and flash sketches to them with scripts: Flashing other Arduinos with a Yun - Arduino Yún - Arduino Forum basically the same as using the USB<->UART converter, just with the one built into the second Arduino.