Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000 APRS/CWOP


cellectronic Mar 2, 2020 06:00 AM

Hi folks ,

I am interested in posting CR1000 data via APRS and CWOP. 

Currently the CR1000 is posting data directly to Weatherunderground. 

Can somebody shed some light on the code which will enable the CR1000 to post this data ? Thanks for any support.  


GaryTRoberts Mar 5, 2020 09:39 AM

I have a subroutine that I use to post data to the CWOP network. See https://aprs.fi/weather/a/AG1T-20. I use the following code to do so:

 

'Subroutines
Sub SUB_Send_APRS_Data()
  Dim sequence_number
  Dim temp_number
  Dim temp_string As String
  Dim cwop_message As String * 300
  Dim cwop_socket As Long

  IPRoute ("sixth.aprs.net", 1, 1)  

  cwop_socket = TCPOpen("sixth.aprs.net", 14580, 200)
  If(cwop_socket > 100) Then
    SerialOut(cwop_socket, "", "# aprsc 2.1.4-g408ed49" & CHR(10) & CHR(13), 1, 200)
    SerialOut(cwop_socket, "user AG1T-20 pass 1111 vers CRBasicCWOPAPRS " & _PROGRAM_VERSION & CHR(10) & CHR(13), "# logresp AG1T verified, server CWOP-1" & CHR(10) & CHR(13), 1, 200)
    temp_number = wind_direction
    Sprintf(temp_string, "%03.0f", temp_number)
    'Send standard weather information
    cwop_message = "AG1T-20>APRS,TCPIP*:!4141.14N/11150.00W_" & temp_string
    temp_number = TEN_MINUTE.wind_speed_mph_average(1, 1)
    Sprintf(temp_string, "%03.0f", temp_number)
    cwop_message = cwop_message & "/" & temp_string 
    temp_number = TEN_MINUTE.wind_speed_mph_Max(1, 1)
    Sprintf(temp_string, "%03.0f", temp_number)
    cwop_message = cwop_message & "g" & temp_string
    cwop_message = cwop_message & "t" & FormatLong ( air_temperature, "%03u" ) 
    cwop_message = cwop_message & "r" & FormatLong ( (rain_fall_last_hour * 100), "%03u" ) 
    cwop_message = cwop_message & "p" & FormatLong ( (rain_fall_last_24_hours * 100), "%03u" ) 
    cwop_message = cwop_message & "P" & FormatLong ( (rain_fall_since_midnight * 100), "%03u" )
    cwop_message = cwop_message & "L" & FormatLong ( slrw, "%03u" )
    cwop_message = cwop_message & "h" & FormatLong ( relative_humidity, "%02u" )
    temp_number = barometric_pressure(3)
    temp_number = (temp_number * 10)
    Sprintf(temp_string, "%05.0f", temp_number)
    cwop_message = cwop_message & "b" & temp_string
    cwop_message = cwop_message & "xCSIL" & _PROGRAM_VERSION 'WinAPRS with "CSI L"ogger designation
    cwop_message = cwop_message & CHR(13)
    cwop_message = cwop_message & CHR(10)
    SerialOut(cwop_socket, cwop_message, "", 1, 0)
    'send telemetry data
    If(sequence_number <> 999) Then
      sequence_number += 1
    Else
      sequence_number = 1
    EndIf
    cwop_message = "AG1T-20>APRS,TCPIP*:T#" & FormatLong(sequence_number, "%03u") & "," & FormatLong(battery_voltage(1) * 10, "%03u")
    cwop_message = cwop_message & "," & FormatLong(battery_voltage(2) * 10, "%03u") & "," & FormatLong(battery_voltage(3) * 10, "%03u")
    cwop_message = cwop_message & "," & FormatLong(battery_voltage(4) * 10, "%03u") & ",000,000" & ",01100000"
    cwop_message = cwop_message & CHR(13)
    cwop_message = cwop_message & CHR(10)
    SerialOut(cwop_socket, cwop_message, "", 1, 0)
    
    'send telemetry parameter names only once a day
    'make sure there are only 9 characters (including spaces) in the callsign/station id field or else we get APRS errors
    If (IfTime (0, 720, Min)) Then
      cwop_message = "AG1T-20>APRS,TCPIP*::AG1T-20  :PARM.Battery,Bat1,Bat2,Bat3,Bat4,Bat5"
      cwop_message = cwop_message & CHR(13)
      cwop_message = cwop_message & CHR(10)
      SerialOut(cwop_socket, cwop_message, "", 1, 0)
      cwop_message = "AG1T-20>APRS,TCPIP*::AG1T-20  :UNIT.volt,volt,volt,volt,volt,on,on,on,on,on,on,on,on"
      cwop_message = cwop_message & CHR(13)
      cwop_message = cwop_message & CHR(10)
      SerialOut(cwop_socket, cwop_message, "", 1, 0)
      cwop_message = "AG1T-20>APRS,TCPIP*::AG1T-20  :EQNS.0,.1,0,0,.1,0,0,.1,0,0,.1,0,0,0,0"
      cwop_message = cwop_message & CHR(13)
      cwop_message = cwop_message & CHR(10)
      SerialOut(cwop_socket, cwop_message, "", 1, 0)
    EndIf
    TCPClose(cwop_socket)
  EndIf
EndSub '//End SubSendCWOPData

 

You will need to use an amateur radio callsign and password or CWOP assigned station in the program code. This code is running on a CR6, but should be portable to a CR1000.  The logger will also need to have a PPP modem connection, NL115, NL116, NL200, NL201, or NL240 with a connection to the internet to be able to do this.


cellectronic Mar 5, 2020 12:34 PM

Hi Gary, many thanks for the info. I will be connecting the logger via an NL115 to the internet , hopefully I will get chance to look into this over the weekend.  Will keep you informed.  Best regards, Steve (G7NSJ).


cellectronic Mar 10, 2020 04:32 AM

Hi Gary, I have now had chance to look at this and have picked my way through the code.

one issue I have is the program will not compile because Line 8 of your subroutine "

 IPRoute ("sixth.aprs.net", 1, 1)"
I get an error which states "two many parameters"
If I remove the 1, it will then compile , Can you suggest a fix for this or does the
,1 need to be there ?
Thanks for any help.
Steve .

GaryTRoberts Mar 10, 2020 09:11 AM

It should work if you are running the latest version of the operating system in your datalogger. The option isn't needed, but it helps to force the route.


GaryTRoberts Mar 10, 2020 09:15 AM

Here is a link to the instruction details in the CR1000X (HELP). The CR1000 should be similar if running 32.04.

Log in or register to post/reply in the forum.