Category : arduino-esp8266

I have been use the MQTT-library by Goel Gaehwiller(ver. 2.5.0) ad got a little problem with the implementation of the MQTTClient into my own class. The library used a non-class function as a call-back. I tried to use many C++ macroses, but all break the compilation: void CMQTT::local_mqtt_callback(MQTTClient* client, char* topic, char* payload, int payload_length) ..

Read more

I had declared the class with a static "vector"-object and cannot to find decision for constructor of class. header: #ifndef _SVD_PRGOBJ_H_ #define _SVD_PRGOBJ_H_ #include <stdint.h> #include <Arduino.h> #include <vector> #define _SVD_PO_DEF_INDEX 0 #define _SVD_PO_NOTDEFINED 1 class CProgObj; class CProgObj { protected: static std::vector<CProgObj*> global_progobjList; static CProgObj* getProgObjByIndex( uint16_t a_idx ); static String& getJSONAll(); static std::vector<uint8_t> ..

Read more

I am trying to port some C++ Arduino code to more recent ESP8266 and ESP32 boards. I have checked already the Arduino Stack Exchange forum unfortunately without results Porting this C++ code from older Arduino to Esp8266/Esp32 does not work, I have added also the compiling errors at the bottom of this question: /* rcTiming.ino ..

Read more

When add new device through the app, added the details with pushing. And I searched through Google but could not find a solution I could get the json value from firebase. {"-MjPZs2_4wAg-81-y910":{"Place":"asd","State":"ON","Title":"szd – 1"},"-MjP_kgFyDFPZMlsTZpq":{"Place":"asasjdasd","State":"OFF","Title":"UDITHA – 2"},"-MjQ0t2JKQynjM6iMwfo":{"Place":"asasjdasd","State":"OFF","Title":"Gate – 3"},"-MjQ1MYaMn8atIsE6lmq":{"Place":"asasjdasd","State":"OFF","Title":"උදිත – 4"}} This code I used and it worked but that static. // String input; StaticJsonDocument<512> doc; ..

Read more

When add new device through the app, added the details with pushing. And I searched through Google but could not find a solution I could get the json value from firebase. {"-MjPZs2_4wAg-81-y910":{"Place":"asd","State":"ON","Title":"szd – 1"},"-MjP_kgFyDFPZMlsTZpq":{"Place":"asasjdasd","State":"OFF","Title":"UDITHA – 2"},"-MjQ0t2JKQynjM6iMwfo":{"Place":"asasjdasd","State":"OFF","Title":"Gate – 3"},"-MjQ1MYaMn8atIsE6lmq":{"Place":"asasjdasd","State":"OFF","Title":"උදිත – 4"}} This code I used and it worked but that static. // String input; StaticJsonDocument<512> doc; ..

Read more

I think this is the right stack for this question as its fundamentally C++ although to be specific its a NodeMCU (ESP8266) being programmed in Arduino with the Visual Code IDE. I am using the Pubsubclient MQTT library within a custom ‘ComsManager’ Class library as part of a environmental monitoring system. Generally everything is working ..

Read more

Currently i am using below code to check if any ble device is present around. #include <BLEAdvertisedDevice.h> #include <BLEDevice.h> #include <BLEScan.h> const int PIN = 2; const int CUTOFF = -60; void setup() { pinMode(PIN, OUTPUT); BLEDevice::init(""); } void loop() { BLEScan *scan = BLEDevice::getScan(); scan->setActiveScan(true); BLEScanResults results = scan->start(1); int best = CUTOFF; for ..

Read more