{"id":16154940,"url":"https://github.com/rroemhild/micropython-ruuvitag","last_synced_at":"2025-04-07T00:38:20.152Z","repository":{"id":57441515,"uuid":"303685735","full_name":"rroemhild/micropython-ruuvitag","owner":"rroemhild","description":"MicroPython scanner for RuuviTag","archived":false,"fork":false,"pushed_at":"2020-10-13T12:31:52.000Z","size":8,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T22:13:24.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-13T11:49:52.000Z","updated_at":"2024-04-17T15:48:59.000Z","dependencies_parsed_at":"2022-09-06T02:40:36.417Z","dependency_job_id":null,"html_url":"https://github.com/rroemhild/micropython-ruuvitag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fmicropython-ruuvitag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fmicropython-ruuvitag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fmicropython-ruuvitag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fmicropython-ruuvitag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rroemhild","download_url":"https://codeload.github.com/rroemhild/micropython-ruuvitag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574087,"owners_count":20960495,"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":[],"created_at":"2024-10-10T01:19:18.572Z","updated_at":"2025-04-07T00:38:20.134Z","avatar_url":"https://github.com/rroemhild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"============================\nMicroPython RuuviTag Scanner\n============================\n\nHarvest data from `RuuviTag BLE Sensor Beacon \u003chttp://ruuvitag.com/\u003e`_ with MicroPython.\n\nmicropython-ruuvitag supports RuuviTag Data Format 3 (RAWv1) and 5 (RAWv2) only. See `RuuviTag Sensor protocols \u003chttps://github.com/ruuvi/ruuvi-sensor-protocols\u003e`_ for details.\n\nThe ruuvitag scanner for **Pycom devices** was transfered to a new repo `pycom-ruuvitag \u003chttps://github.com/rroemhild/pycom-ruuvitag\u003e`_.\n\n\nInstallation\n------------\n\nCopy all files from the ``ruuvitag`` direcotory to the ``lib/ruuvitag`` directory on your device. Alternative you can use mpfshell to copy all files:\n\n.. code-block:: shell\n\n    mpfshell ttyUSB0 -s install.mpf\n\n\nExample\n-------\n\n.. code-block:: python\n\n    import time\n\n    from ruuvitag import RuuviTag\n\n\n    def cb(ruuvitag):\n        print(ruuvitag)\n\n\n    def run(ruuvi):\n        try:\n            while True:\n                ruuvi.scan()\n                time.sleep_ms(50000)\n        except KeyboardInterrupt:\n            ruuvi.stop()\n\n\n    if __name__ == \"__main__\":\n        ruuvi = RuuviTag()\n        ruuvi._callback_handler = cb\n        run(ruuvi)\n\n\nWhitelist devices\n-----------------\n\nYou can collect data from only the devices you want by define a whitelist with mac the devices addresses. Do not include ``:`` in the mac address. For example\n\n.. code-block:: python\n\n    whitelist = (b'aabbccddee21', b'aabbccddee42',)\n    ruuvi = RuuviTag(whitelist=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.\n\n\nNamed tuple formats\n-------------------\n\nData Format 3 (RAWv1)\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    RuuviTagRAWv1 = namedtuple('RuuviTagRAWv1', (\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    ))\n\n\nData Format 5 (RAWv2)\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    RuuviTagRAWv2 = namedtuple('RuuviTagRAWv2', (\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frroemhild%2Fmicropython-ruuvitag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frroemhild%2Fmicropython-ruuvitag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frroemhild%2Fmicropython-ruuvitag/lists"}