Hi,
I am having difficulty sending commands to control output data from a RS485 device connected to a ESP32 device via bluetooth smartphone. The ESP32 has bluetooth enabled and is connected to the PC via USB and has Pins TX, RX, 5V, and GND connected to a TTL to RS485 Adapter Module which is connected to the RS485 device.
I am able to receive data from the RS485 device via ESP32 bluetooth to my phone's bluetooth serial app. However, when I try to send a command via the bluetooth serial app the command is completely ignored and I can only read the received data only.
The TTl to RS485 module details is found here:
https://esp32io.com/tutorials/esp32-rs485
The code I used is the following via Arduino IDE. I use bluetooth serial app on my phone as bluetooth to be paired with the ESP32 bluetooth.
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
void setup() {
Serial.begin(115200);
SerialBT.begin("ESP32test"); //Bluetooth device name
Serial.println("The device started, now you can pair it with bluetooth!");
}
void loop() {
if (Serial.available()) {
SerialBT.write(Serial.read());
}
if (SerialBT.available()) {
Serial.write(SerialBT.read());
}
delay(20);
}
I have disconnected the ESP32 and connected only the TTl to RS485 adaptor hooked to the RS485 device to my PC with a 4Pin TTl cable and entered the input commands and I was able to see a change in output responce from the RS485 device. So that eliminates any hardware issues with the TTL to RS485 module connected to the RS485 device.
I am really stumped and puzzed as why I am able to receive output data from the RS485 device via blueooth on my phone with no issues but the RS485 is ignoring the commands I send from the phone bluetooth. Any help will be appreciated.
RS485 Device ignoring Bluetooth Commands via ESP32
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- ESP32-S31
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- ESP32-S31 中文讨论版
- 喵伴 中文讨论版
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Semrush [Bot] and 1 guest
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
Information
Espressif ESP32 ... Available now!