Node MQTT.js
If you are using Node MQTT, please refer to the example code below. First, download the certificate.zip file and place the decompressed private.pem.key, certificate.pem.crt, and AmazonRootCA1.pem files in the same path as the following program. Then, enter the variables KEY, CERT, and TRUSTED_CA_LIST in the program.
Please enter the HOST in the program, which can be found in the upper right corner of the document page. As for the topic, please check the "topic" document page. The "data" should be converted to a string using JSON.stringify, and the data format can be found in the documentation. As for Port, Please use 8883.
Last updated