{"id":13802017,"url":"https://github.com/dsiggi/micropython-dcf77","last_synced_at":"2025-05-13T12:32:11.368Z","repository":{"id":206526144,"uuid":"717117986","full_name":"dsiggi/micropython-dcf77","owner":"dsiggi","description":"Micropython module to receive and decode the DCF77 time telegram.","archived":false,"fork":false,"pushed_at":"2024-01-20T11:02:29.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-09T14:13:30.194Z","etag":null,"topics":["dcf","dcf77","esp32","esp8266","micropython","rpi-pico"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsiggi.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-10T15:43:56.000Z","updated_at":"2024-10-10T15:18:36.000Z","dependencies_parsed_at":"2024-01-29T19:30:21.325Z","dependency_job_id":"8190a5d0-c3f8-400f-b16e-821fd0437607","html_url":"https://github.com/dsiggi/micropython-dcf77","commit_stats":null,"previous_names":["dsiggi/micropython-dcf77"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-dcf77","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-dcf77/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-dcf77/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-dcf77/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsiggi","download_url":"https://codeload.github.com/dsiggi/micropython-dcf77/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253942533,"owners_count":21988073,"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":["dcf","dcf77","esp32","esp8266","micropython","rpi-pico"],"created_at":"2024-08-04T00:01:33.287Z","updated_at":"2025-05-13T12:32:11.117Z","avatar_url":"https://github.com/dsiggi.png","language":"Python","readme":"# micropython-dcf77\n\nMicropython modul to decode the dcf77 signal delivered by a receiver module.\n\nTo use this module you need an dcf77 receiver module connectet to a gpoi pin of your board.\n\n## Class\n```\ntco_pin = The pin object for the pin where the receiver is connected\nfalse_time = Min/Max time in ms for detecing a 0 pulse\ntrue_time = Min/Max time in ms for detecting a 1 pulse\npause_time = Min/Max time in ms for detecting the beginning of the telegramm\n```\n```python\n\u003e\u003e\u003e dcf = dcf77.dcf77(machine.Pin(0))\n```\n## Methods\n\n### start\nStarting the receiving and decoding of the telegramm.\n```python\n\u003e\u003e\u003e dcf.start()\n```\n\n### stop\nStopping the receiving and decoding of the telegramm.\n```python\n\u003e\u003e\u003e dcf.stop()\n```\n### get_LastSignal\nReturns the last telegram as list\n```python\n\u003e\u003e\u003e dcf.get_LastSignal()\n[0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0]\n\u003e\u003e\u003e\n```\n### get_DateTime\nReturns the actual time and date informations as an 8-tuple \nwhich contains: year, month, day, weekday, hours, minutes, seconds, subseconds\nThis tuple can be directly used with the machine.RTC module\n\n-   ``year`` contains only the last 2 digest\n-   ``seconds`` is everytime 0, when ``with_seconds`` is TRUE the value will be set to the actual tick\n-   ``subseconds`` is everytime 0\n\n- If ``None`` is returned the signal is not valid\n- If some value return ``999`` the decoding failed\n\n```python\n\u003e\u003e\u003e dcf.get_DateTime(with_seconds=False)\n[23, 11, 10, 4, 16, 33, 0, 0]\n\u003e\u003e\u003e\n```\n### get_Infos\nReturns some infos\n```python\n\u003e\u003e\u003e dcf.get_Infos()\n{'Call bit': 0, 'Summer time announcement': 0, 'Found59': True, 'Valid': True, 'Leap second': 0, 'Tick': 49, 'Last pulse length': 102, 'CEST': 0, 'CET': 1}\n\u003e\u003e\u003e\n\n```\n### get_irq\nEnables an custom irq handler for various events. \\\n```Mode``` has to be a list of the following modes:\n-   ```IRQ_MINUTE``` = irq is fired when the minute changed\n-   ```IRQ_HOUR``` = irq is fired when the hour changed\n-   ```IRQ_DAY``` = irq is fired when the day changed\n-   ```IRQ_MONTH``` = irq is fired when the month changed\n-   ```IRQ_YEAR``` = irq is fired when the year changed\n-   ```IRQ_DST``` = irq is fired when the DST flag changes to TRUE\n```python\n\u003e\u003e\u003e dcf.irq(mode=[dcf.IRQ_DAY, dcf.IRQ_DST], handler=myhandler)\n```\n\n### debug\nEnable and disable debug messages on the console.\n```python\n\u003e\u003e\u003e dcf.debug(True)\n```\n\n## Sample Code\n```python\nimport machine\nimport dcf77\n\ndcf = dcf77.dcf77(machine.Pin(0))\n\n# Starting receiving and decoding\ndcf.start()\n\nrtc = machine.RTC()\n\n# Cutstom irq handler\ndef handler():\n    print(\"It's a new day or year.\")\n\ndcf.irq([dcf.IRQ_DAY, dcf.IRQ_YEAR], handler)\n\nprint(\"RTC initalized\")\ndatetime = rtc.datetime()\nprint(\"Actual time: {:02d}:{:02d} {:02d}.{:02d}.{}\".format(datetime[4], datetime[5], datetime[2], datetime[1], datetime[0]))\n\nprint(\"Wait for a valid dcf77 signal\")\nwhile not dcf.get_Infos()['Valid']:\n    pass\n\nprint(\"Found Valid signal\")\ndatetime = dcf.get_DateTime()\nprint(\"DCF77 time: {:02d}:{:02d} {:02d}.{:02d}.{}\".format(datetime[4], datetime[5], datetime[2], datetime[1], datetime[0]))\n\nprint(\"Setting RTC\")\nrtc.datetime(datetime)\n```\n\n\n\n\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Communications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsiggi%2Fmicropython-dcf77","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsiggi%2Fmicropython-dcf77","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsiggi%2Fmicropython-dcf77/lists"}