Hi,
I am facing this error when trying to compile my code (fatal error: sdkconfig.h: No such file or directory). for a BLuno board. Anyone have an idea why this error keeps displaying
This is the code
#include <WiFiEsp.h>
#include <WiFiEspClient.h>
#include <WiFiEspServer.h>
#include <WiFiEspUdp.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#include <HID.h>
#include <Mouse.h>
#include <ArduinoBLE.h>
#include <BLEAttribute.h>
#include <BLECharacteristic.h>
#include <BLEDescriptor.h>
#include <BLEDevice.h>
#include <BLEProperty.h>
#include <BLEService.h>
#include <BLETypedCharacteristic.h>
#include <BLETypedCharacteristics.h>
#include <BLEUuid.h>
/*********************************************************************
* BLE_WaterMonitor.ino
*
* Derived from WaterMonitor.ino by Jason(jason.ling@dfrobot.com) 2017-04-06
* Derived from ardiuno_sketch_for_esp32.ino by Jeff L 2018-05-14
*
* Description:
* monitor water quality including ph, temperature, dissolved oxygen, ec and orp,etc.
*
* Software Environment: Arduino IDE 1.8.2
* Software download link: https://www.arduino.cc/en/Main/Software
*
* Install the library file:
* Copy the files from the github repository folder libraries to the libraries
* in the Arduino IDE 1.8.2 installation directory
*
* Hardware platform : Arduino with BluetoothLE (BLE)
* Sensor pin:
* EC : A1
* PH : A2
* ORP : A3
* RTC : I2C
* DO : Serial port Rx(0),Tx(1)
* GravityDO:A4
* temperature:D5
*
* SD card attached to SPI bus as follows:
* Mega: MOSI - pin 51, MISO - pin 50, CLK - pin 52, CS - pin 53
* and pin #53 (SS) must be an output
* M0: Onboard SPI pin,CS - pin 4 (CS pin can be changed)
*
* author : Chris Ward https://www.professorcad.co.uk
* version : V1.0
* date : 2018-12-17
**********************************************************************/
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include "GravitySensorHub.h"
#include "GravityRtc.h"
#include "OneWire.h"
#include "SdService.h"
#include "Debug.h"
#include <SoftwareSerial.h>
#include "dht.h"
#include <LiquidCrystal.h>
//
//// BluetoothLE
//#include <BLEDevice.h>
//#include <BLEServer.h>
//#include <BLEUtils.h>
//#include <BLE2902.h>
BLEServer *pServer = NULL;
BLECharacteristic * pTxCharacteristic;
bool deviceConnected = false;
bool oldDeviceConnected = false;
// To generate UUIDs: https://www.uuidgenerator.net
#define SERVICE_UUID "e8a4395S-892c-4333-bd5e-f7c70d81aece"
#define CHARACTERISTIC_UUID "e8a4395C-892c-4333-bd5e-f7c70d81aece"
class MyServerCallbacks: public BLEServerCallbacks {
void onConnect(BLEServer* pServer) {
deviceConnected = true;
}
void onDisconnect(BLEServer* pServer) {
deviceConnected = false;
}
}
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 8, rw = 7, en = 6, d4 = 10, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, rw, en, d4, d5, d6, d7);
dht DHT;
#define DHT11_PIN 9
// clock module
GravityRtc rtc;
// sensor monitor
GravitySensorHub sensorHub;
SdService sdService = SdService(sensorHub.sensors);
void setup() {
Serial.begin(9600);
rtc.setup();
sensorHub.setup();
sdService.setup();
lcd.begin(16, 4);
lcd.print("Temp");
// Create the BLE Server
pServer = BLEDevice::createServer();
pServer->setCallbacks(new MyServerCallbacks());
// Create the BLE Service
BLEService *pService = pServer->createService(SERVICE_UUID);
// Create a BLE Characteristic
pTxCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_NOTIFY);
pTxCharacteristic->addDescriptor(new BLE2902());
// Start the service
pService->start();
// Start advertising
pServer->getAdvertising()->start();
}
//**********************************************************************************************************************
// function name: sensorHub.getValueBySensorNumber (0)
// Function Description: Get the sensor's values. The parameters represent the acquisition of different sensor data
// Parameters: 0 ph value
// Parameters: 1 temperature value
// Parameters: 2 Dissolved Oxygen
// Parameters: 3 Conductivity
// Parameters: 4 Redox potential
// return value: returns a double type of data
//**********************************************************************************************************************
unsigned long updateTime = 0;
String sAllVals = "";
String sD = "|";
String sPH = "";
String sWTemp = "";
String sDo = "";
String sEc = "";
String sOrp = "";
String sTamb = "";
String sRH = "";
void loop() {
rtc.update();
sensorHub.update();
sdService.update();
if(millis() - updateTime > 5000)
{
updateTime = millis();
int chk = DHT.read11(DHT11_PIN);
// BLE TO APP
sPH = String(sensorHub.getValueBySensorNumber(0), 2);
sWTemp = String(sensorHub.getValueBySensorNumber(1), 2);
sDo = String(sensorHub.getValueBySensorNumber(2), 2);
sEc = String(sensorHub.getValueBySensorNumber(3), 2);
sOrp = String(sensorHub.getValueBySensorNumber(4), 2);
sTamb = String(DHT.temperature, 2);
sRH = String(DHT.humidity, 2);
sAllVals = sPH + sD + sWTemp + sD + sDo + sD + sEc + sD + sOrp + sD + sTamb + sD + sRH + "\n"
pTxCharacteristic->setValue(sAllVals);
pTxCharacteristic->notify(); // Send to App
delay(500);
// LCD DISPLAY
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(DHT.temperature);
lcd.print("deg C");
lcd.setCursor(0,1);
lcd.print("Humd: ");
lcd.print(DHT.humidity);
lcd.print("%");
lcd.setCursor(0,2);
lcd.print("pH: ");
lcd.print(sensorHub.getValueBySensorNumber(0));
lcd.setCursor(0,3);
lcd.print("EC: ");
lcd.print(sensorHub.getValueBySensorNumber(3));
lcd.print("mS/CM");
}
}