Git Product home page Git Product logo

Comments (5)

jewelooper avatar jewelooper commented on July 17, 2024

Did you also try to set the mac in uppercase in config file?
The comparison in the find_device method is case sensitive and it depends if the btle scanner delivers the found macs in uppercase or in lowercase.
However for me the scanner delivers all macs in lowercase and when I set the macs in uppercase I also get null values.

Tested with: pvvx v4.0 firmware on LYWSD03MMC HW 2.0
Configured advertising format: atc1441

from bt-mqtt-gateway.

piatho avatar piatho commented on July 17, 2024

Hi I have the same problems with zero values coming from my LYWSD03MMC B1.6, I have flashed them with fimware v4.0

Environment:

  • OS: Linux
  • Distro: Raspbian
  • Version: bullseye
  • Device: Raspberry Pi 4
  • Docker Container Image

image

I have setup the confg for one devive in uppercase and for one device in lower case. hcitool lescan shows all MAC in upercase

I have also tested the interface with some other script which generates outputs

from bt-mqtt-gateway.

jewelooper avatar jewelooper commented on July 17, 2024

@piatho Did you also checked the debug output? Are there also these "no data received" messages?
What is your Config? Do you run the worker in passive mode?

How are your programming skills?
I think the easiest way to get around is to place your own debug commands _LOGGER.debug in workers/lywsd03mmc.py and run the gateway in debug mode.
Maybe you can place a log-command in line 35 to write out all addresses res.addr find by the scanner.
If your device address is not returned by the scanner, than there may be a problem with bluez or your bluetooth driver.
When your device is found you can place another command in line 38 to check the raw data value revived from your device.

from bt-mqtt-gateway.

piatho avatar piatho commented on July 17, 2024

Hi @jewelooper ,
the logs give me indeed no-data received.
image

Passive mode: both tried, usually passive should be the preferred option

I would rather not think of an issue with the bluetooth driver, since the same device to provide an output and updated values when running openmqttgatway/Theengs. (Theengs is a bit to resource heavy, thats why i want to replace it)

I am running your and theengs in a container - obviously not at the same time.

On your suggestion to implement some debugs comments in the worker, i am not sure if can adjust the docker container in a way you describe. I am rather new to docker :-)

from bt-mqtt-gateway.

piatho avatar piatho commented on July 17, 2024

Update:
I have now managed to add the loggers. I have added:
_LOGGER.debug("Scanned device: %s", res) in row 35 and _LOGGER.debug("Scan data received: %s", value).

The logs showed that devices are scanned but now raw data been recorded.

That helped me to become clear that the error was about case sensitivity. "res" contains the MAC in lower cases and thus did not find a match. After changing the config file to lowercase, gateway finds values and updates perfectly.

Thanks for the help @jewelooper

from bt-mqtt-gateway.

Related Issues (20)

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.