Wiznet makers

josephsr

Published July 16, 2026 ©

139 UCC

13 WCC

13 VAR

0 Contests

0 Followers

0 Following

Original Link

Ethernet Hamlib Adaptor for the G-5500 Azimuth/Elevation Rotator

A Rust-based adaptor that exposes a Hamlib rotctld interface for network control of a G-5500 azimuth/elevation rotator.

COMPONENTS Hardware components

WIZnet - W5500-EVB-Pico

x 1


PROJECT DESCRIPTION

Project Overview

The G-5500 Hamlib Adaptor is a network-connected embedded controller that adds a Hamlib-compatible Ethernet interface to a G-5500 azimuth/elevation antenna rotator. It is primarily intended for operation with Gpredict and implements a partial subset of the Hamlib rotctld protocol over TCP. The adaptor connects to the rotator controller through its GS-232 DIN interface and receives operating power from the same DIN connection.

The project includes Rust firmware, KiCad PCB design files, manufacturing Gerber files, a bill of materials, and documented hardware errata. The current hardware is identified as a development revision rather than a finished enclosed product.

Project Type

  • Embedded Ethernet control adaptor
  • Amateur-radio antenna rotator interface
  • Hamlib-compatible protocol gateway
  • Closed-loop azimuth/elevation controller
  • Open hardware and firmware prototype

Main Hardware Components

ComponentRole
WIZnet W5500-EVB-PicoMain controller board combining an RP2040 MCU, W5500 Ethernet controller, RJ45 interface, flash memory, and GPIO/ADC resources
ULN2803ADarlington transistor array used to drive the G-5500 controller’s directional relay inputs
LM2937-5.0Linear regulator supplying 5 V from the voltage available through the DIN interface
8-pin DIN connectorPower, azimuth/elevation feedback, and rotation-control connection to the G-5500 controller
GPIO 26 and 27RP2040 ADC inputs for azimuth and elevation feedback
GPIO 2–5Rotation outputs for azimuth clockwise/counterclockwise and elevation up/down
Status LEDsSystem heartbeat and active TCP-client indication

The project BOM explicitly specifies the W5500-EVB-Pico, ULN2803A, LM2937-5.0, DIN socket, protection components, filtering components, and status LEDs.

The W5500-EVB-Pico is based on the RP2040 and W5500, with the Ethernet controller connected internally through SPI-related GPIO pins. The project firmware uses these same pins for MISO, chip select, clock, MOSI, reset, and interrupt.

Software Structure

The firmware is implemented in no_std Rust using the Embassy asynchronous embedded framework. Major dependencies include embassy-rp, embassy-net, embassy-net-wiznet, asynchronous Embedded HAL interfaces, nom for command parsing, and defmt for diagnostics.

The firmware is divided into concurrent asynchronous tasks:

  1. W5500 driver task
    • Operates the W5500 through SPI.
    • Handles reset and interrupt signals.
    • Exchanges raw Ethernet frames with the network stack.
  2. Network stack task
    • Runs the embassy-net TCP/IP stack.
    • Obtains an IPv4 address through DHCP.
    • Uses the hostname g5500-hamlib-adaptor.
  3. TCP server tasks
    • Start four concurrent listener tasks.
    • Listen on TCP port 4533.
    • Apply a 60-second socket timeout.
  4. ADC feedback task
    • Samples azimuth and elevation signals through GPIO 26 and 27.
    • Processes 512 samples per channel approximately every 100 ms.
    • Rejects known RP2040 ADC differential non-linearity spike values.
    • Converts feedback values to 0–450° azimuth and 0–180° elevation.
  5. Rotator control task
    • Compares requested and measured positions every 250 ms.
    • Controls clockwise, counterclockwise, up, and down outputs.
    • Stops movement when both axes are within a 3° threshold.
  6. System supervision
    • Drives heartbeat and connection-status LEDs.
    • Uses an approximately 8.3-second watchdog.
    • Supports a command-triggered watchdog reset.

System Architecture

Gpredict / Hamlib Client
          │
          │ Hamlib rotctld commands
          │ TCP port 4533
          ▼
Ethernet Network
          │
          ▼
W5500-EVB-Pico
├─ W5500 Ethernet Controller
│  └─ MACRAW Ethernet frame interface
│
├─ RP2040 / Embassy Firmware
│  ├─ DHCP and TCP stack
│  ├─ Hamlib command parser
│  ├─ Position-demand state
│  ├─ ADC feedback processing
│  ├─ Azimuth/elevation control loop
│  └─ Watchdog and status LEDs
│
├─ GPIO 2–5
│  └─ ULN2803A output driver
│
└─ GPIO 26–27 ADC
          │
          ▼
GS-232 DIN Interface
├─ CW / CCW / UP / DOWN control
├─ Azimuth and elevation feedback
└─ Power input
          │
          ▼
G-5500 Rotator Controller and Rotator

Operation Flow

1. Network Initialization

The RP2040 initializes SPI0 at 50 MHz and connects to the W5500 through GPIO 16–21. The firmware starts the W5500 driver, creates an embassy-net network interface, requests an IPv4 configuration through DHCP, and then starts four TCP server tasks on port 4533.

2. Hamlib Command Reception

A client such as Gpredict connects to the adaptor and sends rotctld-style commands. The implemented command set includes:

  • get_info
  • get_pos
  • stop
  • park
  • set_pos
  • quit
  • dump_state
  • reset

Unknown commands return RPRT 1, while accepted control commands normally return RPRT 0.

3. Position Feedback

The G-5500’s analogue azimuth and elevation outputs pass through voltage dividers before reaching the RP2040 ADC. The firmware averages the sampled values, removes specific ADC spike codes, and converts the resulting readings into angular positions.

4. Closed-Loop Movement

A set_pos command updates the demanded azimuth and elevation. The controller activates the corresponding direction outputs until the feedback values fall within ±3° of the requested position. Azimuth requests are limited to 0–450°, and elevation requests are limited to 0–180°.

The park command moves the system to 180° azimuth and 0° elevation, while stop immediately disables all movement outputs.

WIZnet Product Usage

WIZnet Product: W5500-EVB-Pico
WIZnet Product Role: SPI-based wired Ethernet interface between the RP2040 control firmware and Hamlib-compatible network clients.

The W5500 provides the physical Ethernet connection, MAC/PHY functions, frame buffering, interrupt signalling, and SPI data path. The application firmware uses the board’s RP2040 for protocol parsing, TCP/IP processing, feedback acquisition, and motor-control decisions.

The firmware documentation specifically excludes the W55RP20-EVB-Pico because its internal W5500 wiring requires a PIO-based SPI driver that was not available for this Embassy implementation at the time documented.

TOE Usage

TOE Status: Not used for application TCP/IP processing

Although the W5500 normally supports a hardware TCP/IP offload engine and eight hardware sockets, this project operates it through embassy-net-wiznet in MACRAW mode. The W5500 passes Ethernet frames to the RP2040, while DHCP, IPv4, and TCP sockets are handled by the MCU-side embassy-net stack.

The application creates embassy_net::tcp::TcpSocket objects rather than opening and controlling W5500 hardware TCP sockets. Therefore, the W5500 TOE socket engine is bypassed even though the underlying chip is TOE-capable.

Hybrid Network Assessment

Hybrid Network: No

The implemented communication path uses wired Ethernet only. No Wi-Fi, cellular, Bluetooth, or other wireless network interface is initialized or used by the application. The presence of unrelated framework dependencies does not form a second active network path.

Strengths

  • Provides a practical network upgrade for a physical antenna rotator without replacing the existing G-5500 controller.
  • Supports Gpredict and other Hamlib-compatible software through a familiar TCP interface.
  • Combines Ethernet networking, analogue feedback, output control, and system monitoring in one RP2040-based design.
  • Uses asynchronous Rust tasks to separate networking, ADC processing, closed-loop control, and supervision.
  • Supports up to four simultaneous TCP clients.
  • Includes watchdog recovery, connection indication, system identification, uptime reporting, raw ADC diagnostics, and demanded-position reporting.
  • Publishes firmware, PCB source, Gerber files, BOM, and known hardware issues rather than presenting firmware alone.

Limitations

  • Only a partial subset of the Hamlib rotctld protocol is implemented.
  • TCP communication is unencrypted and no authentication mechanism is visible in the application code.
  • The MAC address is statically set to 02:00:00:00:00:00, which requires modification when multiple adaptors operate on the same network.
  • The current network configuration is DHCP-based; a static-IP configuration path is not implemented in the main firmware.
  • Position conversion uses a nominal 0–5 V mapping. Explicit per-device calibration constants remain commented placeholders.
  • The ±3° control threshold limits final positioning precision.
  • The PCB is a development revision and has no completed enclosure design.
  • The measured 17.3 V DIN input causes significant heat dissipation in the linear regulator.
  • ULN2803A leakage current can cause the G-5500 control relays to remain active; the current revision adds series resistors as a workaround.
  • The DIN connector pinout requires patching on the development PCB.
  • The repository currently has no published release package and limited visible external adoption.

Application Value

This project provides a reproducible reference for connecting legacy electromechanical antenna equipment to modern network-based tracking software. It is applicable to satellite tracking stations, amateur-radio antenna systems, educational ground stations, and remotely operated azimuth/elevation mechanisms.

It is also a useful implementation reference for Rust-based embedded control, Embassy asynchronous task design, RP2040 ADC processing, W5500 MACRAW operation, and TCP-controlled closed-loop actuators. Its present form is best classified as a functional engineering prototype rather than production-ready hardware because several electrical and mechanical revisions remain documented.

Final Assessment

The G-5500 Hamlib Adaptor integrates a legacy rotator controller with Ethernet-based Hamlib clients using the W5500-EVB-Pico and asynchronous Rust firmware. Its strongest technical characteristic is the complete control chain from TCP command reception to analogue position feedback and relay-level movement control.

The project uses the W5500 as a MACRAW Ethernet interface rather than as a TCP/IP offload engine. It demonstrates substantial integration value, while its partial protocol support, fixed network settings, uncalibrated feedback mapping, and development-PCB errata remain the principal constraints.

Author Information

  • Author: Phil Crump
  • GitHub account: philcrump
  • Identifier in firmware: Phil Crump, M0DNY
  • Repository copyright: Phil Crump, 2025
  • Additional affiliation: 저장소 내 명시 없음

G-5500 방위각·고각 로테이터용 Ethernet Hamlib 어댑터

프로젝트 개요

G-5500 Hamlib Adaptor는 기존 G-5500 방위각·고각 로테이터에 Hamlib 호환 네트워크 인터페이스를 추가하는 임베디드 제어 장치이다. Gpredict 사용을 주요 목적으로 하며, TCP를 통해 Hamlib rotctld 프로토콜의 일부 명령을 처리한다. 로테이터 컨트롤러와는 GS-232 DIN 포트로 연결되며, 장치 전원도 DIN 연결부에서 공급받는다.

저장소에는 Rust 펌웨어뿐 아니라 KiCad 회로·PCB 파일, Gerber 제조 파일, BOM, 하드웨어 오류 및 수정 사항이 함께 포함되어 있다. 현재 PCB는 완성 제품이 아니라 기능 검증을 위한 개발 리비전이다.

프로젝트 유형

  • 임베디드 Ethernet 제어 어댑터
  • 아마추어 무선 안테나 로테이터 인터페이스
  • Hamlib 호환 프로토콜 게이트웨이
  • 방위각·고각 폐루프 제어기
  • 오픈 하드웨어·펌웨어 프로토타입

주요 하드웨어 구성

구성 요소역할
WIZnet W5500-EVB-PicoRP2040 MCU, W5500 Ethernet 컨트롤러, RJ45, Flash, GPIO와 ADC를 포함한 메인 제어 보드
ULN2803AG-5500 컨트롤러의 방향 제어 릴레이 입력을 구동하는 Darlington 트랜지스터 어레이
LM2937-5.0DIN 포트 입력 전압을 5 V로 변환하는 선형 레귤레이터
8핀 DIN 커넥터전원, 위치 피드백, 회전 제어 신호를 G-5500 컨트롤러와 연결
GPIO 26·27방위각과 고각 아날로그 피드백을 측정하는 RP2040 ADC 입력
GPIO 2–5방위각 CW·CCW 및 고각 UP·DOWN 제어 출력
상태 LED시스템 동작과 TCP 클라이언트 연결 상태 표시

BOM에는 W5500-EVB-Pico, ULN2803A, LM2937-5.0, DIN 소켓, 전원 보호·필터 부품과 상태 LED가 구체적으로 명시되어 있다.

W5500-EVB-Pico는 RP2040과 W5500을 결합한 보드이며, 내부적으로 GPIO 16–21을 W5500 SPI, Reset, Interrupt 신호에 사용한다. 프로젝트 펌웨어도 동일한 핀 구성을 통해 W5500을 제어한다.

소프트웨어 구성

펌웨어는 Embassy 비동기 임베디드 프레임워크를 사용하는 no_std Rust로 작성되었다. 주요 구성은 embassy-rp, embassy-net, embassy-net-wiznet, Async Embedded HAL, 명령 파싱용 nom, 진단 출력용 defmt로 이루어진다.

주요 기능은 독립적인 비동기 Task로 분리된다.

  1. W5500 드라이버 Task
    • SPI를 통한 W5500 초기화와 데이터 전송
    • Interrupt 및 Reset 신호 처리
    • Ethernet Frame 송수신
  2. 네트워크 스택 Task
    • embassy-net TCP/IP 스택 실행
    • DHCP 기반 IPv4 주소 할당
    • g5500-hamlib-adaptor Hostname 사용
  3. TCP 서버 Task
    • 최대 4개의 동시 Listener 실행
    • TCP 4533 포트 사용
    • 각 연결에 60초 Timeout 적용
  4. ADC 피드백 Task
    • GPIO 26과 27에서 방위각·고각 전압 측정
    • 채널당 512개 Sample을 약 100 ms 주기로 처리
    • RP2040 ADC의 알려진 DNL Spike 값 제외
    • 방위각 0–450°, 고각 0–180°로 변환
  5. 로테이터 제어 Task
    • 250 ms 주기로 목표값과 현재값 비교
    • CW, CCW, UP, DOWN 출력 제어
    • 두 축이 목표값의 ±3° 범위에 들어오면 구동 정지
  6. 시스템 감시 기능
    • Heartbeat LED와 접속 상태 LED 제어
    • 약 8.3초 Watchdog 사용
    • 명령을 통한 시스템 Reset 지원

시스템 구조

Gpredict / Hamlib Client
          │
          │ Hamlib rotctld 명령
          │ TCP 4533
          ▼
Ethernet Network
          │
          ▼
W5500-EVB-Pico
├─ W5500 Ethernet Controller
│  └─ MACRAW Ethernet Frame 인터페이스
│
├─ RP2040 / Embassy Firmware
│  ├─ DHCP 및 TCP/IP Stack
│  ├─ Hamlib 명령 Parser
│  ├─ 목표 위치 상태 관리
│  ├─ ADC 피드백 처리
│  ├─ 방위각·고각 제어 루프
│  └─ Watchdog 및 상태 LED
│
├─ GPIO 2–5
│  └─ ULN2803A 출력 Driver
│
└─ GPIO 26–27 ADC
          │
          ▼
GS-232 DIN Interface
├─ CW / CCW / UP / DOWN 제어
├─ 방위각·고각 피드백
└─ 전원 입력
          │
          ▼
G-5500 Controller 및 Rotator

동작 흐름

1. Ethernet 초기화

RP2040은 SPI0를 50 MHz로 설정하고 GPIO 16–21을 통해 W5500과 통신한다. W5500 드라이버 Task가 시작된 뒤 embassy-net 인터페이스가 생성되며, DHCP로 IPv4 주소를 받은 후 TCP 4533 포트에 4개의 Listener Task가 실행된다.

2. Hamlib 명령 수신

Gpredict 또는 다른 Hamlib 클라이언트가 TCP로 접속해 rotctld 형식의 명령을 전송한다. 코드에서 확인되는 명령은 다음과 같다.

  • 장치 정보 조회
  • 현재 위치 조회
  • 회전 정지
  • Park 위치 이동
  • 목표 위치 설정
  • TCP 연결 종료
  • 내부 상태 출력
  • 시스템 Reset

지원되는 제어 명령에는 일반적으로 RPRT 0이 반환되며, 인식되지 않은 명령에는 RPRT 1이 반환된다.

3. 위치 피드백 처리

G-5500의 방위각과 고각 아날로그 출력은 분압 회로를 거쳐 RP2040 ADC로 전달된다. 펌웨어는 다수의 Sample을 평균화하고 특정 ADC Spike 값을 제외한 뒤, 측정값을 실제 각도로 변환한다.

4. 폐루프 위치 제어

set_pos 명령이 수신되면 목표 방위각과 고각이 갱신된다. 제어 Task는 현재 위치가 목표 위치의 ±3° 범위에 들어올 때까지 각 축의 방향 출력을 활성화한다. 입력 가능한 목표값은 방위각 0–450°, 고각 0–180° 범위로 제한된다.

park 명령은 방위각 180°, 고각 0°를 목표로 설정하고, stop 명령은 모든 방향 출력을 즉시 비활성화한다.

WIZnet 제품 사용 여부와 역할

사용 제품: W5500-EVB-Pico
WIZnet Product Role: RP2040 제어 펌웨어와 Hamlib 네트워크 클라이언트를 연결하는 SPI 기반 유선 Ethernet 인터페이스

W5500은 Ethernet PHY와 MAC, Frame Buffer, SPI 데이터 경로, Interrupt 신호를 제공한다. RP2040은 Hamlib 명령 분석, TCP/IP 처리, ADC 피드백 측정과 회전 제어 판단을 담당한다.

펌웨어 문서에는 W55RP20-EVB-Pico를 사용할 수 없다고 명시되어 있다. 해당 보드의 내부 W5500 배선에는 PIO 기반 SPI Driver가 필요하지만, 이 프로젝트가 사용한 Embassy 환경에는 당시 대응 Driver가 존재하지 않았기 때문이다.

TOE 사용 여부

TOE 사용 여부: 미사용

W5500은 원래 하드웨어 TCP/IP Stack과 8개 Hardware Socket을 지원하는 TOE 계열 컨트롤러이다. 그러나 이 프로젝트의 embassy-net-wiznet Driver는 W5500을 MACRAW Mode로 동작시킨다.

MACRAW Mode에서는 W5500이 Ethernet Frame 송수신 장치로 사용되고, DHCP, IPv4와 TCP 처리는 RP2040에서 실행되는 embassy-net 소프트웨어 Stack이 담당한다. 애플리케이션 또한 W5500 Socket Register가 아니라 embassy_net::tcp::TcpSocket을 생성한다.

따라서 W5500 제품은 사용하지만, W5500의 하드웨어 TCP/IP Socket Engine을 통한 TOE Offload는 사용하지 않는다.

Hybrid Network 여부

Hybrid Network: 해당 없음

코드에서 활성화되는 네트워크 경로는 W5500 유선 Ethernet뿐이다. Wi-Fi, Cellular, Bluetooth 또는 다른 무선 네트워크 인터페이스의 초기화와 동시 사용은 확인되지 않는다.

장점

  • 기존 G-5500 컨트롤러를 교체하지 않고 네트워크 제어 기능을 추가할 수 있다.
  • Gpredict 및 Hamlib 호환 프로그램에서 표준적인 TCP 연결 방식으로 접근할 수 있다.
  • Ethernet 통신, 아날로그 위치 측정, 방향 출력과 상태 감시가 하나의 RP2040 시스템에 통합되어 있다.
  • Rust Async Task를 통해 네트워크, ADC, 제어 루프와 시스템 감시 기능이 분리되어 있다.
  • 최대 4개의 TCP Client를 동시에 처리할 수 있다.
  • Watchdog, 연결 상태 LED, 장치 정보, Uptime, ADC Raw 값과 목표 위치 출력 기능을 제공한다.
  • 펌웨어뿐 아니라 PCB 원본, Gerber, BOM과 알려진 하드웨어 문제까지 공개되어 있다.

한계

  • Hamlib rotctld 전체 명령이 아닌 일부 명령만 구현되어 있다.
  • TCP 구간의 암호화와 인증 기능은 코드상 확인되지 않는다.
  • MAC 주소가 02:00:00:00:00:00으로 고정되어 있어 여러 장치를 같은 네트워크에서 사용할 경우 변경이 필요하다.
  • 현재 네트워크 설정은 DHCP 방식이며, Main Firmware에서 Static IP 설정 경로는 확인되지 않는다.
  • 위치 변환은 기본적인 0–5 V 범위 계산을 사용하며, 장치별 보정값은 미구현 Placeholder 상태이다.
  • ±3° 제어 Threshold로 인해 최종 위치 정밀도에 한계가 있다.
  • 현재 PCB는 개발용이며 Enclosure 설계가 완료되지 않았다.
  • DIN 포트에서 측정된 17.3 V 입력으로 인해 선형 레귤레이터의 발열이 크다.
  • ULN2803A의 누설 전류가 G-5500 릴레이를 계속 활성화할 수 있어 직렬 저항을 추가하는 임시 조치가 적용되었다.
  • 개발 PCB의 DIN Pinout 일부는 Patch Pad를 통해 수정해야 한다.
  • 공개 Release Package가 없으며 저장소에서 확인되는 외부 활용 사례와 반응은 아직 제한적이다.

적용 가치

이 프로젝트는 기존 전동식 안테나 장비를 현대적인 네트워크 추적 소프트웨어에 연결하는 재현 가능한 사례이다. 위성 추적 지상국, 아마추어 무선 안테나 시스템, 교육용 Ground Station과 원격 방위각·고각 구동 장치에 적용할 수 있다.

기술적으로는 Rust 기반 임베디드 제어, Embassy Async 구조, RP2040 ADC 처리, W5500 MACRAW 통신과 TCP 기반 폐루프 Actuator 제어를 함께 확인할 수 있는 구현 사례이다. 다만 PCB의 전원·누설 전류·커넥터 문제가 문서화되어 있으므로 현재 상태는 양산형 장치보다 기능 검증용 Engineering Prototype에 가깝다.

종합 평가

G-5500 Hamlib Adaptor는 W5500-EVB-Pico와 Rust 비동기 펌웨어를 이용해 기존 로테이터 컨트롤러를 Ethernet 기반 Hamlib 환경에 연결한다. TCP 명령 수신부터 ADC 위치 피드백, 방향 출력 제어까지 전체 제어 경로가 실제 코드와 PCB로 구현되어 있다는 점이 핵심이다.

W5500은 MACRAW Ethernet 인터페이스로 사용되며 하드웨어 TCP/IP Offload는 사용하지 않는다. 전체 시스템 통합도는 높지만, 부분적인 프로토콜 지원, 고정 네트워크 설정, 미완성 위치 보정과 개발 PCB의 전기적 문제는 추가 개선이 필요한 항목이다.

저자 정보

  • 저자: Phil Crump
  • GitHub 계정: philcrump
  • 펌웨어 내 표기: Phil Crump, M0DNY
  • 저장소 저작권 표기: Phil Crump, 2025
  • 소속 및 조직: 저장소 내 명시 없음
Documents
  • g5500-hamlib-adaptor

Comments Write