{"id":13801998,"url":"https://github.com/RangerDigital/senko","last_synced_at":"2025-05-13T12:32:13.595Z","repository":{"id":54627427,"uuid":"194298302","full_name":"RangerDigital/senko","owner":"RangerDigital","description":"🦊 Simplest OTA update solution for your Micropython projects.","archived":false,"fork":false,"pushed_at":"2024-02-23T12:48:32.000Z","size":530,"stargazers_count":95,"open_issues_count":5,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-07T15:54:00.529Z","etag":null,"topics":["esp32","esp8266","microcontroller","micropython","ota-update","ota-updater","over-the-air","senko"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RangerDigital.png","metadata":{"files":{"readme":"README.md","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":"2019-06-28T15:46:48.000Z","updated_at":"2024-10-16T05:39:26.000Z","dependencies_parsed_at":"2022-08-13T22:00:40.531Z","dependency_job_id":null,"html_url":"https://github.com/RangerDigital/senko","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerDigital%2Fsenko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerDigital%2Fsenko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerDigital%2Fsenko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RangerDigital%2Fsenko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RangerDigital","download_url":"https://codeload.github.com/RangerDigital/senko/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225217917,"owners_count":17439712,"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":["esp32","esp8266","microcontroller","micropython","ota-update","ota-updater","over-the-air","senko"],"created_at":"2024-08-04T00:01:32.647Z","updated_at":"2024-11-18T17:30:39.497Z","avatar_url":"https://github.com/RangerDigital.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cbr /\u003e\u003cimg\n    width=\"600\"\n    src=\"logo.png\"\n    alt=\"Senko – OTA Updater\"\n  /\u003e\n\u003c/p\u003e\n\n---\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\nSenko is the simplest **Over The Air** updater solution for your **Micropython** projects based on **ESP8266** and **ESP32**.\n\nSenko synchronizes selected files on your microcontroller with the remote ones from **GitHub** repository.  \nI used Senko to automatically deploy the latest `master` branch to my ESP8266 sensors fleet.\n\n\u003e 🚧 By all means, Senko is not the best implementation, but for my simple IoT projects, It was adequate!\n\n\u003cbr\u003e\n\n## 🛠 Operating Principle\n\nEvery time `.fetch()` or `.update()` methods are called Senko compares **SHA1** hashes of local files with remote ones to determine if they are the same.\n\nIf they are not, Senko saves remote files from **GitHub** repository to your microcontroller. This means you need to reboot to run the latest code.\n\n\u003e 🚧 You are responsible for implementing a network connection and reboot strategy!\n\n\u003cbr\u003e\n\n## 🔥 Installation\n\nSenko consists of a single `senko.py` module that you import.\n\nYou can use **Ampy** or **WebREPL** to load `/senko/senko.py` module to your microcontroller:\n\n```bash\nsudo ampy -p /dev/ttyUSB0 put senko.py\n```\n\nOr use **uPip** to install Senko from **PyPi**:\n\n```python\nimport upip\nupip.install(\"micropython-senko\")\n```\n\n\u003cbr\u003e\n\n## 🎉 Usage\n\nYou should start by importing the module and creating a `Senko` object.\n\nYou have to specify **user** with your GitHub username, **repo**, and **files** that you want to keep synchronized.\n\n```python\n# boot.py\nimport senko\n\nOTA = senko.Senko(\n  user=\"ocktokit\", # Required\n  repo=\"octokit-iot\", # Required\n  branch=\"master\", # Optional: Defaults to \"master\"\n  working_dir=\"app\", # Optional: Defaults to \"app\"\n  files = [\"boot.py\", \"main.py\"]\n)\n```\n\nOr You can also specify **URL** to the **GitHub** directory containing your code and **files** that you want to keep synchronized.\n\n```python\n# boot.py\nimport senko\n\nGITHUB_URL = \"https://github.com/RangerDigital/senko/blob/master/examples/\"\nOTA = senko.Senko(url=GITHUB_URL, files=[\"boot.py\", \"main.py\"])\n```\n\nTo get the **URL** simply click the `RAW` button on the one of the files that you want to track and then strip the name of that file from it.\n\n\u003e 💡 You can even specify what branch Senko will update from!\n\n\u003cbr\u003e\n\n### Updating\n\nThen after connecting to Wi-Fi network call `OTA.update()`:\n\n```python\n# boot.py\nimport senko\nimport machine\nimport network\n\nOTA = senko.Senko(\n  user=\"ocktokit\", repo=\"octokit-iot\", files = [\"boot.py\", \"main.py\"]\n)\n\n# Connect to Wi-Fi network.\nconnect_wlan()\n\nif OTA.update():\n    print(\"Updated to the latest version! Rebooting...\")\n    machine.reset()\n```\n\nThis setup will try to keep `boot.py` and `main.py` updated every time microcontroller boots.\n\n\u003cbr\u003e\n\n### Fetching\n\nIf you only want to check if the newer version of files exists call `OTA.fetch()`:\n\n```python\nif OTA.fetch():\n    print(\"A newer version is available!\")\nelse:\n    print(\"Up to date!\")\n```\n\n\u003e 💡 Check out a simple example of usage from `examples` directory!\n\n\u003cbr\u003e\n\n## 🚧 Contributing\n\n**You are more than welcome to help me improve Senko!**\n\nJust fork this project from the `master` branch and submit a Pull Request (PR).\n\n\u003cbr\u003e\n\n## 📃 License\n\nThis project is licensed under [GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/) .\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Communications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRangerDigital%2Fsenko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRangerDigital%2Fsenko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRangerDigital%2Fsenko/lists"}