I tried to connect the cell phone and ESP32 through Bluetooth using ESP32 and app inventor.
At first, error 503 not a valid mac address error was displayed and the connection was not successful.
So, the mac address of ESP32 and the mac address of ESP32 in the app inventory list are slightly different, so we made ESP32's mac address the same as the address in the list.
After uploading it, I connected it to the app inventory, and an error window appeared like in the picture
I can't connect.
What's the solution?
#include <WiFi.h>
#include<esp_wifi.h>
#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
uint8_t newMACAddress[] = {0x78, 0x21, 0x84, 0xBB, 0x3E, 0x3A};
void setup()
{
WiFi.mode(WIFI_STA);
Serial.begin(115200);
SerialBT.begin("ESP_CAR");
pinMode(25, OUTPUT); //왼바퀴 검은선
pinMode(27, OUTPUT); //왼바퀴 파란선
pinMode(17, OUTPUT); //오른바퀴 검은선
pinMode(18, OUTPUT); //오른바퀴 빨간선
}
void loop()
{
char data1 = SerialBT.read();
if (SerialBT.available())
{
if (data1 == 'g')
{
analogWrite(25, 180);
analogWrite(27, 0);
analogWrite(17, 180);
analogWrite(18, 0);
}
if (data1 == 's')
{
analogWrite(25, 0);
analogWrite(27, 0);
analogWrite(17, 0);
analogWrite(18, 0);
}
if (data1 == 'l')
{
analogWrite(25, 0);
analogWrite(27, 150);
analogWrite(17, 150);
analogWrite(18, 0);
}
if (data1 == 'r')
{
analogWrite(25, 150);
analogWrite(27, 0);
analogWrite(17, 0);
analogWrite(18, 150);
}
if (data1 == 'b')
{
analogWrite(25, 0);
analogWrite(27, 180);
analogWrite(17, 0);
analogWrite(18, 180);
}
}
}