Communication between Microsoft Azure and ESP32. About reference method of transfer value of Ardino

Theme

Communication between Microsoft Azure and ESP32.

About reference method of transfer value of Ardino

Q

The values ​​randomly entered in one variable are as follows:

I want to display it correctly in stream analytics of MICROSOFT AZURE, but the reference of the value does not work

There is a strange value. What should I do now?

phenomenon

"IOTA0 = analogRead(A0);

IOTA6 = analogRead(A6);

The analog value was captured by ”.

“Snprintf(buff, 128, “{"IOTA0":%d,"IOTA6":%d}”);”

And

In the “Ardino” loop function in Esp32MQTTClient.h

(Trying to process with Esp32MQTTClient_SendEvent(buff).

This is going to be transferred to Azure.

Results The communication results were reflected in Azure’s stream analytics.

But different from the analog value, it should be 0 correctly,

Display a value like 299999.

It does not change even if the analog input value is changed.

Therefore, it does not seem to be referenced correctly.

Here

Esp32MQTTClient_SendEvent (buff).

To

Esp32MQTTClient_SendEvent (& buff [0]).

If you do

It worked.

after

Understand json format,

If you write it, you can send it.

Program example (This program is operating normally after confirming transmission and reception on WINDOWS AZURE)

#include <stdio.h>

#include <String.h>

#include <WiFi.h>

#include “Esp32MQTTClient.h”

loop ()

{

“Omitted”

Char A [150]

snprintf (A, 150, "{" NO1 \ ": " 202009 \ ", " NO2 \ ":% 4d, " NO3 \ ":% 4d, ":% 4d, \ "NO4 ": \ "NG "} ", tempreature, sumtime, flow, pressure, Status_);

if (Esp32MQTTClient_SendEvent (& A [0])) {}

“Omitted”

}

==========

NEWQUESTION

「 Communication with AMQP protocol and communication with HTTP protocol with ESP32-WROOM-32D (4MB) 」

Transmission format JSON

Currently transmission protocol MQTT

this

Currently, I would like to replace it with the transmission protocol AMQT or HTTP protocol.

What should I do for this?

please tell me.

Hope is Arduino.

If it is not possible, you can use other software.

However, it is necessary to be able to write software only serially like Arduino.