I have successfully implemented the Monarch Go Workshop: Part 2: Introduction to Azure IoT Central Out of Box Example solution, which uses the Avnet/Monarch-AzureAWS-OOB (github.com), the AES-NXP-MNRCH-M1-DK-G by Avnet Engineering Services Evaluation & Development Kits | Avnet (incorporating the Monarch Go device), a Verizon ThingSpace connection and an Azure IoT Central App. However, as I also need GPS location data provided to the Azure IoT Central App, I have swopped out the Monarch Go device with a Monarch Go GPS device. The problem, however, is that the Avnet/Monarch-AzureAWS-OOB (github.com) app hard-codes the latitude and longitude values in the msft_Azure_IoT.c at lines 111-119:
111 #define Device_Location_Telemetry_JSON \
112 "{" \
113 "\"Location\":" \
114 "{" \
115 "\"lat\": %.6f, " \
116 "\"lon\": %.6f, " \
117 "\"alt\": %.6f" \
118 "}" \
119 "}"
...and lines 126-129:
126 // Avnet set as default map location
127 double lat = 33.42745;
128 double lon = -111.98213;
129 double alt = 0;
If I understand the following code correctly, Device_Location_Telemetry_JSON is updated periodically, at line 1197 and the data is sent out via the Monarch device.
1189 case AZURE_SM_PUB_LOC_TELEMETRY:
1190 vTaskDelay(pdMS_TO_TICKS(1000));
1191
1192 memset(&(xPublishParameters), 0x00, sizeof(xPublishParameters));
1193 memset(cTopic, 0, sizeof(cTopic));
1194 memset(cPayload, 0, sizeof(cPayload));
1195
1196 sprintf(cTopic, AZURE_IOT_TELEMETRY_TOPIC_FOR_PUB, clientcredentialAZURE_IOT_DEVICE_ID);
1197 sprintf(cPayload, Device_Location_Telemetry_JSON, lat, lon, alt);
I'd appreciate help in determined how I can modify the above code to access the Monarch Go GPS's location data (latitude and longitude). Do I need to use AT+ commands, etc.?
Thanks.