I have a ESP-WROOM-32 on both a transmitter board and receiver board. I had someone do the code about a year ago and I'm now creating two new boards and programming the ESP-WROOM-32 on both boards using the code they provided. I'm using an Esp32 Esp12 burning fixture to upload the program from Arduino.
I don't have a problem with the transmitter. In fact I can connect using my smartphone and nRF Connect. However, the receiver program I need to use for the other board is giving me an error on compilation:
Reviewer code:
/**
- A BLE client example that is rich in capabilities.
/
/==========================================================================================================================================
Video: ESP32 Technical Tutorials: BLE Notifications - YouTube
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/
Ported to Arduino ESP32 by Evandro Copercini
Create a BLE Client that, once we scan and established a connection, will receive periodic notifications.
The service scan for server with : 4fafc201-1fb5-459e-8fcc-c5c9c331914b
And a characteristic of: beb5483e-36e1-4688-b7f5-ea07361b26a8
The design of creating the BLE Client is:
- Create a BLE Client
- Create a BLE Service
- Create a BLE Characteristic on the Service
- Start scanning for service.
- Send notification to request advertising.
A connect hander associated with the client starts a background task that performs notifyCallback
every couple of seconds.
Modified by Olaniyi Clement O
Adding the following:
- Adding OLED Display functionalities
- Adding notification request packet for ESP32 to ESP32 BLE connectivity to save power.
- Read sensor values from notifyCallback
- Mapped raw data and coverts character arrays to float
- Performed various visual displays to the user
- Colates end results
- Perform BLECharacteristic notification request
==============================================================================================================================================*/
/=====================================================================================================================
Includes: All necessary libraries
Purpose : For code portability
=======================================================================================================================/
#include "BLEDevice.h"
//#include "BLEScan.h"
// For a connection via I2C using Wire include
//#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier
#include "SH1106.h"
// 21 -> SDA
// 22 -> SCL
SH1106 display(0x3c, 21, 22);
#define CONNECTION_TIME_OUT 40000
int counter = 0;
unsigned long secondSinceSystemStarted;
/=======================================================================================================================/
/======================================================================================================================
Setting up ServiceUUID and Characteristic UUID
See the following for generating UUIDs:
=======================================================================================================================/
// The remote service we wish to connect to.
static BLEUUID serviceUUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b");
// The characteristic of the remote service we are interested in.
static BLEUUID charUUID("beb5483e-36e1-4688-b7f5-ea07361b26a8");
/======================================================================================================================
Declearig global variables
=======================================================================================================================/
static BLEAddress pServerAddress;
static boolean doConnect = false;
static boolean connected = false;
static BLERemoteCharacteristic pRemoteCharacteristic;
float fsrValue;
char rxValue[4];
String deviceName = "";
String txName = "";//Name of the transmitter
String txPower = "";//Transmitter transmission power in db
Full code was to big to upload to forum. But I get the following error
Error
SH1106.h: No such file or directory
I know this error is related to the display and thought since this code was provided over a year ago
is there a different header I should be using with the updated version of Aduino?
Thanks