Bluetooth on the 5 inch screen - function not supported?

Hello, I just tried to follow the Course guides, with the idea I just wanted to test bluetooth on the 5inch panel version.
Based on what I can see, It doesn't work? Am I missing something?

Simplified, the code to try and connect via bluetooth classic (master to slave) would be:

#include "BluetoothSerial.h"
BluetoothSerial SerialBT;  
SerialBT.begin(myName, true); // Start Bluetooth serial  
SerialBT.setPin(pin); // Set the pairing code  

With the last line of code, I get this error
no matching function for call to 'BluetoothSerial::setPin(const char*&)'
It's a v3 panel if that helps.
What step am I missing?

Comments

  • I thought I'd try an isolated piece of code using solely bluetooth as well, but I think I'm missing something there too - the code won't compile for the board using this.

    #include "BluetoothSerial.h"  // Include the BluetoothSerial library
    
    BluetoothSerial SerialBT;  // Create a BluetoothSerial object
    
    void setup() {
      Serial.begin(115200);  // Initialize serial communication at 115200 baud rate
      if (!SerialBT.begin("ESP32_SPP")) {  // Start Bluetooth with device name "ESP32_SPP"
        Serial.println("An error occurred initializing Bluetooth");
      } else {
        Serial.println("Bluetooth started. You can now pair your device.");
      }
    }
    
    void loop() {
      // Check if there's data available from the Bluetooth connection
      if (SerialBT.available()) {
        // Read the incoming data
        char incomingChar = SerialBT.read();
        Serial.print("Received: ");
        Serial.println(incomingChar);
    
        // Send back a response
        SerialBT.print("I received: ");
        SerialBT.println(incomingChar);
      }
    
      // Optionally, you can send data from the Serial Monitor to the connected Bluetooth device
      if (Serial.available()) {
        String data = Serial.readString();
        SerialBT.println(data);
      }
    }
    

    The error I get here is "Error compiling for board ESP32S3 Dev Module."

  • Hello @SuperRoach
    The chip of the 5-inch HMI is ESP32 S3, which doesn't support Bluetooth.

    And for the error message, please check if the setting is correct(please refer to https://www.elecrow.com/wiki/ESP32_Display_5.0-inch_HMI_Arduino_Tutorial.html#upload-the-code )

Sign In or Register to comment.