Set up MQTT Gateway with asksensors platform

Just started working with the MQTT Publish/Subscribe API and I’m trying to setup with the PR55-21 MQTT gateway. I already have other IOT devices working (succesfully) with esp32’s using HTTPS but going forward I’d like to merge everything to MQTT and NCD.io devices.

At the moment I’m starting with the MQTT gateway and a PR55-19A(2 channel thermocouple).

asksensors uses these settings for their broker:
mqtt_server = “mqtt.asksensors.com”;
mqtt_port = 1883;

AskSensors topic is structured in the following way: "publish/username/apiKeyIn"

  • username: AskSensors username.
  • apiKeyIn: The sensor Api Key In generated by AskSensors during the creation of your sensor

**Asksensor MQTT for reference: Asksensors MQTT API

So my questions are the following:
-Can I change the message settings to follow “asksensors API topic structure” ?
and if so do I just change change Sensor Topic Format: or do I have to change all of them?

First time working with MQTT so I may be missing something obvious

Thanks in advance

Hi,

I apologize for not getting back with you sooner. I’m not sure how I missed this post.

The topic structure seems like it is fairly straight forward and easy to implement. You would just set both Gateway Topic Format and Sensor Topic Format to publish/username/apiKeyIn.

However Asksensors documentation on payload seems to follow a format generally used for sending variables over an HTTP Get Request(m1=value1&m2=value2...m6=value6). This I would say is non standard for MQTT as a whole as most MQTT brokers/IoT Cloud providers expect a JSON formatted string as the payload data. There is no “defacto” standard for MQTT Message payload but every IoT cloud system I have worked with expects message payloads as JSON formatted strings. When I say every one I have worked with I mean AWS IoT, Microsoft Azure, Google IoT, Losant, BeeBotte, UbiDots, etc so that’s a pretty long list of large IoT cloud services that expect JSON formatted payloads which is why our MQTT Gateway sends it’s sensor telemetry data in JSON format. I have never worked with Asksensors in the past so I don’t know how large they are but you might reach out to them and see if it’s possible to send MQTT messages with a JSON formatted payload.

Thanks for the reply,
I’ll try to get it working with asksensors. If they can’t get it to work with JSON formatted string I’ll have to consider going with another IoT cloud service. Ive looked into Beebotte and Ubidots and they both seem like good options for what I’m looking for in an IoT cloud service
Any recommendations on what cloud services would be best for quick deployment and dashboard creation in case i have to pivot?

@ameritex I highly recommend Ubidots.