Context
The world of radio amateurs and professionals often requires programming and configuring radios. Traditionally, this is done using a cable and specialized software like CHIRP, which needs to be run on a laptop or another computer. However, in field conditions or without an available cable, this can be inconvenient and even impossible.
The solution to this problem is creating a wireless programmer based on ESP32. This device allows programming the radio station without connecting to a computer, using only a Wi-Fi network. In this article, we will explore how to create such a programmer for the Quansheng UV-K5 radio station.
Hardware
Pinout of 2-pin Kenwood Connector (TX/RX)
To connect ESP32 to the Quansheng UV-K5 radio station, you need to use a 2-pin Kenwood connector. This connector has two contacts: TX (transmit) and RX (receive).
The UART levels for this connection are 3.3V, and the data transfer rate is 38400 baud. This is important to consider when configuring ESP32.
Connection to ESP32
To connect ESP32 to the radio station, follow these steps:
- Connect the TX contact of the radio station to GPIO1 (TX) on ESP32.
- Connect the RX contact of the radio station to GPIO3 (RX) on ESP32.
- Connect 3.3V power from ESP32 to the corresponding contact on the radio station if it is necessary for UART operation.
Software
The ESP32 will set up a Wi-Fi access point with an IP address of 192.168.4.1. This will allow connecting to ESP32 through a web interface and performing EEPROM channel read/write operations, as well as uploading custom .bin firmware.
Web Interface
For creating the web interface, C++ programming language and Arduino library are used. Example code for setting up Wi-Fi and web server:
#include <WiFi.h>
#include <WebServer.h>
const char* ssid = "ESP32_AP";
const char* password = "";
WebServer server(80);
void setup() {
Serial.begin(115200);
WiFi.softAP(ssid, password);
IPAddress IP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(IP);
server.on("/", handleRoot);
server.begin();
}
void loop() {
server.handleClient();
}
void handleRoot() {
String html = "<html><body><h1>ESP32 Web Server</h1>"
"<p>IP Address: <a href='http://" + WiFi.softAPIP().toString() + "'>" + WiFi.softAPIP().toString() + "</a></p>"
"</body></html>";
server.send(200, "text/html", html);
}
Reading/Writing EEPROM Channels and Uploading Firmware
The Wire.h library is used for working with EEPROM channels and uploading custom .bin firmware. Example code for reading data from EEPROM:
#include <Wire.h>
#define EEPROM_ADDR 0x50
void setup() {
Serial.begin(115200);
Wire.begin();
}
void loop() {
Wire.beginTransmission(EEPROM_ADDR);
Wire.write(0x00); // Address for reading
Wire.endTransmission(false);
Wire.requestFrom(EEPROM_ADDR, 1);
if (Wire.available()) {
int data = Wire.read();
Serial.print("Data: ");
Serial.println(data);
}
delay(1000);
}
Real Problem from Practice — «Deaf Receiver» After Experiments and KV-Mode Si4732
While working with the Quansheng UV-K5 radio station, a situation may arise where the radio stops receiving weak signals, although it responds normally to transmission and menu commands. This phenomenon is known as a «deaf receiver».
Symptoms and Diagnosis
The main symptom is that the radio stops receiving weak signals but retains the ability to transmit data and respond to menu commands. This can be caused by several factors, including issues with the power supply of the LNA stage of the BK4819 microcircuit.
Cause
In this case, the problem was that at ultra-low power (0.25W), the power supply to the LNA stage of the BK4819 microcircuit dropped. This led to a decrease in receiver sensitivity and the inability to receive weak signals.
To solve the problem, switching to higher power (5W) was performed. This fully restored the receiver’s sensitivity and allowed the radio to normally receive weak signals.
Example of UART Initialization Sequence / Communication Protocol
For successful operation with the radio station, it is necessary to correctly configure the UART initialization sequence and communication protocol. Example code for initializing UART:
void setup() {
Serial.begin(38400);
while (!Serial) {
; // Waiting for port connection
}
}
void loop() {
if (Serial.available()) {
int data = Serial.read();
Serial.print("Received: ");
Serial.println(data);
}
}
Conclusions
Creating a wireless programmer based on ESP32 for the Quansheng UV-K5 radio station significantly simplifies the process of programming and configuring the device. This is especially useful in the absence of a cable or computer.
«The wireless programmer on ESP32 is not only convenient but also allows for quick response to changes and experimentation with radio settings.»
However, as practice shows, various problems such as a «deaf receiver» can arise when working with radios. It is important to understand the causes of such problems and know how to diagnose and eliminate them. In this case, switching to higher power restored the receiver’s sensitivity.
The ESP32 is a powerful tool for creating various devices and solutions, including wireless programmers. With its help, you can not only simplify working with radios but also create many other useful devices for radio amateurs and professionals.
Добавить комментарий