• CommodoreServer.com Official Blog

  • by CommodoreServer.com

Articles and information on Internet-enabling your Commodore 64 Computer.

Sep
17

Configuration Commands for the Comet64 Internet Modem

By default, the Comet64 Internet Modem is pre-configured with the ability to connect seamlessly to CommodoreServer.com using the V-1541 software. However, the device can easily connect to any other server/port on the Internet by sending some configuration commands to it. This article will describe how to send commands to the Comet64 using a simple BASIC program that you can download from the Public Directory.

NOTE: This article uses the CommodoreServer font for some of the text.  If you don't have the font installed, certain parts might not look right.  Please download and install the font for best results.

The Comet64 is not locked-in to using V-1541 or CommodoreServer.com.  It is a fully versatile RS-232 device that can make a connection to any single Internet destination (IP address and port).  Furthermore, it has additional configuration parameters to act as a static server device (however, being limited to one connection at a time is rather impractical to run as an Internet server, although a single-connection server may be useful in some cases).

The following method will allow you to connect to the Comet64 using a small BASIC program that will allow you to experiment with configuration changes.  You can just as easily use a machine language program to send commands to the device, but BASIC is fast enough and also easy to use.

To enter into configuration mode, you must first send a series of 3 bytes.  By default the bytes are plus (+) characters, or CHR$(43).

This simple BASIC program (in the public directory) allows you to type data and send it to the modem.  Anything that the modem sends will also be printed on the screen.  If you haven't changed any configuration on the Comet64, it should already be connected to CommodoreServer.com so you can even send CSIP commands to it and receive responses. But we're going to show how to configure different options on the Comet64.

Caution: Any configuration changes you make to the Comet64 will likely break the ability to connect to CommodoreServer.com.  I recommend putting everything back to its default state by running the V-1541CFG program on the V-1541 disk that came with the modem.  If you don't have the disk, I will show you at the end of this article the necessary steps to put it back to its default configuration.

Command Format

Commands are sent within a pair of greater-than and less-than brackets. For example: <RI> will retrieve the IP Address of the Comet64. There is no need to send a carriage return.  The closing bracket indicates end of command and the modem will respond immediately.

Step 1 - LOAD and RUN the program

This program is available from CommodoreServer.com's Public Directory.  You can use your Comet64 modem and the V-1541 program to insert the disk and load the program, or you can type it in manually (or you can download it and SAVE it to a floppy disk).  I will assume you know by now how to load programs from CommodoreServer.com from your Commodore 64, so the choice is yours.

LIST

1 OPEN2,2,2,CHR$(10):REM2400 BAUD
10 GET#2,A$
15 IFA$<>""THENPRINTA$;
20 GETI$;IFI$=""THEN10
25 PRINTI$;
30 PRINT#2,I$;
40 GOTO10

READY.

Step 2 - Send the Configuration String

The configuration string signals the Comet64's Wiz board to receive configuration commands. If already connected, the Comet64 will disconnect and data will no longer be sent to the server. Instead, it will receive the data directly, assuming a standardized set of commands.

To enable configuration mode, simply type 3 plus signs in a row. The server will respond with <E> to indicate that you are Entering configuration mode.

 
 
+++<E>

Once you send the +++ signal to the modem, it immediately responds with an acknowledgement of <E>. Now you can start sending configuration commands.

Step 3 - Send Configuration Commands

There are several commands that can be sent to the Comet64 to change its configuration. Every command requires a less-than (<) and greater-than (>) sign surrounding the command. Once the greater-than sign is sent to the modem, the command is accepted.

If your command was successful, you will receive a less-than sign and an S, followed by any data requested, and then a greater-than sign (for example: <S198.145.38.115>).

If there was an error, you will receive F for failed, 1 for Invalid command or 2 for Invalid parameter (for example <1>).

Reading Values

Command Value Comments
RV xxx.xxx.xxx.xxx Get Local DNS IP Address
RI xxx.xxx.xxx.xxx Get Local IP Address
RS xxx.xxx.xxx.xxx Get Local Subnet Mask
RG xxx.xxx.xxx.xxx Get Local Gateway
RP   Get Local Port
RD

0=Static IP, 1=DHCP

Get IP Configuration Method
RM 0=Client, 1=Mixed, 2=Server Get Operation Mode
RC 0=Startup, 1=Any Char. Get TCP Client Method
RB

XXXX

Baud: 1=115200, 2=57600, 3=38400, 4=19200, 5=9600, 6=4800, 7=2400, 8=1200

Data: 7=7bit, 8=8bit

Parity: 0=No parity, 1=Odd, 2=Even

Flow: 0=No, 1=Xon/Xoff, 2=RTS/CTS

Get the Serial Baud Rate, Data, Parity, Flow (4 bytes)
RT 0=Disable, 1=Hardware, 2=Software Get Serial Command Method (method used to configure board - if hardware, set pin J on user port to send commands)
RE 3 HEX bytes (2B2B2B is default) Get the Configuration Command Mode Character
RF (4.0 is default but may change if you updated the firmware on the Wiz board) Get the Firmware Version
RX xxx.xxx.xxx.xxx Get the Server IP Address
RN   Get the Server Port
QC   Get the Delimiter Character in HEX
QS 0-255 Get the Delimiter Size
QT 0-65535 Get the Delimiter Time
QI 0-65535 Get the Inactivity Timer Value
RU 0=No DNS, 1=Use DNS Get DNS Usage

Writing Values

Command Value Comments
WU 0=No DNS, 1=Use DNS Set DNS Usage
WW commodoreserver.com Set the Server Domain Name (only if DNS Usage is set)
WX xxx.xxx.xxx.xxx Set the Server IP Address (not used if using DNS)
WN xx Set the Server Port
WM 0=Client, 1=Mixed, 2=Server Set Operation Mode (Mixed is best for Telnet BBSes)
WV xxx.xxx.xxx.xxx Set Local DNS IP Address
     
WI xxx.xxx.xxx.xxx Set Local IP Address
WS xxx.xxx.xxx.xxx Set Local Subnet Mask
WG xxx.xxx.xxx.xxx Set Local Gateway
WP   Set Local Port
WD

0=Static IP, 1=DHCP

Set IP Configuration Method
WC 0=Startup, 1=Any Char. Set TCP Client Method
WB

XXXX

Baud: 1=115200, 2=57600, 3=38400, 4=19200, 5=9600, 6=4800, 7=2400, 8=1200

Data: 7=7bit, 8=8bit

Parity: 0=No parity, 1=Odd, 2=Even

Flow: 0=No, 1=Xon/Xoff, 2=RTS/CTS

Set the Serial Baud Rate, Data, Parity, Flow (4 bytes)
WT 0=Disable, 1=Hardware, 2=Software Set Serial Command Method (method used to configure board - if hardware, set pin J on user port to send commands)
WE 3 HEX bytes (2B2B2B is default) Set the Configuration Command Mode Character
     
OC   Set the Delimiter Character in HEX
OS 0-255 Set the Delimiter Size
OT 0-65535 Set the Delimiter Time
OI 0-65535 Set the Inactivity Timer Value
WR   Write changes and reset the Wiz board

Step 4 - Reset the device

After configuration, it is necessary to issue the <WR> command to ensure that all changes are saved and also to exit configuration mode.  Once issued, the device will take anywhere from 5-20 seconds to reset.  Once reset, you may use the board with the updated changes.

As you can see, this is a powerful way to configure the modem to connect to other servers and IP addresses to send data through.  Anything you write to the RS-232 port will be sent to the IP Address / Port that you specified in the configuration.  If you write software that connects to your own server, it is a good idea to have a configuration program to handle the proper connection.  That way, if your users wants to switch between programs, they will always have a way to set it back to the proper setting for your software.

Resetting the Configuration for V-1541

Now that you've seen how to configure the Comet64, let me show you the commands to set the default configuration in order to work with V-1541.  Using the BASIC program above, you can type the following commands to reset the Comet64 back to its default configuration (Note that the board's responses are not shown here):

+++
<WD1>
<WM0>
<WE2B2B2B>
<WU0>
<WX198.145.38.115>
<WN1541>
<WR>

Comments not accepted for this entry.

Responses