Skip to main content

Network configuration tool for HW-VX6330K / HW-VX6346KL serial-to-Ethernet modules

Project description

hw-vx-config

PyPI version Python License: MIT CI

Network configuration tool for HW-VX6330K / HW-VX6346KL serial-to-Ethernet modules on Linux. Sends UDP packets directly to the device — no DLLs, no runtime dependencies, pure stdlib.

Accepts a device IP or discovers via broadcast; reads and writes all network, serial, and advanced settings over the HW-VX UDP protocol (port 65535).

Table of Contents

Requirements

  • Python 3.10 or later
  • Linux (uses SO_BROADCAST; port 65535 requires no root)
  • Device reachable on the local network (same subnet or routed UDP)

Quick Start

pip install hw-vx-config

# Discover all readers on the network
hw-vx-config search

Or install with pipx for isolated CLI usage:

pipx install hw-vx-config

CLI Reference

All operations take the current device IP as the first positional argument.

# Discover all readers via broadcast
hw-vx-config search

# Print full configuration for a device
hw-vx-config config <ip>

# Change static IP and reboot
hw-vx-config set-ip <current-ip> <new-ip>

# Enable or disable DHCP and reboot
hw-vx-config dhcp <ip> on|off

# Send reboot command
hw-vx-config reboot <ip>

# Launch interactive menu
hw-vx-config interactive
hw-vx-config              # same — interactive is the default

Interactive Menu

The interactive menu (hw-vx-config with no arguments) provides a numbered prompt:

1. Search for readers          — broadcast discovery, select from results
2. Connect to specific IP      — skip discovery, target a known address directly
3. Show current configuration
4. Change IP address
5. Enable/Disable DHCP
6. Edit & save full configuration — field-by-field editor, confirm before write
7. Change remote server        — set Remote IP, Remote Port, Work Mode
8. Reboot reader
q. Quit

Option 2 is useful when the device is on a different subnet and broadcast cannot reach it.

Protocol

UDP on port 65535. Every packet is ASCII. Replies are prefixed with A.

Prefix Direction Action
X → device Broadcast echo — triggers discovery reply
W{mac} → device Select device by MAC
L → device Login
O → device Logout
G{code} → device Get one setting
S{code}{value}|{seq} → device Set one setting
E → device Save and reboot
A{payload} ← device All replies

Discovery reply format: A{mac}/{port}/.../{username}/{device_name} from the device's source IP.

Setting codes of note: IP (IP address), NM (subnet mask), GI (gateway), DH (DHCP), BR (baud rate), TP (protocol), RM (work mode). Full table in src/hw_vx_config/constants.py.

Examples

The examples/ directory contains companion scripts.

File Description
server_uhf.py TCP server that receives RFID tag data from the reader on port 2077. Run this alongside the reader when Work Mode is set to Client and Remote Port is 2077.
library_usage.py Shows how to use HwVxDevice and HwVxNetworking directly in Python code — discover, read config, change settings, and quick operations.
python examples/server_uhf.py
# Listening on 0.0.0.0:2077

Development

Install with dev extras, then use the standard toolchain:

pip install -e ".[dev]"

# Lint and format
ruff check --fix src/ tests/
ruff format src/ tests/

# Type check
mypy src/

# Run tests
pytest

# Tests with coverage
pytest --cov=hw_vx_config --cov-report=term-missing

Tests live in tests/ and mock the UDP socket — no device needed to run them.

Troubleshooting

Problem Possible cause Fix
search returns nothing Firewall blocks UDP 65535 Open UDP 65535 inbound/outbound (sudo ufw allow 65535/udp)
Device on a different subnet Use hw-vx-config interactive → option 2 (connect by IP)
Broadcast not reaching device Ensure host and device share the same L2 network / VLAN
Timeout on config / set-ip Device IP changed or unreachable Verify with ping <ip>; re-discover with search
Permission denied on socket Rare kernel policy Run with sudo or check sysctl net.ipv4.ip_unprivileged_port_start

Uninstall

pip uninstall hw-vx-config
# or if installed with pipx:
pipx uninstall hw-vx-config

Tested with

  • Hardware: HW-VX6330K, HW-VX6346KL
  • Protocol: UDP port 65535, ASCII request/reply
  • OS: Linux (Ubuntu 22.04+)

License

MIT — see PyPI page for the published package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hw_vx_config-0.1.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hw_vx_config-0.1.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file hw_vx_config-0.1.1.tar.gz.

File metadata

  • Download URL: hw_vx_config-0.1.1.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hw_vx_config-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d377d29f03ec477800a32437ada5a53e239ef4605f521818b6c401f11a5df5aa
MD5 55418bd03dcead1b7dd4b2972214dd0a
BLAKE2b-256 4b6a0fdcbd8c0ec7558a190d7f83eb9bde9e7ed4a749bde914cef84354a129d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hw_vx_config-0.1.1.tar.gz:

Publisher: publish.yml on xynogen/hw-vx-config

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hw_vx_config-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hw_vx_config-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hw_vx_config-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57343c59526f1d74416f6628b92003c2e28356dd1fb7c1928695e17586d58f64
MD5 1e4800da21d873dfbdb7ca4daf092c35
BLAKE2b-256 8c6fa19ebd31cb0de97c06982dd5837596339f862136314a8643e443558a3142

See more details on using hashes here.

Provenance

The following attestation bundles were made for hw_vx_config-0.1.1-py3-none-any.whl:

Publisher: publish.yml on xynogen/hw-vx-config

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page