Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python callbacks doesn't work with firmware 3.x.x? #122

Closed
mgrey opened this issue Mar 11, 2021 · 8 comments
Closed

Python callbacks doesn't work with firmware 3.x.x? #122

mgrey opened this issue Mar 11, 2021 · 8 comments
Labels

Comments

@mgrey
Copy link

mgrey commented Mar 11, 2021

I have two identical setups with Raspberry PI4, one with 2.x.x Ruuvis around, one with only 3.x.x Ruuvis.
The production firmware works fine, I get callbacks for all the broadcasts. For the beta firmware I get only one for each Ruuvi, then nothing more.
So, is the issue firmware? If so, is there a way to use firmware 3.x.x with the ruuvitag_sensor package?

The requirement is the 'Weather Station' firmware, I guess this is now the production firmware?

  • OS: Raspberry PI OS 5.10.17-v7l+(PI4)
  • ruuvitag_sensor package version: 1.1.0
  • RuuviTag firmware version: 2.5.9 and 3.28.x and 3.29.x
  • Data format: 5
@mgrey mgrey added the bug label Mar 11, 2021
@ttu
Copy link
Owner

ttu commented Mar 14, 2021

Hi,

Unfortunately package hasn't been yet properly tested with beta firmware versions. Hope we can test this soon and make necessary fixes.

@aleksei-panin
Copy link

Hello, same problem.

I updated the firmware of my two ruuvitags after reading this official page. There nothing is said that 3.x.x is actually a beta version and after upgrading to 3.x.x one cannot anymore downgrade to 2.x.x without a wired connection. This info is available only here

Please address this issue as soon as you can and also update documentation on the first link with information above, otherwise it is confusing and may bring other people to the situation where I am at the moment.

@ojousima
Copy link
Contributor

Is there something we can do on Ruuvi's side to help this issue?
The data format has not changed, but since RuuviTags have a scan reply and are connectable some header bytes might have changed which might cause this package to miss the transmissions

@mgrey
Copy link
Author

mgrey commented Apr 14, 2021

This works for both firmware as a workaround:

from ruuvitag_sensor.adapters.nix_hci import BleCommunicationNix
import ruuvitag_sensor.log
from ruuvitag_sensor.data_formats import DataFormats
from ruuvitag_sensor.decoder import get_decoder
import re

ruuvitag_sensor.log.enable_console()

ble = BleCommunicationNix()

for ble_data in ble.get_datas():
if re.search("FF9904",ble_data[1]):
(data_format, encoded) = DataFormats.convert_data(ble_data[1])
sensor_data = get_decoder(data_format).decode_data(encoded)
print("%s:%s" % (ble_data[0],sensor_data))

@aleksei-panin
Copy link

My workaround for now is to use get_data_for_sensors method inside of an infinite loop with sufficient timeouts. That does the trick for my POC now. Will follow this issue to see when get_datas method with a callback start working on 3.x.x to switch to it.

Thanks for a quick reply anyways!

@ojousima
Copy link
Contributor

Following up on this, if the root issue was in the scan response of the RuuviTag it is possible (and probably a good idea) to configure the HCITool to use passive scanning which does not request for scan responses. This saves a little bit of battery on the tags :)

hcitool lescan --duplicates --passive on HCITool.

@michaelfuckner
Copy link

Could you please push changes to pypi since all ruuvitags will be shipped with 3.3.0 from next week onwards

@ttu
Copy link
Owner

ttu commented Apr 29, 2021

New version is now released to pypi. Create an issue if you find something that doesn't work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants