kopia lustrzana https://github.com/PiInTheSky/lora-gateway
Fixed code to be thread safe
rodzic
125a07a9e2
commit
cb9fb1a6e7
|
@ -0,0 +1,40 @@
|
|||
tracker=MORJX-LGW
|
||||
EnableHabitat=Y
|
||||
EnableSSDV=Y
|
||||
JPGFolder=ssdv
|
||||
LogTelemetry=Y
|
||||
LogPackets=Y
|
||||
CallingTimeout=60
|
||||
ServerPort=6004
|
||||
Latitude=53.61722
|
||||
Longitude=-1.7
|
||||
Antenna=Watson 2000
|
||||
#SMSFolder=./
|
||||
EnableDev=N
|
||||
|
||||
NetworkLED=21
|
||||
InternetLED=22
|
||||
ActivityLED_0=23
|
||||
ActivityLED_1=24
|
||||
|
||||
#frequency_0=869.250
|
||||
#mode_0=1
|
||||
#bandwidth_0=125K
|
||||
#implicit_0=0
|
||||
#coding_0=5
|
||||
#sf_0=8
|
||||
#lowopt_0=0
|
||||
#power_0=255
|
||||
#DIO0_0=31
|
||||
#DIO5_0=26
|
||||
#AFC_0=Y
|
||||
#UplinkTime_0=2
|
||||
#UplinkCycle_0=60
|
||||
|
||||
frequency_1=434.250
|
||||
mode_1=0
|
||||
#DIO0_1=6
|
||||
#DIO5_1=5
|
||||
AFC_1=Y
|
||||
#UplinkTime_1=5
|
||||
#UplinkCycle_1=60
|
11
gateway.c
11
gateway.c
|
@ -532,7 +532,7 @@ void UploadListenerTelemetry(char *callsign, float gps_lat, float gps_lon, char
|
|||
char JsonData[200];
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
// curl_global_init(CURL_GLOBAL_ALL); // RJH moved to main in gateway.c not thread safe
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
|
@ -566,10 +566,10 @@ void UploadListenerTelemetry(char *callsign, float gps_lat, float gps_lon, char
|
|||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
// curl_global_cleanup(); // RJH moved to main in gateway.c not thread safe
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
// curl_global_init(CURL_GLOBAL_ALL); // RJH moved to main in gateway.c not thread safe
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
|
@ -599,7 +599,7 @@ void UploadListenerTelemetry(char *callsign, float gps_lat, float gps_lon, char
|
|||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
// curl_global_cleanup(); // RJH moved to main in gateway.c not thread safe
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1873,6 +1873,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL); // RJH thread safe
|
||||
|
||||
mainwin = InitDisplay();
|
||||
|
||||
// Settings for character input
|
||||
|
@ -2042,6 +2044,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
CloseDisplay(mainwin);
|
||||
curl_global_cleanup(); // RJH thread safe
|
||||
|
||||
if (Config.NetworkLED >= 0) digitalWrite(Config.NetworkLED, 0);
|
||||
if (Config.InternetLED >= 0) digitalWrite(Config.InternetLED, 0);
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
tracker=M0RJX-LGW
|
||||
EnableHabitat=Y
|
||||
EnableSSDV=Y
|
||||
JPGFolder=ssdv
|
||||
LogTelemetry=Y
|
||||
LogPackets=Y
|
||||
CallingTimeout=60
|
||||
ServerPort=6004
|
||||
Latitude=53.61722
|
||||
Longitude=-1.7
|
||||
Antenna=Watson 2000
|
||||
#SMSFolder=./
|
||||
EnableDev=N
|
||||
|
||||
NetworkLED=21
|
||||
InternetLED=22
|
||||
ActivityLED_0=23
|
||||
ActivityLED_1=24
|
||||
|
||||
frequency_0=869.250
|
||||
mode_0=1
|
||||
#bandwidth_0=125K
|
||||
#implicit_0=0
|
||||
#coding_0=5
|
||||
#sf_0=8
|
||||
#lowopt_0=0
|
||||
#power_0=255
|
||||
#DIO0_0=31
|
||||
#DIO5_0=26
|
||||
AFC_0=Y
|
||||
#UplinkTime_0=2
|
||||
#UplinkCycle_0=60
|
||||
|
||||
frequency_1=434.300
|
||||
#mode_1=1
|
||||
#DIO0_1=6
|
||||
#DIO5_1=5
|
||||
AFC_1=Y
|
||||
bandwidth_1=20K8
|
||||
SF_1=8
|
||||
Coding_1=5
|
||||
Implicit_1=N
|
||||
lowopt_1=N
|
||||
|
||||
#UplinkTime_1=5
|
||||
#UplinkCycle_1=60
|
88
gateway.txt
88
gateway.txt
|
@ -1,46 +1,46 @@
|
|||
tracker=M0RPI/5
|
||||
EnableHabitat=Y
|
||||
EnableSSDV=Y
|
||||
JPGFolder=ssdv
|
||||
LogTelemetry=Y
|
||||
LogPackets=Y
|
||||
CallingTimeout=60
|
||||
ServerPort=6004
|
||||
Latitude=51.95023
|
||||
Longitude=-2.5445
|
||||
Antenna=868MHz Yagi
|
||||
#SMSFolder=./
|
||||
EnableDev=Y
|
||||
tracker=M0RJX-LGW
|
||||
EnableHabitat=Y
|
||||
EnableSSDV=Y
|
||||
JPGFolder=ssdv
|
||||
LogTelemetry=Y
|
||||
LogPackets=Y
|
||||
CallingTimeout=60
|
||||
ServerPort=6004
|
||||
Latitude=53.61722
|
||||
Longitude=-1.7
|
||||
Antenna=Watson 2000
|
||||
#SMSFolder=./
|
||||
EnableDev=N
|
||||
|
||||
NetworkLED=21
|
||||
InternetLED=22
|
||||
ActivityLED_0=23
|
||||
ActivityLED_1=24
|
||||
|
||||
frequency_0=869.250
|
||||
mode_0=1
|
||||
#bandwidth_0=125K
|
||||
#implicit_0=0
|
||||
#coding_0=5
|
||||
#sf_0=8
|
||||
#lowopt_0=0
|
||||
#power_0=255
|
||||
#DIO0_0=31
|
||||
#DIO5_0=26
|
||||
AFC_0=Y
|
||||
#UplinkTime_0=2
|
||||
#UplinkCycle_0=60
|
||||
|
||||
frequency_1=434.450
|
||||
mode_1=2
|
||||
#DIO0_1=6
|
||||
#DIO5_1=5
|
||||
AFC_1=Y
|
||||
#bandwidth_1=20K8
|
||||
#SF_1=8
|
||||
#Coding_1=5
|
||||
#Implicit_1=N
|
||||
#lowopt_1=N
|
||||
|
||||
#NetworkLED=21
|
||||
#InternetLED=22
|
||||
#ActivityLED_0=23
|
||||
#ActivityLED_1=24
|
||||
|
||||
frequency_0=869.860
|
||||
mode_0=3
|
||||
#implicit_0=1
|
||||
#coding_0=5
|
||||
#sf_0=6
|
||||
|
||||
#frequency_0=869.500
|
||||
#mode_0=
|
||||
#bandwidth_0=125K
|
||||
#implicit_0=0
|
||||
#coding_0=5
|
||||
#sf_0=8
|
||||
#lowopt_0=0
|
||||
#power_0=255
|
||||
DIO0_0=31
|
||||
DIO5_0=26
|
||||
AFC_0=N
|
||||
UplinkTime_0=2
|
||||
UplinkCycle_0=60
|
||||
|
||||
frequency_1=434.455
|
||||
mode_1=2
|
||||
DIO0_1=6
|
||||
DIO5_1=5
|
||||
#AFC_1=Y
|
||||
#UplinkTime_1=5
|
||||
#UplinkTime_1=5
|
||||
#UplinkCycle_1=60
|
||||
|
|
|
@ -50,7 +50,7 @@ void UploadTelemetryPacket(int Channel)
|
|||
CURLcode res;
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
// curl_global_init(CURL_GLOBAL_ALL); // RJH moved to main in gateway.c not thread safe
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
|
@ -139,7 +139,7 @@ void UploadTelemetryPacket(int Channel)
|
|||
// free(base64_data);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
// curl_global_cleanup(); // RJH moved to main in gateway.c not thread safe
|
||||
}
|
||||
|
||||
|
||||
|
|
4
ssdv.c
4
ssdv.c
|
@ -55,7 +55,7 @@ int UploadImagePackets(void)
|
|||
UploadedOK = 0;
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
// curl_global_init(CURL_GLOBAL_ALL); // RJH moved to main in gateway.c not thread safe
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_init();
|
||||
|
@ -118,7 +118,7 @@ int UploadImagePackets(void)
|
|||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
// curl_global_cleanup(); // RJH moved to main in gateway.c not thread safe
|
||||
|
||||
return UploadedOK;
|
||||
}
|
||||
|
|
Plik binarny nie jest wyświetlany.
Ładowanie…
Reference in New Issue