14. On the MQTT tab set the following:
a. MQTT Enable to Enable with TLS or Enable with TLS-Mutual Authentication
b. MQTT Broker URL to the Endpoint address that you copied, saved, or noted. See
Setup AWS IoT(p. 124) step 3.
c. Enter 8333 for the Port Number.
d. MQTT Client ID to the Thing name set in Setup AWS IoT(p. 124) step 8.
e. MQTT Base Topic is the Publish Policy set in Setup AWS IoT(p. 124) step 10.
15. Click Apply to save the changes.
Program the data logger
Use MQTTPublishTable() within a DataTable/EndTable declaration to publish stored
data via MQTT. See the CRBasic Editor help for detailed instruction information and program
examples: https://help.campbellsci.com/crbasic/cr300/ .
DataTable(Five_Min,True,-1)
DataInterval(0,5,Min,10)
Average(1,Temp_C,FP2,False)
Minimum(1,BattV,FP2,False,False)
Publish every 5 min in CSJSON format. The last three
parameters are optional to specify longitude, latitude, and
altitude. Here we use NaN as placeholders for these values.
MQTTPublishTable(0,0,5,Min,1,NaN,NaN,NaN)
EndTable
Five minutes is the fastest recommended publishing interval in order to ensure that ingestion and
processing of data sent to the MQTT broker are completed before new data is received.
Verify data in AWS IoT
1. In AWS IoT click MQTT test client > Subscribe to a topic.
2. Enter a # symbol (wildcard) in the Topic filter field. Click Subscribe.
19. Communications protocols132