Open kellyatkinson opened 2 years ago
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
Hi I have the same problems with zero values coming from my LYWSD03MMC B1.6, I have flashed them with fimware v4.0
Environment:
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
@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.
Hi @jewelooper ,
the logs give me indeed no-data received.
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 :-)
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
[X] I've read the Troubleshooting Wiki, my problem is not described there and I am already using the specified minimum bluez version.
Describe the bug I can run the script but my sensor returns null values
Expected behavior Correct temp and humidity values should be pulled from the sensor.
Config
Debug gateway logs
Server (please complete the following information):
Additional context Sensor connects successfully to Android phone. Has pvvx firmware flashed.