This document describes the networking support currently implemented in BMC64. Networks is available for C64 and C128 machines. C64 has been tested with BBS access and C64 OS network enabled applications and C128 has been tested with BBS.
BMC64 runs without Linux. The Raspberry Pi networking stack is initialized at
startup and is used by a software modem connected to VICE's ACIA1 interface.
The emulated C64 or C128 program sees a SwiftLink/Turbo232-compatible ACIA at
$DE00 by default. The BMC modem translates modem commands into outbound TCP
connections.
Current behavior:
- Networking is available from the
Networkmenu on C64 and C128. - The choices are
Off,Ethernet, andWiFi. Modem Addressselects$DE00(default) or alternatively$D700,$DF00, or$DF80.$D700is recommended if you are using an IDE64 and REU at the same time.
- Ethernet uses the Raspberry Pi's onboard Ethernet controller when present.
- Wi-Fi uses the Raspberry Pi's onboard WLAN controller when present.
- The modem resolves DNS names and opens TCP connections.
- The default TCP port is
23; a different port can be supplied in the dial string. - Basic Telnet negotiation is handled for BBS-style connections. Telnet control bytes are kept out of the data delivered to the C64 terminal.
- C64 OS CNP traffic on port
6400is binary-transparent. Every byte, including0xff, reaches C64 OS unchanged. - The connection is outbound only. BMC64 does not listen for incoming modem calls or provide a BBS server.
This is Telnet-style, unencrypted TCP. It does not provide TLS, SSH, VPN, or HTTP client behavior.
DO NOT use it for credentials that must be protected.
Warning
The emulated SwiftLink modem occupies I/O space that some cartridges also
use (for example REU, IDE64, GeoRAM, EasyFlash, MagicDisk or other $DE00/$DF00 devices). If
networking is enabled at the same time as a conflicting cartridge you may
see crashes or a non-responsive modem. Try a different Modem Address, or
set Network Device to Off when you are not using networking.
Wi-Fi requires Raspberry Pi firmware to be present in the /firmware directory
at the root of the SD card. Follow the build instructions
in BUILDING.md and use build_sdcard.sh to generate an SD-card
image with the required firmware included.
To install the Wi-Fi firmware manually, build it from the repository root:
cd third_party/circle-stdlib/libs/circle/addon/wlan/firmware
make firmwareThen copy every generated file from that directory to /firmware on the SD
card.
- Connect the Raspberry Pi to the network with Ethernet.
- Boot BMC64 and open
Network. - Set
Network DevicetoEthernet. - Save the setting and reboot when prompted.
- Open
Networkagain and checkIP Address.
The Ethernet choice is disabled when the selected Raspberry Pi model does not have onboard Ethernet. The IP address is populated when the Network menu is opened and the network stack has a running address.
Wi-Fi requires a Raspberry Pi model with onboard WLAN and the required Wi-Fi firmware on the SD card.
Warning
Typing in the SSID and password in the fields in the BMC64 menu currently ONLY support letters and numbers. If you have special characters in your Wi-Fi SSID or password you need to enter them manually into wpa_supplicant.conf, see below.
- Open
Networkand setNetwork DevicetoWiFi. - Accept the reboot prompt, or save the settings and reboot.
- After reboot, open
Network -> WiFi Settings. - Use the Wi-Fi scan to select an access point when scanning is available.
- Select the
Modem Addressdesired. - Select
WPA-PSKorNoneas appropriate. - Set the two-letter Wi-Fi country code.
- Choose
Enter Password & Reboot, enter the WPA password, and selectSave & Reboot. - After reboot, open
Networkand verify the assignedIP Address.
Selecting Wi-Fi makes the Wi-Fi stack available at boot. It may take a 5-20 seconds after boot to connect to an access point depending if it needs to retry.
The configuration file is stored at the root of the SD-card volume as
wpa_supplicant.conf. The repository includes an example at
sdcard/wpa_supplicant.conf.example:
country=US
network={
ssid="replace-with-network-name"
psk="replace-with-network-password"
key_mgmt=WPA-PSK
}For an open network, use:
country=US
network={
ssid="replace-with-network-name"
key_mgmt=NONE
}After changing the file, reboot BMC64. If Wi-Fi was not already selected, set
Network Device to WiFi and reboot when prompted.
BMC64 can serve a small status / reboot / file-management web page over the
local network on C64 and C128. It is off by default and can be protected with
an optional PIN. Enable it in Network -> Web UI Settings and open
http://<bmc64-ip>/.
See WEBUI.md for the full description, security notes, and how to develop it locally.
The modem is attached to ACIA1. Commands are terminated with Return. The implemented command set is:
| Command | Result |
|---|---|
AT |
Returns OK. |
ATI / ATI<n> |
Returns the modem identification and OK. |
ATI3 |
Returns the SSID most recently supplied through ATW, then OK. |
ATE0 / ATE1 |
Disable or enable command echo. |
ATQ0 / ATQ1 |
Enable or suppress result codes. |
ATV0 / ATV1 |
Select numeric or text result codes. |
ATR0 / ATR1 |
Select Return-only or CR/LF result-code termination. |
ATF0 through ATF3 |
Accepted for ZiModem compatibility. |
ATB<n> / ATX<n> |
Accepted; serial rate is controlled by the ACIA configuration. |
AT&P<n>, AT&F<n>, AT&K<n>, AT&L<n>, AT&W<n> |
Accepted as ZiModem-compatible no-ops. |
ATW"ssid,password" |
Records an SSID for ATI3; it does not change the Pi's Wi-Fi configuration. |
ATC |
Reports whether BMC64's host network is running. |
ATC... |
Resolve a host and open TCP while remaining in command mode. |
ATZ |
Reset the modem state. |
ATD... |
Resolve a host and open TCP data mode. ATDT, ATDP, and quoted targets are accepted. |
ATO |
Return to data mode when a socket is still connected. |
+++ |
Leave data mode after the one-second escape guard interval. |
ATH / ATH0 |
Hang up the current connection. |
AT+TRACE, AT+TRACECLEAR |
Read or clear the last 128 serial-backend bytes for diagnostics. |
AT+ACIATRACE, AT+ACIATRACECLEAR |
Read or clear the last 128 SwiftLink data-register writes for diagnostics. |
Dial targets may be hostnames or IPv4 addresses. The port is optional:
ATDTbbs.example.org
ATDTbbs.example.org:2323
ATDT192.168.1.50:6502
A successful connection returns CONNECT. DNS failure, an unavailable network,
or a refused TCP connection returns NO CARRIER.
TCP is independent of a physical serial device, but the emulated ACIA still
paces bytes at the speed selected by the terminal program or C64 OS driver.
Set the desired rate in the C64 client; for C64 OS, set both baud fields to
the same value. 38400 has been validated with CNP transfers.
CCGMS Ultimate on CSDb is a C64 BBS terminal program released by Alwyz in 2019. Transfer its disk image or program to the BMC64 SD card and load it on the C64 using the normal BMC64 disk or Autostart workflow.
The current BMC64 changelog specifically calls out this setup:
- Enable Ethernet or Wi-Fi and reboot BMC64.
- Start CCGMS Ultimate.
- In CCGMS, select the
Swift/DEor appropriate modem.D7,DEorDFshould match the Modem address selected.
- Use CCGMS's autodialer/connection screen with the BBS hostname or IP address and TCP port.
- If entering commands directly in the terminal, use the BMC modem syntax,
for example
ATDTbbs.example.org:23, followed by Return. - Wait for
CONNECT, then follow the BBS login prompts.
Most traditional Internet BBSes use Telnet on port 23, but some use another
port. Use the port published by the BBS operator. The BMC modem accepts both a
hostname and an IPv4 address, so either form can be entered in CCGMS.
For further details on CCGMS Ultimate refer to the CSDb release page.
DesTerm 128 V3.02 on CSDb has been tested with the BMC64 modem in C128 mode. Transfer the DesTerm program or disk image to the C128 directory on the BMC64 SD card, then load it using the normal BMC64 disk or Autostart workflow.
Note: DesTerm 128 uses the C128 80-column display.
- Enable Ethernet or Wi-Fi in BMC64 and reboot it if prompted.
- In BMC64's
Networkmenu, note the selectedModem Address.$DE00is the default. - DesTerm should automatically detect the modem and address.
- Use DesTerm's dialer to enter the BBS hostname or IPv4 address and its TCP port. Alternatively, enter a dial command in the terminal, for example:
ATDTbbs.example.org:23
- Wait for
CONNECT, then log in to the BBS. - Select the character set supported by the BBS if prompted.
DOS CP 437worked well with the tested BBS. - Use the port published by the BBS operator when it differs from the default
Telnet port
23.
To disconnect from a terminal session, wait at least one second, enter +++,
wait at least one second for OK, then enter ATH.
Note: DesTerm 128 does not use PETSCII. Choose a character set supported by the BBS.
C64 OS provides SwiftLink drivers for the modem addresses configured in the
BMC64 Network menu.
Modem address $D700 with the sld7.zi driver is recommended when using an
IDE64 C64 OS image with an REU enabled to avoid address collisions.
Modem address $DE00 with the slde.zi driver is recommended when using a
CMD-HD C64 OS image with an REU enabled to avoid address collisions.
The driver sends a ZiModem-compatible initialization command, uses ATW and ATI3 to identify the host connection, and dials the CNP service using a quoted ATD target.
Networking in C64 OS uses C64 Network Protocol (CNP), which requires a CNP server account. For full information, read the C64 OS Networking Guide.
Quick start for BMC64:
- Configure Ethernet or Wi-Fi in BMC64 and confirm that
Network Statusshows as connected.- Note: The C64 OS Wi-Fi fields do not configure the Raspberry Pi Wi-Fi.
- In C64 OS, open
Settings, thenNetwork. On theDrvrtab, select the driver matching BMC64'sModem Address:sld7.zifor$D700,slde.zifor$DE00, orsldf.zifor$DF00. - Set both
Ini.BaudandMax.Baudto38400, save the settings, and runTest. It must reportPassbefore attempting CNP. - On the
WiFitab, enter non-empty values and useJoinso C64 OS can complete its driver workflow. BMC64 leaves the host network unchanged. - On the
CNPtab, configureservices.c64os.comas the host and6400as the port, then supply your C64 OS service credentials and clickStart. - Open the C64 OS Wikipedia application, run a search, and select several content links. Each item should download and display; this exercises CNP's binary payload path rather than just the initial connection.
- Click
Stopwhen finished. C64 OS should leave its active yellow state; BMC64 closes the TCP connection when the driver lowers DTR. A remote CNP disconnect produces the same state transition through the SwiftLink NMI.
Before troubleshooting a live BBS, the repository includes a TCP transport probe. It was originally used to diagnose TCP stalling issues.
Run it on another computer on the same LAN as BMC64:
hostname -I
python3 tools/modem_transport_probe.py --host <computer-lan-ip>The probe listens on TCP port 6502. From CCGMS, dial:
ATDT<computer-lan-ip>:6502
The probe exercises receive and transmit data and keeps the connection open. For a pager-style test that waits for Space, run:
python3 tools/modem_transport_probe.py \
--host <computer-lan-ip> --require-spaceFor the fragmented receive test used during modem transport debugging, run:
python3 tools/modem_transport_probe.py \
--host <computer-lan-ip> --fragmented-burst --tcp-nodelaySee tools/TRANSPORT_PROBE.md for the expected
probe output and the interpretation of unacked and retrans counters.
This probe is used to test the connection to a CNP server from within C64 OS.
Run it on another computer on the same LAN as BMC64:
For a local, credential-free driver and DTR test before using CNP, follow tools/MODEM_COMMAND_PROBE.md.