finallyfunctional / bluetooth-windows-esp32-example

This repository is a sample on how to connect from a Windows 10 PC to an ESP32 via bluetooth and windows sockets.
MIT License
17 stars 8 forks source link

Initial run and LNK2019 errors #1

Open AmberElferink opened 2 years ago

AmberElferink commented 2 years ago

Thanks for the nice example on a simple Bluetooth Classic implementation.

When starting the sln in Visual Studio Community normally, and not doing anything special, it gives some linker errors. It is easily fixable by linking to the libraries in the project, but it's also a simple fix to add this at the top:

#pragma comment(lib, "Bthprops.lib")
#pragma comment(lib, "Ws2_32.lib")

I think that should clear up the errors that can be daunting for beginners.

Additionally, for complete newcomers, it would be handy to explain to install Arduino IDE to open the ino file, (or alternatively PlatformIO in Visual Studio Code). With Visual Studio Community you can open the sln file.

For just a bit I was confused as to why I only received one message on the PC side. For others with the same issue: the firmware in the ESP32 also waits to receive some data from the PC before sending the next data. So if you send a message back on the last line of the while loop in receiveMessageFromESP32 (just write sendMessageToEsp32(); to test), it will print messages repeatedly.

Thanks again for the example!