Notifications
Clear all

Getting Bluetooth to work on WeMos D1 R2 ESP8266 board

16 Posts
4 Users
3 Reactions
1,587 Views
(@bbutcher85)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

I purchased a LINLO WeMos D1 R2 board with built in WiFi and Bluetooth capability along with some shields to add stepper motors and such. This is an WSP8266 board similar to the D1 Mini, but has the WiFi and Bluetooth module ESP-12F integrated onto the board.

 

I am programming it with the Arduino IDE 1.8.19 (Windows7 32 bit), set up to use the LOLIN WeMos D1 R2 & Mini board. I have not found a library that includes Bluetooth or BLE for this board so far, so examples do not include Bluetooth.

 

I followed the great video “Introduction to ESP32-Getting Started”, and was able to adapt the examples to get Blink and WiFi working to the point I can turn an LED on and off from a web browser. When I try to adapt the Bluetooth I hit a fatal error. I then tried to get a “BLE Notify” example for a different ESP8266 board to compile, but also hit a fatal error I cannot seem to correct.

 

When I try to compile there are many missing header files. I have been able to locate most of the missing header files on github.com. I created a directories in my IDE program

(e.g. “C:\Program Files\Arduino\libraries\BluetoothSerial” and copied “BluetoothSerial.h” into it).

 

I then compiled again, finding the next missing header file. I repeated this until I could not go further.

 

I could not find “esp_bt.h” anywhere. I did locate what I think might be similar “BlynkSimpleEsp32_BT.h”. I copied this file and renamed it “esc_bt.h” and this seemed to compile. Then I hit a roadblock:

The error is:

 

C:\Users\Bob\My Documents\Arduino\libraries\ESP32_BLE_Arduino\src/FreeRTOS.h:14:10: fatal error: freertos/FreeRTOS.h: No such file or directory

   14 | #include <freertos/FreeRTOS.h>   // Include the base FreeRTOS definitions.

     |         ^~~~~~~~~~~~~~~~~~~~~

compilation terminated.

 

I found the missing file at github, but no matter where I try to copy it, it will not compile. The IDE appears to be looking in a folder I cannot access.

 

Am I totally crazy in trying this? The technique worked for WiFi. Has anyone had success getting Bluetooth to work on this board?

I have searched the internet and youTube but everyone I have found is using either the ESP32 or Esp8266 without built in WiFi.


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@bbutcher85 As well as the previous instructions, give me a link to the sketch you are trying to compile.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@bbutcher85,

Can you supply a link to the device you're talking about?  I've never seen a ESP8266 that includes Bluetooth.  I just did an Google search and nothing came back that sounds like what you have.  ESP8266 and ESP32 are not compatible with each other.  It sounds like you're trying to use a lot of ESP32 library/code examples.  I'd be interested in such a product if it is the same form factor as a Wemos D1 Mini.

Thanks.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq Well that explains it.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
Inq reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2542
 

@inq 

There's your problem, it ain't got no gas !

Anything seems possible when you don't know what you're talking about.


   
Inq reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @zander

@inq Well that explains it.

Posted by: @will

@inq 

There's your problem, it ain't got no gas !

🤣 You all crack me up!

I don't really keep up with the latest stuff.  I know that Espressif is creating new ones all the time.  Some... just small permutations, some are real worth while.  I'm real hopeful they finally added Bluetooth to an ESP8266.  I'd use it in a heartbeat.  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq How about this https://amz.run/6TdV

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@zander,  Says ESP32 on the aluminum shield.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq YES, I thought you said you were interested in an ESP32 the same size or smaller as a Wemos D1 Mini.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

No, I said I was interested in the product that @bbutcher85 says exists... ESP8266 w/ Bluetooth.  My library only works on ESP8266 and I'll never port it to anything else.  With the great lack of interest, I see no need and I've never needed anything more powerful.  Bluetooth isn't enough to get me to shift to an ESP32 and having to give up the InqPortal environment.  It's far easier for me to set it up and debug even if I don't really care about interacting with it.  Not having to mess with hardware buttons and displays is priceless to me.  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq Ok, now I understand, sorry for my confusion.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@bbutcher85)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

Here is the link

https://www.ebay.com/itm/192736242136

image

This WeMos D1 R2 development board for Arduino / NodeMCU is a WiFi capable ESP8266 based development board in the format of the Arduino UNO R3. This board is compatible with the Arduino IDE and with NodeMCU. 

The D1 features an on-board switching power supply which allows you to power the board from a power supply up to 24V, 11 GPIO pins (can be used as input/output/PWM/I²C, except D0), and 1 analog input. The PWM resolution is 10bit (1MHz frequency). The integrated 5V switching power supply (1A) is followed by a 3.3V LDO to supply power for the Wifi module and the 3.3V output (power supply for sensors and shields). Please pay attention when you connect other active peripherals to the I/O pins, because this is a 3.3V logic level device and higher levels on any pin could damage it. The maximum input voltage for the analog pin is 3.2V.

Specifications:
80 MHz Processor / 4M Flash
FCC Certified ESP8266-12F Module
11 digital input/output pins, all pins have interrupt/pwm/I2C/one-wire supported (except for D0)
1 analog input (3.2V max input)
Micro USB connection
Power jack, 9-24V power input
Compatible with Arduino and NodeMCU
All IO pins are 3.3V and have interrupt/pwm/I2C/one-wire support except D0.

Package Includes:
1x WeMos D1 R2 Board ESP8266 NodeMCU Development Board for Arduino
Link to online installation and operation instructions


   
Inq reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@bbutcher85

Thank you for providing that link.  But that board doesn't say anything about doing Bluetooth and looks to be the plain old ESP8266-12F that is on every Wemos, NodeMCU and about a thousand other clones.  It should be a great beginner development board and should work great for you... but won't be talking via Bluetooth.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@bbutcher85)
Member
Joined: 1 year ago
Posts: 12
Topic starter  

Perhaps I misunderstood the specs. I guess I will pursue using a local network and a webpage to get the job done. Thanks for your help.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @bbutcher85

Perhaps I misunderstood the specs. I guess I will pursue using a local network and a webpage to get the job done. Thanks for your help.

Not to dis Bluetooth or people that use that method, but I've found that the advantages of WiFi doing as you say here has many superior advantages...

  1. Range - WiFi at least 100 meters, with special antennas, I've read instances of multiple kilometers range using just an ESP8266.  Bluetooth... oh about 10 meters.
  2. Universal access - Writing a smart client app with HTML/JavaScript is written once and works on all devices that can run a browser.  No need to write a custom app for Android, iPhone, Windows, Mac, Linux.  No need for a person/company to have developers to be experts in all those different development environments.
  3. Multi-access - Web hosting on the ESP8266 easily handles multiple simultaneous clients whereas Bluetooth... is pretty limited in that regard.
  4. Can access directly or via a local area network... or even from across the world.  Bluetooth 32 feet. 😆 

The only downside that I can think of... is JavaScript won't hide any intellectual property.  It's there for all to read.  Obfuscation helps a little, but anyone really willing to steal your IP... can.  Unless you bury it on the ESP8266 server.  And even that is not really protected from the serious hackers.

Good luck with your project.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Page 1 / 2