Merge pull request #67 from matburnham/setradio

Allow custom specification of radio as well as antenna.
pull/68/head
Pi In The Sky Project 2021-04-20 13:56:56 +01:00 zatwierdzone przez GitHub
commit 4e4a9e0aa5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 13 dodań i 4 usunięć

Wyświetl plik

@ -75,6 +75,7 @@ The configuration is in the file gateway.txt. Example:
ServerPort=6004 ServerPort=6004
Latitude=51.95023 Latitude=51.95023
Longitude=-2.5445 Longitude=-2.5445
Radio=LoRa RFM98W
Antenna=868MHz Yagi Antenna=868MHz Yagi
frequency_0=434.347 frequency_0=434.347
@ -121,6 +122,7 @@ The global options are:
Latitude=<decimal position> 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. 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. 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> NetworkLED=<wiring pi pin>
@ -250,6 +252,10 @@ Many thanks to David Brooke for coding this feature and the AFC.
Change History Change History
============== ==============
19/03/2021 - V1.8.43mbb
--------------------
Added radio setting to gateway.txt
07/03/2021 - V1.8.43 07/03/2021 - V1.8.43
-------------------- --------------------

Wyświetl plik

@ -4,7 +4,8 @@
tracker=YOUR_CALLSIGN tracker=YOUR_CALLSIGN
Latitude=0.0 Latitude=0.0
Longitude=0.0 Longitude=0.0
Antenna=Watson W-50 Radio=Your radio
Antenna=Your antenna
##### Config Options ##### ##### Config Options #####

Wyświetl plik

@ -2083,6 +2083,7 @@ void LoadConfigFile(void)
// Listener // Listener
RegisterConfigDouble(MainSection, -1, "Latitude", &Config.latitude, NULL); RegisterConfigDouble(MainSection, -1, "Latitude", &Config.latitude, NULL);
RegisterConfigDouble(MainSection, -1, "Longitude", &Config.longitude, 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); RegisterConfigString(MainSection, -1, "antenna", Config.antenna, sizeof(Config.antenna), NULL);
// Dev mode // Dev mode

Wyświetl plik

@ -138,6 +138,7 @@ struct TConfig
int HABChannel; // LoRa Channel for uplink int HABChannel; // LoRa Channel for uplink
int DataPort; // Raw received data packet port int DataPort; // Raw received data packet port
char SMSFolder[64]; char SMSFolder[64];
char radio[64];
char antenna[64]; char antenna[64];
int EnableDev; int EnableDev;
char UplinkCode[64]; char UplinkCode[64];

Wyświetl plik

@ -13,7 +13,7 @@ size_t write_data( void *buffer, size_t size, size_t nmemb, void *userp )
return size * nmemb; 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]; char time_string[20];
struct tm * time_info; 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 // Now specify the POST data
sprintf( JsonData, "{\"radio\": \"%s\", \"antenna\": \"%s\"}", sprintf( JsonData, "{\"radio\": \"%s\", \"antenna\": \"%s\"}",
"LoRa RFM98W", antenna ); radio, antenna );
sprintf( PostFields, "callsign=%s&time=%d&data=%s", callsign, (int)gps_time, JsonData ); sprintf( PostFields, "callsign=%s&time=%d&data=%s", callsign, (int)gps_time, JsonData );
curl_easy_setopt( curl, CURLOPT_POSTFIELDS, PostFields ); curl_easy_setopt( curl, CURLOPT_POSTFIELDS, PostFields );
@ -112,7 +112,7 @@ void *ListenerLoop(void *ptr)
{ {
if (LoopPeriod > LISTENER_UPDATE_INTERVAL*60*1000) 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; LoopPeriod = 0;
} }