The Citizen Weather Observer Program that cw2300 supports has been returning
"logresp <station> unverified" and refusing to accept my data. I have added the
ability to put a passcode into the configuration file which then is used for
authenticating data commits to CWOP. Patch below.

James Perkins - KN1X - james@loowit.net

Index: linux2300.c
===================================================================
--- linux2300.c	(revision 12)
+++ linux2300.c	(working copy)
@@ -368,8 +368,9 @@
 	}
 
 	// The login/header line
-	sprintf(buffer,"user %s pass -1 vers open2300 %s\n",
-	        config->citizen_weather_id, VERSION);
+	sprintf(buffer,"user %s pass %s vers open2300 %s\n",
+	        config->citizen_weather_id, config->citizen_weather_passcode,
+		VERSION);
 	send(sockfd, buffer, strlen(buffer), 0);
 	if (DEBUG)
 		printf("%s\n", buffer);
Index: open2300-dist-win.conf
===================================================================
--- open2300-dist-win.conf	(revision 12)
+++ open2300-dist-win.conf	(working copy)
@@ -37,6 +37,7 @@
 # Use leading zeros to get the format ####.##N (lat) and #####.##E (long)
 
 CITIZEN_WEATHER_ID            CW0000      # CW0000 should be replaced by HAM call or actual CW number
+CITIZEN_WEATHER_PASSCODE      -1          # -1 should be replaced by passcode
 CITIZEN_WEATHER_LATITUDE      5540.12N    # DDMM.mmN or S - example 55 deg, 40.23 minutes north
 CITIZEN_WEATHER_LONGITUDE     01224.60E   # DDDMM.mmE or W - example 12 deg, 24.60 minutes east
 
Index: open2300-dist.conf
===================================================================
--- open2300-dist.conf	(revision 12)
+++ open2300-dist.conf	(working copy)
@@ -37,6 +37,7 @@
 # Use leading zeros to get the format ####.##N (lat) and #####.##E (long)
 
 CITIZEN_WEATHER_ID            CW0000      # CW0000 should be replaced by HAM call or actual CW number
+CITIZEN_WEATHER_PASSCODE      -1          # -1 should be replaced by passcode
 CITIZEN_WEATHER_LATITUDE      5540.12N    # DDMM.mmN or S - example 55 deg, 40.23 minutes north
 CITIZEN_WEATHER_LONGITUDE     01224.60E   # DDDMM.mmE or W - example 12 deg, 24.60 minutes east
 
Index: rw2300.c
===================================================================
--- rw2300.c	(revision 12)
+++ rw2300.c	(working copy)
@@ -2394,6 +2394,7 @@
 	// First we set everything to defaults - faster than many if statements
 	strcpy(config->serial_device_name, DEFAULT_SERIAL_DEVICE);  // Name of serial device
 	strcpy(config->citizen_weather_id, "CW0000");               // Citizen Weather ID
+	strcpy(config->citizen_weather_passcode, "-1");             // Citizen Weather Passcode
 	strcpy(config->citizen_weather_latitude, "5540.12N");       // latitude default Glostrup, DK
 	strcpy(config->citizen_weather_longitude, "01224.60E");     // longitude default, Glostrup, DK
 	strcpy(config->aprs_host[0].name, "rotate.aprs.net");       // host1 name
@@ -2457,6 +2458,12 @@
 			strcpy(config->citizen_weather_id, val);
 			continue;
 		}
+
+		if ((strcmp(token,"CITIZEN_WEATHER_PASSCODE")==0) && (strlen(val) != 0))
+		{
+			strcpy(config->citizen_weather_passcode, val);
+			continue;
+		}
 		
 		if ((strcmp(token,"CITIZEN_WEATHER_LATITUDE")==0) && (strlen(val)!=0))
 		{
Index: rw2300.h
===================================================================
--- rw2300.h	(revision 12)
+++ rw2300.h	(working copy)
@@ -65,6 +65,7 @@
 {
 	char   serial_device_name[50];
 	char   citizen_weather_id[30];
+	char   citizen_weather_passcode[30];
 	char   citizen_weather_latitude[20];
 	char   citizen_weather_longitude[20];
 	hostdata aprs_host[MAX_APRS_HOSTS]; // max 6 possible aprs hosts 1 primary and 5 alternate
Index: win2300.c
===================================================================
--- win2300.c	(revision 12)
+++ win2300.c	(working copy)
@@ -406,8 +406,9 @@
 	}
 
 	// The login/header line
-	sprintf(buffer,"user %s pass -1 vers open2300 %s\n",
-	        config->citizen_weather_id, VERSION);
+	sprintf(buffer,"user %s pass %s vers open2300 %s\n",
+	        config->citizen_weather_id, config->citizen_weather_passcode,
+	        VERSION);
 	send(sockfd, buffer, strlen(buffer), 0);
 	if (DEBUG)
 		printf("%s\n", buffer);


