{"id":16154937,"url":"https://github.com/rroemhild/pycom-ruuvitag","last_synced_at":"2025-03-18T20:30:18.722Z","repository":{"id":136293208,"uuid":"117126023","full_name":"rroemhild/pycom-ruuvitag","owner":"rroemhild","description":"Pycom MicroPython RuuviTag BLE Sensor Beacon scanner","archived":false,"fork":false,"pushed_at":"2021-02-15T20:23:23.000Z","size":50,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-15T00:47:52.616Z","etag":null,"topics":["bluetooth","esp32","iot","micropython","pycom","ruuvitag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rroemhild.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-11T16:44:25.000Z","updated_at":"2025-02-23T00:01:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f542f51-3320-4e8f-8966-f6343f512cc0","html_url":"https://github.com/rroemhild/pycom-ruuvitag","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fpycom-ruuvitag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fpycom-ruuvitag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fpycom-ruuvitag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fpycom-ruuvitag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rroemhild","download_url":"https://codeload.github.com/rroemhild/pycom-ruuvitag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243949723,"owners_count":20373647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth","esp32","iot","micropython","pycom","ruuvitag"],"created_at":"2024-10-10T01:19:18.414Z","updated_at":"2025-03-18T20:30:18.717Z","avatar_url":"https://github.com/rroemhild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==================================\nPycom MicroPython RuuviTag Scanner\n==================================\n\nHarvest data from `RuuviTag BLE Sensor Beacon \u003chttp://ruuvitag.com/\u003e`_ with the `Pycom \u003chttps://pycom.io/\u003e`_ devices.\n\n**This repository was renamend from ``micropython-ruuvitag`` to ``pycom-ruuvitag`` as for this version only works on the Pycom devices and to use the namespace ``micropython-ruuvitag`` for the upstream MicroPython version.**\n\npycom-ruuvitag supports `Data Format 2, 3, 4 and 5 \u003chttps://github.com/ruuvi/ruuvi-sensor-protocols\u003e`_.\n\nThis package comes with a scanner and a tracker. The scanner scans for RuuviTags in a pre defined time and return the result. The tracker continuously scans for RuuviTags and call a callback for each tag found.\n\n\nInstallation\n------------\n\nWith Pymakr you can upload the project to your pycom device. ``pymakr.conf`` makes sure that only the relevant files are copied to your device.\n\n\nScanner\n-------\n\n``RuuviTagScanner`` scans for RuuviTags and decode the data format. The result is a list with named tuples.\n\nScan 10 seconds for RuuviTag sensors and print the result:\n\n.. code-block:: python\n\n    from ruuvitag.scanner import RuuviTagScanner\n\n    rts = RuuviTagScanner()\n\n    for ruuvitag in rts.find_ruuvitags(timeout=10):\n        print(ruuvitag)\n\n\nTracker\n-------\n\n``RuuviTagTracker`` scans for RuuviTags, decode the data format and call a callback with a named tuple if recieved data from tag.\n\n.. code-block:: python\n\n    from ruuvitag.tracker import RuuviTagTracker\n\n    def cb(ruuvitag):\n        print(ruuvitag)\n\n    rtt = RuuviTagTracker()\n    rtt.track_ruuvitags(cb)\n\n\nWhitelist devices\n-----------------\n\nYou can collect data from only the devices you want by define a whitelist with mac addresses. Other Devices then will be ignored. Whitelists can be used with RuuviTagScanner and RuuviTagTracker.\n\n.. code-block:: python\n\n    whitelist = (b'aa:bb:cc:dd:ee:21', b'aa:bb:cc:dd:ee:42',)\n    rts = RuuviTagScanner(whitelist)\n\n\nBlacklist persistence\n---------------------\n\nIf the data from a Bluetooth device can not be decoded, the device get on a blacklist as long the MicroPython device is not resetted. For a persistent device blacklist the list should be saved and reloaded.\n\n\u003e\u003e\u003e from ruuvitag import RuuviTagScanner\n\u003e\u003e\u003e rts = RuuviTagScanner()\n\u003e\u003e\u003e # add back blacklisted devices\n\u003e\u003e\u003e rts.blacklist = [b'aa:bb:cc:dd:ee:21', b'aa:bb:cc:dd:ee:42']\n\u003e\u003e\u003e # run a new scan\n\u003e\u003e\u003e rts.find_ruuvitags(timeout=10)\n\u003e\u003e\u003e # get blacklisted devices\n\u003e\u003e\u003e rts.blacklist\n\n\nNamed tuple formats\n-------------------\n\nData Format 2 and 4 (Eddystone-URL)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    RuuviTagURL = namedtuple('RuuviTagURL', (\n        'mac',\n        'rssi',\n        'format',\n        'humidity',\n        'temperature',\n        'pressure',\n        'id',\n    ))\n\nData Format 3 (RAWv1) and 5 (RAWv2)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    RuuviTagRAW = namedtuple('RuuviTagRAW', (\n        'mac',\n        'rssi',\n        'format',\n        'humidity',\n        'temperature',\n        'pressure',\n        'acceleration_x',\n        'acceleration_y',\n        'acceleration_z',\n        'battery_voltage',\n        'power_info',\n        'movement_counter',\n        'measurement_sequence',\n    ))\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/micropython-ruuvitag.svg\n    :target: https://pypi.python.org/pypi/micropython-ruuvitag/\n    :alt: PyPi Status\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frroemhild%2Fpycom-ruuvitag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frroemhild%2Fpycom-ruuvitag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frroemhild%2Fpycom-ruuvitag/lists"}