This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

ESP32 No data
#1
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:TongueROPERTY_READ   |
                     BLECharacteristic:TongueROPERTY_WRITE  |
                     BLECharacteristic:TongueROPERTY_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);

}
Reply


Messages In This Thread
ESP32 No data - by Dan1234 - 02-09-2020, 11:01 PM
RE: ESP32 No data - by Dominik Dorsel - 02-11-2020, 05:12 PM
RE: ESP32 No data - by Dan1234 - 02-12-2020, 08:48 AM

Forum Jump: