Home > other >  Give the cloud data sent via the MQTT ESP8266
Give the cloud data sent via the MQTT ESP8266

Time:09-22

8266 how to obtain a serial port data passed to the cloud, MQTT active on my code is:
Uart_test_rx ()
{
If (, uart_buf==1)
{
BstyunReady=true;
//os_memcpy (Mqtt_Send_Buff uart_buf, len);
Memset (uart_buf, 0, sizeof (uart_buf));
Os_sprintf (uart_buf, "tahao \ r \ n", sizeof (" nihao \ r \ n "));
Tx_buff_enq (uart_buf, strlen (" nihao \ r \ n "));
//MQTT_Publish (client, "/MQTT/topic/0", "LED the status is off... "
//strlen (" LED status is off... "), 0, 0);

}
Void mqttPublishedCb (uint32_t * args)
{
Uint8 uart_buf [128]={0};
MQTT_Client * client=(MQTT_Client * args;
If (bstyunReady)
{
BstyunReady=false;
Os_sprintf (uart_buf, "pphao \ r \ n", sizeof (" pphao \ r \ n "));
Tx_buff_enq (uart_buf, strlen (" pphao \ r \ n "));
MQTT_Publish (client, "/MQTT/topic/1", "LED the status is open... "
Strlen (" LED the status is open... "), 0, 0);
}
INFO (" MQTT: Published \ r \ n ");
}
But why can't upload the cloud???

CodePudding user response:

The need to do a function

CodePudding user response:

How to transmit sensor data from Bosch XDK110 evaluation board to MQTT messaging service: https://www.yiboard.com/thread-848-1-1.html
  • Related