Forum >WiFi Shield V2.2 stack with arduino leonardo
WiFi Shield V2.2 stack with arduino leonardo

Hi all , i've bought Wifi Shield V2.2 and going to make project with this stuff, i use arduino leonardo for the controller. i have a problem to configure wiznet modul, i have set the shield to USB mode by switch it, but i cant connect the AT mode on my serial terminal , i have try the tutorial but it doesnt work, can anybody help me :(
2013-04-05 22:24:35 Thx Lauren for your attention, i've tried to upload that code to leonardo before stack my wifi shield into it, then i switched to usb mode, and set my serial terminal in this case i used putty, but when i tried the at command there's no respond, and the assoc and stw indicator still down, as i know that when i type "at" (without string) i suppose to get the reply [OK] in the terminal but im not, could you help me please, sorry for my bad english , regard
priangga

2013-04-04 12:52:18 Hey,
I was reading about the same issue and came up with your solution. It works! The only thing is that I needed to set the USB/Arduino switch on the DFRobot wifi shield V2.2 to "Arduino."
Regards!
dtwong
I was reading about the same issue and came up with your solution. It works! The only thing is that I needed to set the USB/Arduino switch on the DFRobot wifi shield V2.2 to "Arduino."
Regards!

2013-02-21 00:17:51 Hi,
Wow, the reason is the Leonardo have two serial interface. However the Arduino Uno just one serial port which is shared using by USB and D0,D1. So you need to upload a simple code to create the communication between USB port to D0 and D1 on the Arduino Leonardo. Here's a sample code got from google.
I checked it. I think it should work for you. Please try it!
[code]/*
leo_usb2serial
Allows to use an Arduino Leonardo as an usb to serial converter.
*/
static long baud = 115200;
static long newBaud = baud;
// this pin will output the DTR signal (as set by the pc)
#define DTR_PIN 13
#define LINESTATE_DTR 1
void lineCodingEvent(long baud, byte databits, byte parity, byte charFormat)
{
newBaud = baud;
}
void lineStateEvent(unsigned char linestate)
{
if(linestate & LINESTATE_DTR)
digitalWrite(DTR_PIN, HIGH);
else
digitalWrite(DTR_PIN, LOW);
}
void setup() {
pinMode(DTR_PIN, OUTPUT);
digitalWrite(DTR_PIN, LOW);
Serial.begin(baud);
Serial1.begin(baud);
}
void loop() {
// Set the new baud rate
// if(newBaud != baud) {
// baud = newBaud;
// Serial1.end();
// Serial1.begin(baud);
// }
// copy from virtual serial line to uart and vice versa
if (Serial.available()) {
char c = (char)Serial.read();
Serial1.write(c);
}
if (Serial1.available()) {
char c = (char)Serial1.read();
Serial.write(c);
}
}[/code]
Look forward to your testing result! ;)
Regards,
Lauren
Lauren
Wow, the reason is the Leonardo have two serial interface. However the Arduino Uno just one serial port which is shared using by USB and D0,D1. So you need to upload a simple code to create the communication between USB port to D0 and D1 on the Arduino Leonardo. Here's a sample code got from google.
I checked it. I think it should work for you. Please try it!
[code]/*
leo_usb2serial
Allows to use an Arduino Leonardo as an usb to serial converter.
*/
static long baud = 115200;
static long newBaud = baud;
// this pin will output the DTR signal (as set by the pc)
#define DTR_PIN 13
#define LINESTATE_DTR 1
void lineCodingEvent(long baud, byte databits, byte parity, byte charFormat)
{
newBaud = baud;
}
void lineStateEvent(unsigned char linestate)
{
if(linestate & LINESTATE_DTR)
digitalWrite(DTR_PIN, HIGH);
else
digitalWrite(DTR_PIN, LOW);
}
void setup() {
pinMode(DTR_PIN, OUTPUT);
digitalWrite(DTR_PIN, LOW);
Serial.begin(baud);
Serial1.begin(baud);
}
void loop() {
// Set the new baud rate
// if(newBaud != baud) {
// baud = newBaud;
// Serial1.end();
// Serial1.begin(baud);
// }
// copy from virtual serial line to uart and vice versa
if (Serial.available()) {
char c = (char)Serial.read();
Serial1.write(c);
}
if (Serial1.available()) {
char c = (char)Serial1.read();
Serial.write(c);
}
}[/code]
Look forward to your testing result! ;)
Regards,
Lauren
