Hello everyone,
I'm using a CR300 DataLogger in an Azure IoT project. After collecting data from sensors I was able to send data to IoT Hub over HTTP protocol, using the CRBasic HTTPPost() command. Azure IoT hub allows D2C messages to be sent over HTTP, AMQP or MQTT.
I'm more interested more in using the MQTT protocol. Had anyone tried, or succeeded to send messages over MQTT from CRBasic until now? If yes, please provide me with a short example, or any other hints.
Thanks in advance!
Could you post your CRBASIC code for this?
In the next release of the CR1000X and CR6 OS (coming soon), there will be some new CRBasic instructions that will make working with MQTT easier. This functionality in the CR300 will come in a future release (no specific dates on when yet).
HTTP capabilities to interact with cloud or web-based APIs are already in the operating systems. For an example, look at https://www.campbellsci.com/blog/post-cr6-data-to-weather-underground. There is example CRBasic code you can look at there.
I am curious if you were successful using an Azure IoT project. I am working with a CR6 attempting something similar. How did you do it? Any example code, hints, or advice would be much appreciated!