6 years, 4 months ago.

I don't have any feedback from my WizFi250 v1.1

Hello Everyone, I really need help. I'm having trouble with my wifi shield and my mbed C027 board and can't find where is the issue. I've written the code to send AT commands but still not getting response after any of them. bellow is my code for an "AT" command. Expecting an [OK] but nothing comes out on my putty screen. The WizFi250 shield is mounted on the C027 boot jumper is not connected, and Wifi_Tx is on D0 and Wifi and Wifi_Rx on D1,

  1. include "mbed.h"
  2. include "stdlib.h"
  3. include <BufferedSerial.h>

/ On some platforms USBTX/USBRX overlaps with serial on D1/D0 pins and this may interrupt the communication.

  • You can comment it and use an LCD display to print the values or store them on an SD card etc.
  • / Serial pc(USBTX, USBRX); Serial wifi(D1, D0); DigitalOut reset(D5); Timer t,t1;

int count,ended,timeout; int getcount, replycount; int begin, end, i=1;

char buf[1024]; char snd[255]; char replybuff[1024]=" ";

char command[9]; int err;

DigitalOut led1(LED1); LED1 DigitalOut led2(LED2); LED2 DigitalOut led3(LED3); LED3 DigitalOut led4(LED4); LED4

void checkFonction();

int main() {

reset=1; led1.write(1); wifi.baud(115200); pc.baud(115200);

pc.printf("Envoie des commnandes AT! \n"); strcpy(snd,"AT\r"); wifi.printf(snd); wait(1); pc.printf("%s", snd) ; checkFonction(); pc.printf("\n\n");

}

void checkFonction() {

timeout=30; getcount=1000; end=0; memset(replybuff, '\0', sizeof(replybuff));

t1.reset(); t1.start(); replycount=0; begin = t1.read(); while((replycount<getcount)&&(end<timeout)) { if(wifi.readable()) { replybuff[replycount] = wifi.getc(); replycount++; } end = t1.read(); } pc.printf("%s", replybuff); t1.stop();

}

Thanks in advance.

Question relating to:

Be the first to answer this question.