Arduino UNO Wifi - http post request (JSON)


I need to send the data captured from arduino uno wifi to the server using http post (REST) request.
Would like to understand the options available to trigger http post request (rest) other than "ciao" for "Arduino UNO Wifi".

Appreciate your soonest reply.


you can change the firmware to WiFi Link. I made the Uno WiFi a usable board with Serial1 library

Thanks Juraj,

How to perform a POST request and pack the parameters (JSON) in request body.

Also i am unable to compile the code, below is the error details,
Board selected = Arduino Uno Wifi

WiFiLinkWebClient:21: error: within this context

WiFiLinkWebClient:21: error: no matching function for call to 'WiFiClass::init(UnoWiFiDevEdSerial1*)'


did you change the firmware?

do not use the WiFi Link library version 1.0 from Library Manager with Serial1. use the github version 1.1 referred in Serial1 readme and WiFi Link firmware readme

I need to update the firmware with this "arduino-firmware-wifilink/ArduinoFirmwareEsp at master · JAndrassy/arduino-firmware-wifilink · GitHub" before uploading?

I will try with the new 1.1 currently it is installed 1.0.1 from the library manager. I cannot find 1.1 in the lib manager.

UNO WiFi with WiFi Link firmware

I cannot find 1.1 in the lib manager.

only repository maintainer can publish new version of this library. but there is no one for now.

I replaced the Wifilink and it builds now.

  1. I first need to flash the firmware from this git "arduino-firmware-wifilink/ArduinoFirmwareEsp at master · JAndrassy/arduino-firmware-wifilink · GitHub".

  2. Upload the wifilinkwebclient to the board.

  3. Could you help how to trigger a post request with paramters (json).



WiFiLinkWebClient example from Uno_WiFi_Developer_Edition_Serial1 is working? prints the logo?

your server is ready? what is the url? do you have an example of the json string?

Flashed the firmware (the above git)

Uploaded the wifiLinkWebClient code,

i see the program freezes at the below line.

while (WiFi.status() != WL_CONNECTED) {

did you configure WiFi Link with WebPanel?

yeah it is configured and an ip address is also assigned.

Still it does not work. :frowning:

make please a screenshot of WebPanel for me

attached the screen shot

looks good. and can you show me your config.h from firmware?



  • Firmware version and build date

#define BUILD_DATE "20170509"
#define FW_VERSION "1.0.1"
#define FW_NAME "wifilink"


  • Define board model name

//#define STAROTTO
//#define PRIMO
//#define UNOWIFI


  • Enable/Disable Debug

//#define DEBUG
//#define BAUDRATE_DEBUG 115200


  • Define board hostname

#define DEF_HOSTNAME "arduino"


  • Defines the communication channel between microcontroller
  • and esp82266, with concerning parameters

//#define HOSTNAME "arduino" //used by mdns protocol

#if defined(STAROTTO)
//Arduino STAR OTTO configuration parameters
#define ARDUINO_BOARD "star_otto" //mdns
#define ESP_CH_UART
#define WIFI_LED 14
#define SSIDNAME "Arduino-Star-Otto"
#elif defined(PRIMO)
//Arduino PRIMO configuration parameters
#define ARDUINO_BOARD "primo" //mdns
#define ESP_CH_SPI
#define WIFI_LED 2
#define SSIDNAME "Arduino-Primo"
#elif defined(UNOWIFI)
//Arduino PRIMO configuration parameters
#define ARDUINO_BOARD "unowifi" //mdns
#define ESP_CH_SPI
#define WIFI_LED 2
#define SSIDNAME "Arduino-Uno-WiFi"
#elif defined(UNOWIFIDEVED)
//Arduino UNO WIFI DEV. EDITION configuration parameters
#define ARDUINO_BOARD "unowifi" //mdns
#define ESP_CH_UART
#define WIFI_LED 14
#define SSIDNAME "Arduino-Uno-WiFi"

not the right wifilink. use 1.1.0 from here. how did you end up with 1.0.1? have I someware in docs a wrong link?

Works fine now, thanks :slight_smile:

Not sure, i think i had a copy of older version before and i did not make it point to verify with the new link, my bad.

Regarding the post request, say we have the api similar to this here.

It takes below parameters and also returns the same.
"ID": 0,
"UserName": "string",
"Password": "string"


post request

  if (client.connect(server, 80)) {
    client.println("POST /api/Users HTTP/1.1");
    client.print("Host: ");
    client.println("Connection: close");

to build json string you can use ArduinoJson library (is in Library Manager with examples)

or build the string with sprintf

	char data[50];
	sprintf(data, "{\"i\":%i,\"t\":%lu,\"v1\":%d,\"v2\":%d,\"c\":%u}", ix, events[ix].timestamp, events[ix].value1, events[ix].value2, events[ix].count);

(it is a snippet from my project)

Thanks it works.

Have a question,

code snippet:

char data[100];
DynamicJsonBuffer jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["ID"] = 10;
root["UserName"] = "user1";
root["Password"] = "123456";
sprintf(data, "{"ID":10,"UserName":"user1","Password":"123456"}");

Serial.println("Connected to server");
client.println("POST /api/Users HTTP/1.1");
client.println("content-type: application/json");
client.print("content-length: ");
client.print("Host: ");
client.println("Connection: close");
// root.prettyPrintTo(client);
// client.println();

  1. The code works fine if i send the json object store in data.
  2. But it does not work when i use the root variable. I use the below code lines to post data,
  3. how can i extract only the data part from the response and discard other headers section.