mqtt publish json

5 years 5 months ago #3272 by Zaitsev
mqtt publish json was created by Zaitsev
I've just implemented mqtt small library for m590 + arduino Pro Mini and tested it. Working fine but although it was possible to publish one value I failed to publish JSON. I tried samples for JSON + MQTT provided with google but failed. So my questions to admin:
1. Is this feature implemented?
2. With which mqtt topic It works?
3. In module #1 I want to change sensor "T". Could you please provide working JSON sample { "T" : 12345 }

Please Log in or Create an account to join the conversation.

5 years 5 months ago #3277 by EasyIoT
Replied by EasyIoT on topic mqtt publish json

Zaitsev wrote: I've just implemented mqtt small library for m590 + arduino Pro Mini and tested it. Working fine but although it was possible to publish one value I failed to publish JSON. I tried samples for JSON + MQTT provided with google but failed. So my questions to admin:
1. Is this feature implemented?
2. With which mqtt topic It works?
3. In module #1 I want to change sensor "T". Could you please provide working JSON sample { "T" : 12345 }


You did not tell which platform do you use? Cloud or Server? They are different. In Cloud you have REST API and MQTT broker. If you are using MQTT on Cloud why do you want to publish JSON? Just send value and it will bi displayed on WB interface. If you are using REST API V1, then you can use JSON to post data.

Please Log in or Create an account to join the conversation.

5 years 5 months ago #3278 by Zaitsev
Replied by Zaitsev on topic mqtt publish json
1. I use Cloud platrform and have to save RAM and ROM because I use Atmega168 with 16k ROM and 1k RAM. Also I have to save battery life and network traffic. So I tried to place all my sensors' data into one package using JSON in MQTT, folowing Edwin Kester, whose SIM800_MQTT library I used as starting point for my one, but failed.
2. I am not sure, but Rest API does not provide QoS reply, am I rigth? I employ QoS=1.

Please Log in or Create an account to join the conversation.

5 years 5 months ago #3279 by EasyIoT
Replied by EasyIoT on topic mqtt publish json
I do not know if I understand you. If you want just send sensor values to Cloud I recommend you to use REST API.
In V1.0 you can set more sensor values with one call.

iot-playground.com/blog/2-uncategorised/...-cloud-rest-api-v1-0
See function 3.22 Set parameter values, see library on github how to use it.

Please Log in or Create an account to join the conversation.

5 years 5 months ago - 5 years 5 months ago #3280 by Zaitsev
Replied by Zaitsev on topic mqtt publish json
As I understand your MQTT server does not support
JSON publishing via MQTT protocol
now. Am I right?

Please Log in or Create an account to join the conversation.

Time to create page: 0.255 seconds

Forum latest

  • No posts to display.