Hi,
I am writing an application on esp32 dev board where data will be received on Uart, which will be shared to the further tasks.
Wrote driver for UART1 using IO17 for TXD and IO16 for RXD in dev board.
Below is the task for uart for receiving data :
static void rx_task()
{
static const char *RX_TASK_TAG = "RX_TASK";
ESP_LOGI(RX_TASK_TAG,"rx task started \n");
esp_log_level_set(RX_TASK_TAG, ESP_LOG_INFO);
uint8_t* data = (uint8_t*) malloc(RX_BUF_SIZE+1);
while (1)
{
const int rxBytes = uart_read_bytes(UART_NUM_1, data, (RX_BUF_SIZE-1), 1000 / portTICK_RATE_MS);
if(rxBytes > 0)
{
data[rxBytes] = 0;
if(rfid_queue != 0)
{
xQueueSendToBack(rfid_queue, data, ( TickType_t ) 10 );
ESP_LOG_BUFFER_HEXDUMP("Http Queue", data, rxBytes, ESP_LOG_INFO);
}
ESP_LOGI(RX_TASK_TAG, "Read %d bytes: '%s'", rxBytes, data);
}
}
free(data);
}
My problem is that uart is receiving some random data continuously from the external device attached through uart. Also, I have connected that device to pc, it was not receiving any such data as esp32 was. Could you suggest something on this ?
Thanks
Ritu.
UART Receiving Random Data
Re: UART Receiving Random Data
What module are you using? WROOM or WROVER?
Re: UART Receiving Random Data
Would help to know what the other device is. Or have you checked the voltages of the TX/RX pins from the other device to make sure its not higher than 3.3v ? For instance if you using an Arduino, those pins will be 5v which is to high.
Re: UART Receiving Random Data
Hi,
I am using ESP32 wroom32 dev board. Will check the voltage on RX/TX pin and shall let you know.
Thanks
Ritu
I am using ESP32 wroom32 dev board. Will check the voltage on RX/TX pin and shall let you know.
Thanks
Ritu
Who is online
Users browsing this forum: No registered users and 106 guests