@@ -376,34 +376,6 @@ bool FirmwareVersionCheck( char *firmware_latest, String firmware_ota_url ) {
376
376
}
377
377
378
378
379
- void GetGeoCoordinates ( float *, float *);
380
- void GetGeoCoordinates ( float *latitude, float *longitude) {
381
- HTTPClient http;
382
- #define GEOCOORD_APIKEY " 9f0acd1eb4c51704c2f4429be20ba4c6"
383
- http.begin ( " http://api.ipstack.com/check?access_key=9f0acd1eb4c51704c2f4429be20ba4c6" );
384
- int httpResponseCode = http.GET ();
385
- Serial.print (" GetGeoCoordinates() ipstack HTTP Response code: " );
386
- Serial.println (httpResponseCode);
387
- String payload = http.getString ();
388
- http.end (); // free resources
389
- Serial.print (" ipstack HTTP get response payload: " );
390
- Serial.println ( payload );
391
-
392
- if ( httpResponseCode == 200 ) { // Success
393
- DynamicJsonDocument ReceiveDoc (900 );
394
- DeserializationError err = deserializeJson (ReceiveDoc, payload);
395
- if (err) {
396
- Serial.print (F (" deserializeJson() failed with code : " ));
397
- Serial.println (err.c_str ());
398
- } else {
399
- JsonObject GeoCoordData = ReceiveDoc.as <JsonObject>();
400
- *latitude = GeoCoordData[" latitude" ];
401
- *longitude = GeoCoordData[" longitude" ];
402
- }
403
- }
404
- }
405
-
406
-
407
379
// Call the OpenEEW Device Activation endpoint to retrieve MQTT OrgID
408
380
bool OpenEEWDeviceActivation () {
409
381
// OPENEEW_ACTIVATION_ENDPOINT "https://openeew-earthquakes.mybluemix.net/activation?ver=1"
@@ -412,14 +384,6 @@ bool OpenEEWDeviceActivation() {
412
384
Serial.println (" Contacting the OpenEEW Device Activation Endpoint :" );
413
385
Serial.println (OPENEEW_ACTIVATION_ENDPOINT);
414
386
415
- /*
416
- float lat, lng ;
417
- GetGeoCoordinates( &lat, &lng );
418
- Serial.print("GetGeoCoordinates() reported latitude,longitude : ");
419
- Serial.print(lat,5);
420
- Serial.print(",");
421
- Serial.println(lng,5);
422
- */
423
387
HTTPClient http;
424
388
// Domain name with URL path or IP address with path
425
389
http.begin ( OPENEEW_ACTIVATION_ENDPOINT );
@@ -431,9 +395,7 @@ bool OpenEEWDeviceActivation() {
431
395
// '{"macaddress":"112233445566","lat":40.00000,"lng":-74.00000,"firmware_device":"1.0.0"}'
432
396
DynamicJsonDocument httpSendDoc (120 );
433
397
String httpRequestData;
434
- httpSendDoc[" macaddress" ] = deviceID;
435
- // httpSendDoc["lat"] = lat;
436
- // httpSendDoc["lng"] = lng;
398
+ httpSendDoc[" macaddress" ] = deviceID;
437
399
httpSendDoc[" firmware_device" ] = OPENEEW_FIRMWARE_VERSION;
438
400
// Serialize the entire string to be transmitted
439
401
serializeJson (httpSendDoc, httpRequestData);
0 commit comments