Need Help with the Iduino Yun Shield on a Mega2560
Posted: Sun Sep 18, 2016 10:04 am
Hi, I am new to Arduino but I have managed to get my board to run a temp/humidity sensor and upload the data to thingspeak via ethernet cable.
I now want to do this via wifi so I dont need the connected ethernet cable.
I have an Arduino Mega 2560 board and have placed the Iduino Yun shield V1.2 onto it,
I have been able to connect directly (Laptop<->iduino yun shield) via wifi to the shield and set it up and then reconnect via my home wifi network (Laptop<->wifi network WPA2<->iduino yun shield), this all seems to be working fine.
I have placed the jumper on the mega16u2 bridge mode reset pins on the Arduino mega 2560 board (though 1 site says you dont need to do that now)
I have uploaded sketches both directly from the arduino IDE and have also tried via hex file upload via the iduino yun shield settings page)
I have updated the Geeetech Iduino Yun shield (v1.2) to the dragino firmware V 2.0.7 (one site suggested this will help)
I initially had troubles updating the board.txt file but a great text editor called Boards.txt helped sort that out
I have added and tried both these settings for dragino and arduino in the board.txt file
##############################################################
mega2560Yun_Dragino.name=Arduino Mega 2560 -Dragino Yún
mega2560Yun_Dragino.build.mcu=atmega2560
mega2560Yun_Dragino.build.f_cpu=16000000L
mega2560Yun_Dragino.build.core=arduino:arduino
mega2560Yun_Dragino.build.variant=arduino:mega
mega2560Yun_Dragino.build.board=AVR_MEGA2560
mega2560Yun_Dragino.upload.tool=arduino:avrdude
mega2560Yun_Dragino.upload.protocol=arduino
mega2560Yun_Dragino.upload.maximum_size=258048
mega2560Yun_Dragino.upload.speed=57600
mega2560Yun_Dragino.upload.disable_flushing=true
mega2560Yun_Dragino.upload.use_1200bps_touch=true
mega2560Yun_Dragino.upload.wait_for_upload_port=true
mega2560Yun_Dragino.upload.via_ssh=true
mega2560Yun_Dragino.upload.maximum_data_size=8192
mega2560Yun_Dragino.bootloader.tool=arduino:avrdude
mega2560Yun_Dragino.bootloader.low_fuses=0xff
mega2560Yun_Dragino.bootloader.high_fuses=0xd8
mega2560Yun_Dragino.bootloader.extended_fuses=0xfd
mega2560Yun_Dragino.bootloader.file=arduino:stk500v2/stk500boot_v2_mega2560.hex
mega2560Yun_Dragino.bootloader.unlock_bits=0x3F
mega2560Yun_Dragino.bootloader.lock_bits=0x0F
mega2560Yun_Dragino.vid.0=0x2341
mega2560Yun_Dragino.pid.0=0x0044
mega2560Yun_Dragino.pid.1=0x003f
mega2560Yun_Dragino.vid.1=0x2341
##############################################################
mega2560Yun_Iduino.name=Arduino Mega 2560 -- Iduino Yún
mega2560Yun_Iduino.build.mcu=atmega2560
mega2560Yun_Iduino.build.f_cpu=16000000L
mega2560Yun_Iduino.build.core=arduino
mega2560Yun_Iduino.build.variant=mega
mega2560Yun_Iduino.build.board=AVR_MEGA2560
mega2560Yun_Iduino.upload.tool=avrdude
mega2560Yun_Iduino.upload.protocol=arduino
mega2560Yun_Iduino.upload.maximum_size=258048
mega2560Yun_Iduino.upload.speed=57600
mega2560Yun_Iduino.upload.disable_flushing=true
mega2560Yun_Iduino.upload.wait_for_upload_port=true
mega2560Yun_Iduino.upload.via_ssh=true
mega2560Yun_Iduino.upload.maximum_data_size=8192
mega2560Yun_Iduino.bootloader.tool=avrdude
mega2560Yun_Iduino.bootloader.low_fuses=0xff
mega2560Yun_Iduino.bootloader.high_fuses=0xd8
mega2560Yun_Iduino.bootloader.extended_fuses=0xfd
mega2560Yun_Iduino.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex
mega2560Yun_Iduino.bootloader.unlock_bits=0x3F
mega2560Yun_Iduino.bootloader.lock_bits=0x0F
mega2560Yun_Iduino.vid.0=0x2341
mega2560Yun_Iduino.pid.0=0x0044
mega2560Yun_Iduino.bi.upload.use_1200bps_touch=true
Now I am able to upload this following sketch..................................
#include <Console.h> //use Console class for Arduino IDE debug over WiFi, similar to Serial class,
String name;
void setup() {
// Initialize Console and wait for port to open:
Bridge.begin();
Console.begin();
// Wait for Console port to connect
while (!Console);
Console.println("Hi, what's your name?"); //Data flow: Arduino --> Yun Shield --> Arduino IDE
}
void loop() {
if (Console.available() > 0) {
char c = Console.read(); //read the next char received, data flow: IDE --> Yun Shield--> Arduino
// look for the newline character, this is the last character in the string
if (c == '\n') {
//print text with the name received
Console.print("Hi ");
Console.print(name);
Console.println("! Nice to meet you!");
Console.println();
// Ask again for name and clear the old name
Console.println("Hi, what's your name?");
name = ""; // clear the name string
}
else { // if the buffer is empty Console.read() returns -1
name += c; // append the read char from Console to the name string
}
}
}
But when I open the serial monitor in the arduino V1.6.11 IDE is dosnt connect and says is the sketch using the bridge?
I suspect there is a problem either with my sketch or the bridge or some uploading issue of the sketch, though it appears to upload correctly.
there is a section talking about bridge issues and sketch upload issues on this webpage but it seems very technical to me
http://www.geeetech.com/wiki/index.php/ ... Yun_Shield
I have spent 3 days trying to make this work, I have scoured the forums but I now submit to needing some help with this. As I mentioned I am new to this technology and I am sure I am missing something simple.
David
I now want to do this via wifi so I dont need the connected ethernet cable.
I have an Arduino Mega 2560 board and have placed the Iduino Yun shield V1.2 onto it,
I have been able to connect directly (Laptop<->iduino yun shield) via wifi to the shield and set it up and then reconnect via my home wifi network (Laptop<->wifi network WPA2<->iduino yun shield), this all seems to be working fine.
I have placed the jumper on the mega16u2 bridge mode reset pins on the Arduino mega 2560 board (though 1 site says you dont need to do that now)
I have uploaded sketches both directly from the arduino IDE and have also tried via hex file upload via the iduino yun shield settings page)
I have updated the Geeetech Iduino Yun shield (v1.2) to the dragino firmware V 2.0.7 (one site suggested this will help)
I initially had troubles updating the board.txt file but a great text editor called Boards.txt helped sort that out
I have added and tried both these settings for dragino and arduino in the board.txt file
##############################################################
mega2560Yun_Dragino.name=Arduino Mega 2560 -Dragino Yún
mega2560Yun_Dragino.build.mcu=atmega2560
mega2560Yun_Dragino.build.f_cpu=16000000L
mega2560Yun_Dragino.build.core=arduino:arduino
mega2560Yun_Dragino.build.variant=arduino:mega
mega2560Yun_Dragino.build.board=AVR_MEGA2560
mega2560Yun_Dragino.upload.tool=arduino:avrdude
mega2560Yun_Dragino.upload.protocol=arduino
mega2560Yun_Dragino.upload.maximum_size=258048
mega2560Yun_Dragino.upload.speed=57600
mega2560Yun_Dragino.upload.disable_flushing=true
mega2560Yun_Dragino.upload.use_1200bps_touch=true
mega2560Yun_Dragino.upload.wait_for_upload_port=true
mega2560Yun_Dragino.upload.via_ssh=true
mega2560Yun_Dragino.upload.maximum_data_size=8192
mega2560Yun_Dragino.bootloader.tool=arduino:avrdude
mega2560Yun_Dragino.bootloader.low_fuses=0xff
mega2560Yun_Dragino.bootloader.high_fuses=0xd8
mega2560Yun_Dragino.bootloader.extended_fuses=0xfd
mega2560Yun_Dragino.bootloader.file=arduino:stk500v2/stk500boot_v2_mega2560.hex
mega2560Yun_Dragino.bootloader.unlock_bits=0x3F
mega2560Yun_Dragino.bootloader.lock_bits=0x0F
mega2560Yun_Dragino.vid.0=0x2341
mega2560Yun_Dragino.pid.0=0x0044
mega2560Yun_Dragino.pid.1=0x003f
mega2560Yun_Dragino.vid.1=0x2341
##############################################################
mega2560Yun_Iduino.name=Arduino Mega 2560 -- Iduino Yún
mega2560Yun_Iduino.build.mcu=atmega2560
mega2560Yun_Iduino.build.f_cpu=16000000L
mega2560Yun_Iduino.build.core=arduino
mega2560Yun_Iduino.build.variant=mega
mega2560Yun_Iduino.build.board=AVR_MEGA2560
mega2560Yun_Iduino.upload.tool=avrdude
mega2560Yun_Iduino.upload.protocol=arduino
mega2560Yun_Iduino.upload.maximum_size=258048
mega2560Yun_Iduino.upload.speed=57600
mega2560Yun_Iduino.upload.disable_flushing=true
mega2560Yun_Iduino.upload.wait_for_upload_port=true
mega2560Yun_Iduino.upload.via_ssh=true
mega2560Yun_Iduino.upload.maximum_data_size=8192
mega2560Yun_Iduino.bootloader.tool=avrdude
mega2560Yun_Iduino.bootloader.low_fuses=0xff
mega2560Yun_Iduino.bootloader.high_fuses=0xd8
mega2560Yun_Iduino.bootloader.extended_fuses=0xfd
mega2560Yun_Iduino.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex
mega2560Yun_Iduino.bootloader.unlock_bits=0x3F
mega2560Yun_Iduino.bootloader.lock_bits=0x0F
mega2560Yun_Iduino.vid.0=0x2341
mega2560Yun_Iduino.pid.0=0x0044
mega2560Yun_Iduino.bi.upload.use_1200bps_touch=true
Now I am able to upload this following sketch..................................
#include <Console.h> //use Console class for Arduino IDE debug over WiFi, similar to Serial class,
String name;
void setup() {
// Initialize Console and wait for port to open:
Bridge.begin();
Console.begin();
// Wait for Console port to connect
while (!Console);
Console.println("Hi, what's your name?"); //Data flow: Arduino --> Yun Shield --> Arduino IDE
}
void loop() {
if (Console.available() > 0) {
char c = Console.read(); //read the next char received, data flow: IDE --> Yun Shield--> Arduino
// look for the newline character, this is the last character in the string
if (c == '\n') {
//print text with the name received
Console.print("Hi ");
Console.print(name);
Console.println("! Nice to meet you!");
Console.println();
// Ask again for name and clear the old name
Console.println("Hi, what's your name?");
name = ""; // clear the name string
}
else { // if the buffer is empty Console.read() returns -1
name += c; // append the read char from Console to the name string
}
}
}
But when I open the serial monitor in the arduino V1.6.11 IDE is dosnt connect and says is the sketch using the bridge?
I suspect there is a problem either with my sketch or the bridge or some uploading issue of the sketch, though it appears to upload correctly.
there is a section talking about bridge issues and sketch upload issues on this webpage but it seems very technical to me
http://www.geeetech.com/wiki/index.php/ ... Yun_Shield
I have spent 3 days trying to make this work, I have scoured the forums but I now submit to needing some help with this. As I mentioned I am new to this technology and I am sure I am missing something simple.
David