{"id":16154929,"url":"https://github.com/rroemhild/ruuvitag-lorawan","last_synced_at":"2025-10-26T20:47:57.146Z","repository":{"id":136293218,"uuid":"124766371","full_name":"rroemhild/ruuvitag-lorawan","owner":"rroemhild","description":"Publish RuuviTag sensor data with LoRaWAN","archived":false,"fork":false,"pushed_at":"2021-02-26T16:09:02.000Z","size":220,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-11T18:38:48.342Z","etag":null,"topics":["bluetooth","iot","lorawan","micropython","pycom","pycom-lopy","ruuvitag","thethingsnetwork"],"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-CODE.txt","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-03-11T14:45:49.000Z","updated_at":"2021-02-19T08:51:38.000Z","dependencies_parsed_at":"2023-07-24T06:45:14.867Z","dependency_job_id":null,"html_url":"https://github.com/rroemhild/ruuvitag-lorawan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rroemhild/ruuvitag-lorawan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fruuvitag-lorawan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fruuvitag-lorawan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fruuvitag-lorawan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fruuvitag-lorawan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rroemhild","download_url":"https://codeload.github.com/rroemhild/ruuvitag-lorawan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rroemhild%2Fruuvitag-lorawan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281171353,"owners_count":26455534,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","iot","lorawan","micropython","pycom","pycom-lopy","ruuvitag","thethingsnetwork"],"created_at":"2024-10-10T01:19:17.199Z","updated_at":"2025-10-26T20:47:57.104Z","avatar_url":"https://github.com/rroemhild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========================================\nPublish RuuviTag sensor data with LoRaWAN\n=========================================\n\nThis repository contains the up to date snippets for the `Publish RuuviTag sensor data on The Things Network \u003chttps://ruuvitag-ttn.readthedocs.io\u003e`_ tutorial.\n\nThis PoC uses settings specifically for connecting to LoRaWAN networks within the European 868 MHz region. For other regions usage, please see the `settings.py` and `lib/lorawan.py` file for relevant sections that need to be changed.\n\n\nData Format\n-----------\n\nFor each RuuviTag we send 8 bytes. The RuuviTag ID is the index from the mac address in the `settings.py` list. We match this later in the decoder.\n\n+--------+---------------------------------------------+\n| Offset | Description                                 |\n+========+=============================================+\n| 0      | Tag ID (8bit)                               |\n+--------+---------------------------------------------+\n| 1-2    | Temperature in 0.005 degrees (16bit signed) |\n+--------+---------------------------------------------+\n| 3-4    | Humidity in 0.0025% (16bit unsigned)        |\n+--------+---------------------------------------------+\n| 5-6    | Batter voltage + 1600 (16bit unsigned)      |\n+--------+---------------------------------------------+\n| 7-8    | RSSI * -1 (8bit)                            |\n+--------+---------------------------------------------+\n\nIn example for 2 RuuviTags the following payload will be send:\n\n.. code-block:: python\n\n    b'\\x00\\x05$\\x8e\\xf8\\x04\\x8f[\\x01\\x11d/@\\x05\\rB'\n\n+----+------+--------+---------+------+----+------+--------+---------+------+\n| ID | Temp | Humid  | Voltage | RSSI | ID | Temp | Humid  | Voltage | RSSI |\n+====+======+========+=========+======+====+======+========+=========+======+\n| 00 | 0524 | 8EF8   | 048F    | 5B   | 01 | 1164 | 2F40   | 050D    | 42   |\n+----+------+--------+---------+------+----+------+--------+---------+------+\n\nRead more about the data format used in this project in the `Ruuvi Sensor Data Format 5 Protocol Specification \u003chttps://github.com/ruuvi/ruuvi-sensor-protocols#data-format-5-protocol-specification\u003e`_.\n\n\nPayload Format Decoder\n----------------------\n\nExample payload format decoder for the The Things Network Console. The var `map` is used to identify each Ruuvitag by name. The oder must match the order in the `RUUVITAG` list in the `settings.py`.\n\n.. code-block:: javascript\n\n    var map = [\"outdoor\", \"livingroom\"];\n\n    function Decoder(bytes, port) {\n      var ruuvitags = {};\n      var tags = bytes.length / 8;\n\n      for (i=0;i\u003ctags;i+=1) {\n        var temperature = (bytes[1] \u003c\u003c 8) | bytes[2];\n        var humidity = (bytes[3] \u003c\u003c 8) | bytes[4];\n        var battery = (bytes[5] \u003c\u003c 8) | bytes[6];\n        var rssi = bytes[7];\n\n        var name = map[bytes[0]];\n        ruuvitags[name] = {\n            \"humidity\": parseFloat((humidity * 0.0025).toFixed(2)),\n            \"temperature\": parseFloat((temperature * 0.005).toFixed(2)),\n            \"battery\": battery + 1600,\n            \"rssi\": rssi * -1\n        };\n\n        bytes.splice(0, 8);\n      }\n\n      return ruuvitags;\n    }\n\n    // TTNv3\n    function decodeUplink(input) {\n      return {\n        data: Decoder(input.bytes, input.fPort),\n        warnings: [],\n        errors: []\n      };\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frroemhild%2Fruuvitag-lorawan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frroemhild%2Fruuvitag-lorawan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frroemhild%2Fruuvitag-lorawan/lists"}