Skip to content

Instantly share code, notes, and snippets.

@djbr1
djbr1 / instructions.md
Last active February 10, 2022 09:22
How to configure WSL (Windows Ubuntu subsystem) to see USB serial ports and connect to Xiegu X6100

How to configure WSL (Windows Ubuntu subsystem) to see USB serial ports and connect to Xiegu X6100

Problem: WSL does not see USB serial ports on win10 (CH34x driver)

Solution based on: (https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/ )

Install USBIPD

To get started with this functionality, first ensure you’re running Windows 10/11 and have installed all WSL updates. Running uname -a from within WSL should report a kernel version of 5.10.60.1 or later. You’ll need to be running a WSL 2 distro.

Install the latest release of usbipd-win..

@djbr1
djbr1 / x6100_sqlite.txt
Last active December 24, 2023 13:15
X6100 sqlite DB. Commands to change CW memory, VFO memory, CW filter bandwidth etc.
# using ssh or console, login to your X6100
# stop GUI
[root@XIEGU-x6100:/root]# /etc/init.d/S99userappstart stop
Stopping user app daemon: stopped /usr/app_qt/x6100_ui_v100 (pid 248)
OK
# recently monit introduced, now stop/start as below:
[root@XIEGU-x6100:/]# cat ./etc/monitrc
[root@XIEGU-x6100:/root]#
[root@XIEGU-x6100:/root]# ./evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: matrix_keypad@0 # buttons # type 4 (EV_MSC), code 4 (MSC_SCAN),
/dev/input/event1: rotary@0 # VFO # type 2 (EV_REL), code 0 (REL_X), value -1
@djbr1
djbr1 / X6100_block_diagram.txt
Last active November 12, 2024 06:27
X6100 block diagram
+------------+
Power 12v | STM 32 | RJ45 Mic
Antenna | DSP engine | S/P (headphone)
I/Q | (Base) | KEY (paddles or straight)
| | ACC (linear amplifier interface)
+-----+------+ USB DEV (CAT control and tx/rx audio)
|I2C or ?
----------------|------------------------------------------
|
+-----+------+
@djbr1
djbr1 / x6100_usb_audio-usb.txt
Last active April 30, 2022 14:37
x6100 usb-audio and usb devices
WSJT Radio control goes over /dev/ttyACM1
WSJT Audio configuration with loopback USB cable plugged:
Input plughw:CARD=Device,DEV=0
Output plughw:CARD=Device,DEV=0
@djbr1
djbr1 / sound_recorder.py
Created October 9, 2022 14:39 — forked from mabdrabo/sound_recorder.py
Simple script to record sound from the microphone, dependencies: easy_install pyaudio
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@djbr1
djbr1 / emulate_x6100_keypress.txt
Last active January 22, 2023 10:51
emulate ATU (antenna tunner) button press on X6100
# Prerequisite: armbian and evemu-tools
# It may be difficult to install evemu-tools package on stock buildroot OS due to probably missing dependencies
# record ATU/TUNE keypress:
root@x6100:~# evemu-record /dev/input/event0 tunebutt.txt
# replay short keypress (ATU toggle on-off)
root@x6100:~# evemu-play /dev/input/event0 < ATUbutt.txt
# replay long keypress (TUNE)
@djbr1
djbr1 / band_limited_noise
Last active December 22, 2023 10:10
band limited noise
#
#
def fftnoise(f):
f = np.array(f, dtype='complex')
Np = (len(f) - 1) // 2
phases = np.random.rand(Np) * 2 * np.pi
phases = np.cos(phases) + 1j * np.sin(phases)
f[1:Np+1] *= phases
f[-1:-1-Np:-1] = np.conj(f[1:Np+1])