Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15287

ESP32-WROOM-DA-Module vs. BlueTooth

$
0
0

Salve a tutti
E' qualche mese che utilizzo con soddisfazione un ESP32 Az-Delivery.
Ora ho avuto necessità di utilizzare il BlueTooth integrato.
Dopo varie peripezie ho ridotto il tutto ai minimi termini utilizzando un progetto non mio.
Per il test utilizzo un vecchio Huawei PL10 con installata l'app "Serial BlueTooth Terminal"
Il problema è che riesco a vedere il mio device ma non fa il pairing, segnalando che è impossibile connettersi.
Utilizzando un ArduinoUNO+ un modulo BlueTooth HC05-06 tutto funziona regolarmente.
Il progetto, non mio, che ho utilizzato è "Serial_To_Serial_BlueTooth", questo:

//This example code is in the Public Domain (or CC0 licensed, at your option.)
//By Evandro Copercini - 2018
//
//This example creates a bridge between Serial and Classical Bluetooth (SPP)
//and also demonstrate that SerialBT have the same functionalities of a normal Serial

/*********************************************************************
https://randomnerdtutorials.com/esp32-bluetooth-classic-arduino-ide/
**********************************************************************/

#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;

#define GPIO_LED  13      // pin 15


////////////////////////////////////////////////////////////////////////////////////////////////
void setup() 
{
  Serial.begin(115200);
  pinMode((GPIO_LED), OUTPUT);
  
  SerialBT.begin("ESP32test"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
}


////////////////////////////////////////////////////////////////////////////////////////////////
void loop() 
{
  digitalWrite(GPIO_LED, !digitalRead(GPIO_LED));
  delay(100);

  if (Serial.available()) 
  {
    SerialBT.write(Serial.read());
  }
  if (SerialBT.available()) 
  {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

Qualcuno può aiutarmi?
grazie

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15287

Trending Articles