{"id":13801125,"url":"https://github.com/jacklinquan/micropython-dweeter","last_synced_at":"2026-02-18T10:31:48.031Z","repository":{"id":62591831,"uuid":"497803262","full_name":"jacklinquan/micropython-dweeter","owner":"jacklinquan","description":"A python module for messaging through the free dweet service.","archived":false,"fork":false,"pushed_at":"2022-08-31T01:00:13.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-20T15:49:06.101Z","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/jacklinquan.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":"2022-05-30T05:36:01.000Z","updated_at":"2023-07-21T16:44:28.000Z","dependencies_parsed_at":"2022-11-03T22:56:46.066Z","dependency_job_id":null,"html_url":"https://github.com/jacklinquan/micropython-dweeter","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/jacklinquan%2Fmicropython-dweeter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklinquan%2Fmicropython-dweeter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklinquan%2Fmicropython-dweeter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacklinquan%2Fmicropython-dweeter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacklinquan","download_url":"https://codeload.github.com/jacklinquan/micropython-dweeter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241989516,"owners_count":20053798,"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-08-04T00:01:19.748Z","updated_at":"2025-10-11T14:44:04.198Z","avatar_url":"https://github.com/jacklinquan.png","language":"Python","readme":"# micropython-dweeter\n[![PayPal Donate][paypal_img]][paypal_link]\n[![PyPI version][pypi_img]][pypi_link]\n[![Downloads][downloads_img]][downloads_link]\n\n  [paypal_img]: https://github.com/jacklinquan/images/blob/master/paypal_donate_badge.svg\n  [paypal_link]: https://www.paypal.me/jacklinquan\n  [pypi_img]: https://badge.fury.io/py/micropython-dweeter.svg\n  [pypi_link]: https://badge.fury.io/py/micropython-dweeter\n  [downloads_img]: https://pepy.tech/badge/micropython-dweeter\n  [downloads_link]: https://pepy.tech/project/micropython-dweeter\n\nA python module for messaging through the free dweet service.\nDweet is a simple machine-to-machine (M2M) service from [dweet.io](https://dweet.io).\n\nThis module works under MicroPython and it is tested with MicroPython V1.18.\nIt requires [micropython-cryptodweet](https://github.com/jacklinquan/micropython-cryptodweet).\n\nFor a compatible CPython version, please find [Python package dweeter](https://github.com/jacklinquan/dweeter).\n\n## Installation\n``` Python\n\u003e\u003e\u003e import upip\n\u003e\u003e\u003e upip.install('micropython-dweeter')\n```\nAlternatively just copy dweeter.py and its dependency to the MicroPython device.\n\n## Usage\n``` python\n\u003e\u003e\u003e from dweeter import Dweeter\n\u003e\u003e\u003e dwtr = Dweeter(\"YOUR MAILBOX\", \"YOUR KEY\")\n\u003e\u003e\u003e dwtr.send_data({\"STRING DATA\": \"STRING VALUE\", \"INT DATA\": 100, \"FLOAT DATA\": 3.14, \"BOOL DATA\": True})\n{'thing': '3e7cb39f82fb1ac29e40b935a3cbbaed', 'created': '2022-05-30T04:15:54.787Z', 'content': {'68fcbe24759c8aeb21633df279049eb441eb7c7bcb8b4645f206f55f659fd198': '3aef3ed5ce517e4da35874b765c989256adf568525d43f8da6c2bab602ec5934c667da430fc4e43705699e57ced03d20a270fef33bfc7d1cc2b4f00255c794f00497d29717499ec0c2296b8b52fbef6e015ac0be42de9c8fdfb5f85a5455412cc14bb40acb0f9eaeb606a027b2de1acf94c630f86b5eac56add50048cad47fe5f1b2a699088153e0bf8aa3247192badc'}, 'transaction': '342e85f2-c4dc-4831-a746-e45f50885092'}\n\u003e\u003e\u003e dwtr.get_new_data()\n{'STRING DATA': 'STRING VALUE', 'INT DATA': 100, 'FLOAT DATA': 3.14, 'BOOL DATA': True, 'remote_time': '2022-05-30T04:15:49.000Z', 'created_time': '2022-05-30T04:15:54.787Z'}\n```\n\n## On messaging security\nThe free dweet service is public.\nBy \"public\", it means:\n- Every one on Internet can see what you are sending.\n- Every one can send something for the same \"thing\" name to confuse you.\n\nThe publicly exposed user information:\n- The \"thing\" name, which you can think of as the unique virtual mailbox name.\n- The keys of the \"content\" dictionary.\n- The values of the \"content\" dictionary.\n\nThe dweeter module wraps the contents as a single key-value pair.\nSo there is only one key and one value in the \"content\" dictionary.\nAnd the \"thing\" name and the \"content\" dictionary are encrypted.\nSo no one knows what they mean.\n\nWithout knowing what the information means,\npotential attackers can still send something for the same \"thing\" name.\nBecause the \"content\" dictionary is encrypted,\nthe only way to do this is to capture a bunch of messages\nand send them randomly.\nThe key and the value of the \"content\" dictionary both include\nthe same time stamp.\nA mismatch of them will result in an error that is handled by dweeter.\nBut a copy of the whole \"content\" dictionary could\nstill be passed on to the receiver.\nThis is often referred to as \"replay attack\".\n\nThe decrypted user data dictionary includes 2 extra key-value pairs:\n- \"created_time\", the timestamp from the dweet service.\n- \"remote_time\", the timestamp from the sending device.\n\nYou can compare these two timestamps to decide if a \"replay attack\" happened.\nOn a micropython device, you can use `ntptime.settime()` to set the local time.\nBe aware of a normal gap between \"created_time\" and \"remote_time\".\nOn a PC I observed 4 to 5 seconds difference.\nOn a micropython device I observed 8 to 9 seconds difference.\nThis time difference could vary from case to case.\n","funding_links":["https://www.paypal.me/jacklinquan"],"categories":["Libraries"],"sub_categories":["Communications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacklinquan%2Fmicropython-dweeter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacklinquan%2Fmicropython-dweeter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacklinquan%2Fmicropython-dweeter/lists"}