kopia lustrzana https://github.com/PiInTheSky/lora-gateway
Allow custom specification of radio as well as antenna.
rodzic
0a7ada4260
commit
1db97cfbc5
|
@ -75,6 +75,7 @@ The configuration is in the file gateway.txt. Example:
|
|||
ServerPort=6004
|
||||
Latitude=51.95023
|
||||
Longitude=-2.5445
|
||||
Radio=LoRa RFM98W
|
||||
Antenna=868MHz Yagi
|
||||
|
||||
frequency_0=434.347
|
||||
|
@ -121,6 +122,7 @@ The global options are:
|
|||
|
||||
Latitude=<decimal position>
|
||||
Longitude=<decimal position>. These let you tell the gateway your position, for uploading to habitat, so your listener icon appears on the map in the correct position.
|
||||
Radio=<radio make/model>. Lets you specify your radio/board make/model or type. This appears on the map if your listener icon is clicked on.
|
||||
Antenna=<antenna make/model>. Lets you specify your antenna make/model or type. This appears on the map if your listener icon is clicked on.
|
||||
|
||||
NetworkLED=<wiring pi pin>
|
||||
|
@ -250,6 +252,10 @@ Many thanks to David Brooke for coding this feature and the AFC.
|
|||
Change History
|
||||
==============
|
||||
|
||||
19/03/2021 - V1.8.43mbb
|
||||
--------------------
|
||||
Added radio setting to gateway.txt
|
||||
|
||||
07/03/2021 - V1.8.43
|
||||
--------------------
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
tracker=YOUR_CALLSIGN
|
||||
Latitude=0.0
|
||||
Longitude=0.0
|
||||
Antenna=Watson W-50
|
||||
Radio=Your radio
|
||||
Antenna=Your antenna
|
||||
|
||||
|
||||
##### Config Options #####
|
||||
|
|
|
@ -2083,6 +2083,7 @@ void LoadConfigFile(void)
|
|||
// Listener
|
||||
RegisterConfigDouble(MainSection, -1, "Latitude", &Config.latitude, NULL);
|
||||
RegisterConfigDouble(MainSection, -1, "Longitude", &Config.longitude, NULL);
|
||||
RegisterConfigString(MainSection, -1, "radio", Config.radio, sizeof(Config.radio), NULL);
|
||||
RegisterConfigString(MainSection, -1, "antenna", Config.antenna, sizeof(Config.antenna), NULL);
|
||||
|
||||
// Dev mode
|
||||
|
|
1
global.h
1
global.h
|
@ -138,6 +138,7 @@ struct TConfig
|
|||
int HABChannel; // LoRa Channel for uplink
|
||||
int DataPort; // Raw received data packet port
|
||||
char SMSFolder[64];
|
||||
char radio[64];
|
||||
char antenna[64];
|
||||
int EnableDev;
|
||||
char UplinkCode[64];
|
||||
|
|
|
@ -13,7 +13,7 @@ size_t write_data( void *buffer, size_t size, size_t nmemb, void *userp )
|
|||
return size * nmemb;
|
||||
}
|
||||
|
||||
void UploadListenerTelemetry( char *callsign, time_t gps_time, float gps_lat, float gps_lon, char *antenna )
|
||||
void UploadListenerTelemetry( char *callsign, time_t gps_time, float gps_lat, float gps_lon, char *radio, char *antenna )
|
||||
{
|
||||
char time_string[20];
|
||||
struct tm * time_info;
|
||||
|
@ -82,7 +82,7 @@ void UploadListenerTelemetry( char *callsign, time_t gps_time, float gps_lat, fl
|
|||
|
||||
// Now specify the POST data
|
||||
sprintf( JsonData, "{\"radio\": \"%s\", \"antenna\": \"%s\"}",
|
||||
"LoRa RFM98W", antenna );
|
||||
radio, antenna );
|
||||
sprintf( PostFields, "callsign=%s&time=%d&data=%s", callsign, (int)gps_time, JsonData );
|
||||
curl_easy_setopt( curl, CURLOPT_POSTFIELDS, PostFields );
|
||||
|
||||
|
@ -112,7 +112,7 @@ void *ListenerLoop(void *ptr)
|
|||
{
|
||||
if (LoopPeriod > LISTENER_UPDATE_INTERVAL*60*1000)
|
||||
{
|
||||
UploadListenerTelemetry( Config.Tracker, time(NULL), Config.latitude, Config.longitude, Config.antenna );
|
||||
UploadListenerTelemetry( Config.Tracker, time(NULL), Config.latitude, Config.longitude, Config.radio, Config.antenna );
|
||||
LoopPeriod = 0;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue