/*
The DRA818V module is a compact wireless voice transceiver module that works on the VHF band. It communicates with your microcontroller through UART (serial communication).
Assuming you are connecting DRA818V's TX to ESP32's GPIO16 (U2RXD) and DRA818V's RX to ESP32's GPIO17 (U2TXD).
The commands sent to the DRA818V in this example are:
*/
#define DRA818V_RX 16 // Connect to TX pin of DRA818V
#define DRA818V_TX 17 // Connect to RX pin of DRA818V
HardwareSerial DRA818V(2); // Using Serial2 (RX, TX)
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // Wait for serial port to connect
}
Serial.println("DRA818V test!");
// Set the data rate for the DRA818V
DRA818V.begin(9600, SERIAL_8N1, DRA818V_RX, DRA818V_TX);
delay(500);
// Configure DRA818V
DRA818V.println("AT+DMOSETGROUP=0,144.3900,144.3900,0000,5,0001"); // Set to frequency 144.3900 MHz
delay(1000); // Wait for settings to take effect
DRA818V.println("AT+DMOSETVOLUME=4"); // Set volume level
delay(1000); // Wait for settings to take effect
DRA818V.println("AT+SETFILTER=1,1,1"); // Set audio filtering
delay(1000); // Wait for settings to take effect
DRA818V.println("AT+DMOSETSQL=4"); // Set squelch level
delay(1000); // Wait for settings to take effect
DRA818V.println("AT+SETPTTID=0000,0000"); // Set the PTT ID
delay(1000); // Wait for settings to take effect
}
void loop() {
// put your main code here, to run repeatedly:
}
Comments