02-09-2020, 11:01 PM
Hello, I am using the ESP 32 code and the QRP shown at the phypox site https://phyphox.org/wiki/index.php?title...ed_sensors
Here is the code below. I had to change the name from MyESP32 to Arduino so the app can find it.
After clicking on the + and Add experiment from QR code , the experiment analogReadTutorial opens, I then pick my device.
When I click on run, not data appears.
Any ideas what is happening?
Thanks,Dan
//#############################################################################
//In this sketch a BLE server with one service and one characeristic is created.
//The analog input (pin 36) is readout periodically.
//#############################################################################
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <esp_system.h>
//uuid's can be generated on https://www.uuidgenerator.net/
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "59f51a40-8852-4abe-a50f-2d45e6bd51ac"
BLECharacteristic *aCharacteristic;
uint8_t analogValue;
void setup() {
Serial.begin(9600);
//BLE server is being initialized
//create one BLEService and one Characteristic
BLEDevice::init("MyESP32");
BLEServer *aServer = BLEDevice::createServer();
//uuid for the BLE service is set
BLEService *aService = aServer->createService(SERVICE_UUID);
//uuid for the BLE characteristic is set
//the characteristics properties are defined
aCharacteristic = aService->createCharacteristic(
CHARACTERISTIC_UUID,
BLECharacteristic:ROPERTY_READ |
BLECharacteristic:ROPERTY_WRITE |
BLECharacteristic:ROPERTY_NOTIFY
);
//BLE server is being started
aService->start();
BLEAdvertising *aAdvertising = aServer->getAdvertising();
aAdvertising->start();
}
void loop() {
//analog Input 36 is read out and saved into the 8bit unsigned int "analogValue"
analogValue = analogRead(36);
//the measured value is written to the characteristic
aCharacteristic->setValue(&analogValue,1);
aCharacteristic->notify();
delay(100);
}
Here is the code below. I had to change the name from MyESP32 to Arduino so the app can find it.
After clicking on the + and Add experiment from QR code , the experiment analogReadTutorial opens, I then pick my device.
When I click on run, not data appears.
Any ideas what is happening?
Thanks,Dan
//#############################################################################
//In this sketch a BLE server with one service and one characeristic is created.
//The analog input (pin 36) is readout periodically.
//#############################################################################
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <esp_system.h>
//uuid's can be generated on https://www.uuidgenerator.net/
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "59f51a40-8852-4abe-a50f-2d45e6bd51ac"
BLECharacteristic *aCharacteristic;
uint8_t analogValue;
void setup() {
Serial.begin(9600);
//BLE server is being initialized
//create one BLEService and one Characteristic
BLEDevice::init("MyESP32");
BLEServer *aServer = BLEDevice::createServer();
//uuid for the BLE service is set
BLEService *aService = aServer->createService(SERVICE_UUID);
//uuid for the BLE characteristic is set
//the characteristics properties are defined
aCharacteristic = aService->createCharacteristic(
CHARACTERISTIC_UUID,
BLECharacteristic:ROPERTY_READ |
BLECharacteristic:ROPERTY_WRITE |
BLECharacteristic:ROPERTY_NOTIFY
);
//BLE server is being started
aService->start();
BLEAdvertising *aAdvertising = aServer->getAdvertising();
aAdvertising->start();
}
void loop() {
//analog Input 36 is read out and saved into the 8bit unsigned int "analogValue"
analogValue = analogRead(36);
//the measured value is written to the characteristic
aCharacteristic->setValue(&analogValue,1);
aCharacteristic->notify();
delay(100);
}