{"id":20761556,"url":"https://github.com/jcondor98/avrtmon","last_synced_at":"2026-06-07T14:31:21.359Z","repository":{"id":189370347,"uuid":"196823343","full_name":"jcondor98/avrtmon","owner":"jcondor98","description":"AVR Temperature Monitor (Project for Sistemi Operativi)","archived":false,"fork":false,"pushed_at":"2020-05-07T21:15:55.000Z","size":2602,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-20T00:15:15.565Z","etag":null,"topics":["at2560","avr-board","communication-protocol","serial","temperature-monitor"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcondor98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-14T10:32:26.000Z","updated_at":"2025-01-09T19:00:29.000Z","dependencies_parsed_at":"2023-09-07T16:15:31.583Z","dependency_job_id":null,"html_url":"https://github.com/jcondor98/avrtmon","commit_stats":null,"previous_names":["jcondor98/avrtmon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jcondor98/avrtmon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcondor98%2Favrtmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcondor98%2Favrtmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcondor98%2Favrtmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcondor98%2Favrtmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcondor98","download_url":"https://codeload.github.com/jcondor98/avrtmon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcondor98%2Favrtmon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34025803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"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":["at2560","avr-board","communication-protocol","serial","temperature-monitor"],"created_at":"2024-11-17T10:22:48.110Z","updated_at":"2026-06-07T14:31:21.337Z","avatar_url":"https://github.com/jcondor98.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# avrtmon\nAVR Temperature Monitor (Project for Sistemi Operativi)\n\n## Abstract\n\n**avrtmon** is a portable temperature monitor, which registers the external\ntemperature at a constant rate, and save each registration in a non-volatile\nmemory storage device. \nFrom a hardware prespective, it makes use of:\n\n* An AVR board (AT2560) as the central controller\n* A temperature sensor (LM35)\n* 3 hardware buttons to control the registering flow (i.e. start/stop) and to\npower on/off the board\n* 3 LEDs\n\nThe end user shall use a sort of power supply (e.g. batteries) in order to make\nthe temperature monitor a meaningful, effectively usable object.\n\nThe AVR board is able, once connected to the PC via serial port, to:\n\n* Send to the PC operating system all the performed temperature registrations\n* Receive commands (e.g. set a different registration rate, download data etc..)\n\n### Installation\nThe _GNU Make_ build system is used, and the codebase is in common for both\nhost-side and AVR-side. Below, a list of _make_ recipes is given:\n\n```\n# Compile and link both the host-side and the (.elf) AVR-side executables\nmake\n\n# Compile and link the host-side executable\nmake host\n\n# Compile and link the avr-side .elf executable\nmake avr\n\n# Install the -ALREADY COMPILED- host-side executable\nmake install\n\n# 'make avr' and then flash the HEX firmware into the AVR microcontroller\nmake flash\n\n# Generate (requires pandoc) man page\nmake docs\n\n# Install man page (pregenerated in the repo)\nmake install-docs\n\n# Generate the configuration-related source files from resources/config/default.csv\nmake config-gen\n```\n\n### Testing\nThe codebase is shipped with a test suite (based on an own-developed test framework).\nStandard tests are performed with AVR-side parameters and executed at host-side.\nIn fact, some tests are host/AVR-specific; AVR-specific tests consist in little\nprograms that must be flashed into the AVR board.\nBelow, a list of _make_ recipes to perform tests is given:\n\n```\n# Perform the entire standard tests suite:\nmake test\n\n# Perform a single standard test unit\nmake test-\u003cunit\u003e\n\n# Perform a single host-specific test unit\nmake host-test-\u003cunit\u003e\n\n# Perform a single AVR-specific test unit\nmake avr-test-\u003cunit\u003e\n```\n\n### Terminology\n\nFrom now to the end of this document, we use the following terminology:\n\n* **tmon** is the AVR board (i.e. the temperature monitor itself)\n* **NVM** is the _Non-Volatile Memory_ of the tmon, likely the internal EEPROM.\nWe refer to it in abstract terms as we could use another device (e.g. an SD card)\n* **host-side** refers to all the stuff which happens PC\n* **AVR-side** refers to all the stuff which happens in the AVR board\n\n\n## Serial/Packet protocol\n\nThe communication protocol between the tmon and the PC is interrupt-based (from\nthe tmon prespective) and packet-switched. Packet can vary in dimension, which\nnevertheless can _never_ exceed the size of 31 bytes (2 bytes of header + 28\nbytes of data + 1 byte CRC-8), and the size must be specified in the packet \nheader; this is done to minimize the rate of some common serial-related errors\n(e.g. data overrun)\n\n### Packet header\n\nThe size of the packet header is always 2 bytes (16 bits), and its structure is\nthe following:\n\nField | Size (bits) | Description\n--:|:-:|---\ntype |4 | Type of the packet (see below)\nid   |4 | Packet ID\nsize |7 | Size of the packet, in bytes. Notice that 7 bits are redundant\nheader\\_par |1 | (Even) Parity bit of the header\n\nThe type of the packet can be one of the following:\n\nType | Numeric Code | Description\n--:|:-:|---\nHND | 0x00 | Handshake\nACK | 0x01 | Acknowledgement\nERR | 0x02 | Communication error (e.g. CRC mismatch)\nCMD | 0x03 | Command (sent from the PC to the tmon)\nCTR | 0x04 | Control sequence (e.g. for commands)\nDAT | 0x05 | Data (e.g. temperatures) sent from the tmon to the PC\n\nThe redundant bits (most significant ones) of the type field are reserved for\nfuture use.\n\nThe packet ID could be not unique in an entire session; in fact, the crucial\nthing is to avoid collisions of (i.e. distinguish) successive packets, so this\nis not important at all.\n\n### Acknowledgement and Error packets\n\nA communication endpoint must wait for an acknowledgement message from the\ncounterpart once it sent a packet in order to send a new one. \nAcknowledgement and error packets do not bring any data.\n\nWhen a packet arrives, it is checked for integrity and sanity. If it is sane,\nthen an ACK packet is sent; if not, then an ERR packet is sent, and the\npreviously sent packet must be resent; ACK and ERR packets are simply discarded\nif corrupted in some way.\n\n\n## Configuration\n\nThe tmon configuration is stored at the beginning of its NVM, without any offset,\nas a raw data structure. The default configuration is shipped with the program\nimage, and flashed to the NVM with it.\n\nIn practice, configuration is a CSV file (without any header) organized in this fashion:\n\n```\nfield-name,c-type,value\n```\n\n## Commands\n\nThe tmon supports the execution of remote, arbitrary commands sent from the PC\nvia CMD packets. Those commands are the following:\n\nCommand | Description\n:-:|:--\nCONFIG\\_GET\\_FIELD | Get a configuration field (value is transported in a DAT packet)\nCONFIG\\_SET\\_FIELD | Set a configuration field to an arbitrary value\nTMON\\_START | Start registering temperatures\nTMON\\_STOP | Stop registering temperatures\nTMON\\_SET\\_RESOLUTION _value_ | Set the timer resolution for the next DB until the tmon is reset\nTMON\\_SET\\_INTERVAL _value_ | Set the timer interval for the next DB until the tmon is reset\nTEMPERATURES\\_DOWNLOAD | Download the temperatures DB\nTEMPERATURES\\_RESET | Reset the temperatures DB\nECHO | Echo a message back to the PC (developed mostly for debug purposes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcondor98%2Favrtmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcondor98%2Favrtmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcondor98%2Favrtmon/lists"}