Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kalindud
New Member

Streaming with ESP8266

Hello,

 Is it possible to stream data using a ESP8266 Module directly to the API Link?

 

Im using the following code.

#include <ArduinoJson.h>

#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>


 
void setup() {
 
  Serial.begin(115200);                                  //Serial connection
  WiFi.begin("DiAlOg-1", "dialog456@");   //WiFi connection
 
  while (WiFi.status() != WL_CONNECTED) {  //Wait for the WiFI connection completion
 
    delay(500);
    Serial.println("Waiting for connection");
 
  }
 
}
 
void loop() {
 
 if(WiFi.status()== WL_CONNECTED){   //Check WiFi connection status
 
   HTTPClient http;    //Declare object of class HTTPClient
 
   

    const size_t bufferSize = JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(2);
    DynamicJsonBuffer jsonBuffer(bufferSize);
    
    JsonArray& root = jsonBuffer.createArray();
    
    JsonObject& root_0 = root.createNestedObject();
    root_0["Value1"] = 100;
    root_0["Value2"] = 200;

  
    char JSONmessageBuffer[300];
    root.prettyPrintTo(JSONmessageBuffer, sizeof(JSONmessageBuffer));
    Serial.println(JSONmessageBuffer);

    http.begin("https://api.powerbi.com/beta/852c5799-8134-4f15-9d38-eba4296cc76f/datasets/6014dfc1-93f3-42bb-8ae8-7ec52b051bc8/rows?key=kcW8AI0bvDrT%2BukEOZSFfRxh39HqH0z8hNNPqMqB2PlzlAXvwtw8S9CLCnga3g4tiz2vSonttPDHKfbmNkEUYA%3D%3D");     
    http.addHeader("Content-Type", "application/json");  
 
     int httpCode = http.POST(JSONmessageBuffer);
 
 
   http.end();  //Close connection
 
 }else{
 
    Serial.println("Error in WiFi connection");   
 
 }
 
  delay(1000);  //Send a request every 30 seconds
 
}

And this is the serial Output:

[
  {
    "Value1": 100,
    "Value2": 200
  }
]
[
  {
    "Value1": 100,
    "Value2": 200
  }
]

 

 

It doesn't show any value in the dashboard.. Should this work? What am i doing wrong?

I followed the following tutorial, but instead of the Raspberry Pi, Im using a ESP8266.

https://www.youtube.com/watch?v=0YIBHfgasok

(see 30:50)

 

Your help is much appreciated. thank you.

 

 

 

5 REPLIES 5
Anonymous
Not applicable

@kalindud did you manage to do it?

 

Been trying to do it myself but can't make the response to reach power Bi....

Anonymous
Not applicable

Hi @kalindud,

 

I think it is possible to use device to send data if you can achieve below prerequisite:
1. Power bi account and stream api url.
2. Device can access to website, support programming and send data to network.

 

How did you setting steaming tile, please share more detail information. (Notice: current streaming dataset not works for normal tiles and visuals)

5.PNG

 

 

BTW, you need to check your data formula if it not similar as sample data shows.

Create Dataset

 

Regards,

Xiaoxin Sheng

Hello,

 


BTW, you need to check your data formula if it not similar as sample data shows.

Create Dataset



 

 What do u mean by this?

 

 

And yes I created a Streaming Data tile like you shown in the screenshot. It didnt get any values.

Any help? Should my code work?

 

Thank you!

Anonymous
Not applicable

Hi @kalindud,

 

I'd like to suggest you copy your formula and debug on PC side, if power bi can analytics your data, it means you send-up correct format data.(issue may related to device, for e.g. lite version of dlls or others)


Otherwise I think you need to correct data format first.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

@Anonymous can you help please?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.