{"id":24811198,"url":"https://github.com/thin-edge/rpi-pico-client","last_synced_at":"2025-03-25T13:24:19.097Z","repository":{"id":211284393,"uuid":"728722172","full_name":"thin-edge/rpi-pico-client","owner":"thin-edge","description":"Example micropython lightweight agent which uses the power of thin-edge.io to perform device management","archived":false,"fork":false,"pushed_at":"2023-12-07T14:52:46.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T12:19:49.949Z","etag":null,"topics":["community","iot","thin-edge"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thin-edge.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,"governance":null}},"created_at":"2023-12-07T14:51:20.000Z","updated_at":"2024-01-16T17:18:43.000Z","dependencies_parsed_at":"2023-12-07T15:51:35.131Z","dependency_job_id":null,"html_url":"https://github.com/thin-edge/rpi-pico-client","commit_stats":null,"previous_names":["thin-edge/rpi-pico-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Frpi-pico-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Frpi-pico-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Frpi-pico-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thin-edge%2Frpi-pico-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thin-edge","download_url":"https://codeload.github.com/thin-edge/rpi-pico-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245468791,"owners_count":20620452,"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":["community","iot","thin-edge"],"created_at":"2025-01-30T12:19:37.041Z","updated_at":"2025-03-25T13:24:19.049Z","avatar_url":"https://github.com/thin-edge.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting started\n\nInstall dependencies by running the following on the device's python console:\n\n```python\n# Setup network first\nimport network\nwlan = network.WLAN(network.STA_IF)\nwlan.active(True)\nwlan.connect(\"yourssid\", \"password\")\n\n# Then install the required packages\nimport mip\nmip.install(\"umqtt.simple\")\nmip.install(\"umqtt.robust\")\n```\n\n## Setting up the thin-edge.io device\n\nSince the Raspberry Pi Pico needs to communicate with thin-edge.io over the network, the thin-edge.io instance needs to be setup to enable this communication.\n\n1. On the main device where the MQTT broker, tedge-mapper-c8y and tedge-agent, run the following commands to set the configuration:\n\n    ```sh\n    tedge config set c8y.proxy.bind.address 0.0.0.0\n    tedge config set mqtt.bind.address 0.0.0.0\n    tedge config set http.bind.address 0.0.0.0\n\n    tedge config set c8y.proxy.client.host $HOST.local\n    tedge config set http.client.host $HOST.local\n    ```\n\n    If your `$HOST` variable is not set, then replace it with the actual name of the host your are running on (e.g. the address must be reachable from outside of the device)\n\n2. Restart the services\n\n    ```\n    systemctl restart tedge-agent\n    tedge reconnect c8y\n    ```\n\n3. Check that the address is reachable from outside, e.g.\n\n    ```sh\n    curl http://$HOST.local:8001/c8y/inventory/managedObjects/\n    ```\n\n## Installing the client on the Raspberry Pi Pico\n\n1. Using Thonny, connect to your Raspberry Pi Pico\n\n2. Copy across the following files\n\n    * `src/main.py` =\u003e `/main.py`\n    * `src/config.py` =\u003e `/config.py`\n\n3. Edit the `config.py` and update WIFI and broker settings\n\n4. Start the application (ideally without Thonny connected, otherwise Thonny can interfere with functionality such as device restart, software updates etc.)\n \n## References and Ideas\n\nOTA updates via:\n    * https://pypi.org/project/micropython-ota/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Frpi-pico-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthin-edge%2Frpi-pico-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthin-edge%2Frpi-pico-client/lists"}