ArduinoGeneral

WIFI Shield V3 : receive httprequest - sample code

userHead dakota77vfr 2018-09-07 03:44:00 3178 Views2 Replies
Hello
I would like to use Wifi shield V3 and Arduino UNO to receive httprequest from smartphone or laptop.
I can connect to the Wifi shield interface and set it to fixed IP adress 192.168.0.99
Ping is working.
I didn't find any documentation about the code I have to upload to receive data from Httprequest.
https://www.dfrobot.com/wiki/index.php/ ... KU:TEL0078
For example I want to send the string F1 : I send the httprequest 192.168.0.99/F1
Could you indicate where I can find a sample code ?
This is the working code used with an Arduino Uno wifi :
Code: Select all
#include <SoftwareSerial.h>// import the serial library
#include <stdio.h>          /* printf */
#include <stdlib.h>         /* strtol */
#include <ArduinoWiFi.h> 
#include <Wire.h>     
 
char txc[20];
String readString; //create readString class

void setup()
{ //======= Pour réception commandes en WIFI =============================
  Serial.begin(9600);
  Wifi.begin();  
  Wire.begin(4); // Rejoindre le bus à l'adresse #4
  readString = "";
  Serial.println("Arduino Wifi Started");
}
 
void loop()
{   
  while(Wifi.available()){proc1(Wifi);}
} 

void proc1(WifiData client) {
  String command = client.readStringUntil('/');
  readString = client.readStringUntil('/');
  Serial.print("Received string : ");
  Serial.println(readString);
  client.println("Status: 200 OK\n");
}
Thanks for your help
2018-09-07 21:58:51 It is difficult to use a board with so little information.
I suppose I have to use a specific library...
userHeadPic dakota77vfr
2018-09-07 11:10:45 Hi
Sorry.There is no more sample code.
userHeadPic makermuyi