Skip to content

Commit

Permalink
Added url to post data, rssi and snr for received packet
Browse files Browse the repository at this point in the history
  • Loading branch information
jdenoy committed Dec 28, 2020
1 parent 3ab0f13 commit 1b04df1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/LoRa_APRS_iGate.cpp
Expand Up @@ -19,6 +19,8 @@
#include "display.h"
#include "configuration.h"

#include <HTTPClient.h>

#if defined(ARDUINO_T_Beam) && !defined(ARDUINO_T_Beam_V0_7)
#include "power_management.h"
PowerManagement powerManagement;
Expand Down Expand Up @@ -212,6 +214,14 @@ void loop()
{
std::shared_ptr<APRSMessage> msg = lora_aprs.getMessage();

const char* serverName = "http://www.jdlabs.fr/aprs-data/";
http.begin(serverName);
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
String httpRequestData = "msg="+msg->toString()+"&rssi="+String(lora_aprs.packetRssi())+"&snr="+String(lora_aprs.packetSnr());
// Send HTTP POST request
int httpResponseCode = http.POST(httpRequestData);
http.end();

setup_display(); secondsSinceDisplay = 0; display_is_on = true;
show_display(Config.callsign, timeClient.getFormattedTime() + " LoRa", "RSSI: " + String(lora_aprs.packetRssi()) + ", SNR: " + String(lora_aprs.packetSnr()), msg->toString());
logPrintD("[" + timeClient.getFormattedTime() + "] ");
Expand Down

0 comments on commit 1b04df1

Please sign in to comment.