1

Using a Commodore 64 with a GLINK LT RS-232 adapter connected to a Digi-Connect SP configured to send RAW TCP to a static IP/port on my home network. Destination is a socat process passing traffic elsewhere with verbose logging.

Testing hitting socat from a bash shell on an OS X machine, issuing curl http://192.168.1.91:1234 I get a valid response and the socat log shows

> 2018/12/29 22:06:50.168550  length=81 from=0 to=80
GET / HTTP/1.1\r
Host: 192.168.1.91:1234\r
User-Agent: curl/7.54.0\r
Accept: */*\r
\r
< 2018/12/29 22:06:50.169509  length=144 from=0 to=143

(followed by http response)

But when I run the following on the C64 BASIC code SNIPPET:

100 OPEN 2,2,3,CHR$(6)+CHR$(0)
110 GET#2,A$: REM TOSS NULL TO OPEN RCVR CHANNEL
120 PRINT#2,"GET /"
...

the socat log shows:

> 2018/12/29 22:11:38.952005  length=1 from=167 to=167
G> 2018/12/29 22:11:38.983674  length=1 from=168 to=168
E> 2018/12/29 22:11:39.015464  length=1 from=169 to=169
T> 2018/12/29 22:11:39.051758  length=1 from=170 to=170
 > 2018/12/29 22:11:39.084476  length=1 from=171 to=171
/> 2018/12/29 22:11:39.117131  length=1 from=172 to=172

I'm not sure if I'm doing something wrong on the C64 side to cause the individual char's to be sent or if it's an incorrect Digi-Connect setting.

Digi serial settings are:

  • TCP Client Settings:
    • Automatically establish TCP connections
      • Always connect and maintain connection
    • Establish connection to the following network service:
      • Server: 192.168.1.91
      • Service: Raw TCP
      • TCP Port: 1234
      • Enable TCP Keep-Alive: On
  • Basic Serial Settings
    • Baud: 300
    • Data bits: 8
    • Parity: None
    • Stop Bits: 0
    • Flow Control: Hardware
  • Advanced Serial Settings
    • (nothing configured here)
Eric Smalling
  • 725
  • 5
  • 12

1 Answers1

1

The individual characters was a red herring, the fix is simply to add a LF (ASCII 10) to the end of the message so the downstream web service understands that the message is finished.

Working example:

100 OPEN 2,2,3,CHR$(6)+CHR$(0)
110 PRINT#2,"GET /"
120 PRINT#2,CHR$(10)

(also of note - anything requiring correct upper/lower case will need PETSCII <-> ASCII conversions)

Eric Smalling
  • 725
  • 5
  • 12