GithubHelp home page GithubHelp logo

inkbird_mqtt's People

Contributors

stelford avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

inkbird_mqtt's Issues

Strange behavior solved

Hi, after implementing this I found that the first scan after reset always showed name & manufacturer, but from the 2nd scan these 2 values were not shown, so advertisedDevice.haveManufacturerData() was false and no data was published.

This was solved by adding init & deinit BLE in void loop(), I think that by doing this, every new scan found the inkbird sensors "for the first time", so that advertisedDevice.haveManufacturerData() = true and the code could run OK. Maybe after the first pairing the BLE data read was different, as the devices were no more "unknown" for the ESP32. I do not really know if this was the actual problem or why was this happening, and maybe there are more elegant solutions. This is my new void loop:

void loop() {
BLEDevice::init("myBLEScan");
client.loop();
if (cnt == 0) { bleScan(); }

cnt=cnt+1;

if (cnt >= 5) { cnt=0; }

client.loop();
delay(5000); // or 5s
BLEDevice::deinit(false);
}

Makes this sense? At least solved my problem and now I can read them in Home Assistant.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.