{"id":17492054,"url":"https://github.com/waynechang65/try-mqtt","last_synced_at":"2026-01-21T03:02:15.802Z","repository":{"id":42746944,"uuid":"266302378","full_name":"WayneChang65/try-mqtt","owner":"WayneChang65","description":"Try to write a pretty \"simple\" MQTT client which includes publish and subscribe in node.js","archived":false,"fork":false,"pushed_at":"2025-07-07T07:02:50.000Z","size":726,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T08:22:19.604Z","etag":null,"topics":["client","mqtt","mqtt-client","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/WayneChang65.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,"publiccode":null,"codemeta":null}},"created_at":"2020-05-23T09:17:42.000Z","updated_at":"2025-07-07T07:01:38.000Z","dependencies_parsed_at":"2024-12-08T06:23:01.940Z","dependency_job_id":"1121d6a6-e873-480a-9f73-38d0f96f6c88","html_url":"https://github.com/WayneChang65/try-mqtt","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"00fe9940a15332303621b4e44d4e07373e3ac237"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/WayneChang65/try-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Ftry-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Ftry-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Ftry-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Ftry-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WayneChang65","download_url":"https://codeload.github.com/WayneChang65/try-mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WayneChang65%2Ftry-mqtt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28624341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T02:47:06.670Z","status":"ssl_error","status_checked_at":"2026-01-21T02:45:44.886Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["client","mqtt","mqtt-client","nodejs"],"created_at":"2024-10-19T08:07:18.354Z","updated_at":"2026-01-21T03:02:15.781Z","avatar_url":"https://github.com/WayneChang65.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# try-mqtt\n\ntry-mqtt 是一個超簡單的MQTT client，其中包含subscribe以及簡易publish功能。主要是自己寫來測試MQTT連線而使用。  \n\ntry-mqtt is a quite simple MQTT client, which includes subscribe and publish functions. It is designed and used to test the MQTT connection.\n\n![image](https://raw.githubusercontent.com/WayneChang65/try-mqtt/master/images/mqtt_main.gif)  \n![image](https://raw.githubusercontent.com/WayneChang65/try-mqtt/master/images/cpu_server_mode.gif)  \n\n## 這專案能做什麼事？ (What can it do ?)\n\n* **Subscribe Mode**：Subscribe某個MQTT Broker的某個Topic (目前Topic已在程式裏寫死，連到自己架設的Broker裏的 wayne65/# )  \nSubscribe Mode：Subscribe to a topic of a MQTT Broker (Currently the topic has been hard-coded in the program and connected to the broker in my home)  \n\n* **Publish Mode**：Publish測試訊息到某個Broker。(目前Publish \"It works!\"到wayne65/test1 topic裏)  \nPublish Mode：Publish test messages to a broker. (Currently publish \"It works!\" In wayne65/test1 topic)  \n\n* **Server Mode**：固定時間Publish到特定Broker。(目前Publish自己家裏的一台主機加一台樹莓派的CPU溫度跟負載)  \nServer Mode：publish messages to a broker. (Currently publish CPU temperature and load of my home servers)  \n\n## 如何跑範例程式？ (How to run the example ?)\n\n* 從Github下載try-mqtt專案程式碼。  \nClone try-mqtt project from Github\n\n```bash\ngit clone https://github.com/WayneChang65/try-mqtt.git\n```\n\n* 進入try-mqtt專案目錄  \nGet into the try-mqtt directory\n\n```bash\ncd try-mqtt\n```\n\n* 下載跑範例程式所需要的環境組件  \nInstall depedencies\n\n```bash\nnpm install\n```\n\n* 針對MQTT Broker設定以下環境變數(IP, Port, 使用者ID, 密碼)  \nSet ENV variables to the MQTT Broker (IP, Port, User ID, Password)\n\n```\nBROKER_IP\nBROKER_PORT\nBROKER_UID\nBROKER_UPWD\n```  \n\n* 透過以下格式輸入指令，執行Subscribe功能  \nRun it for subscribe mode  \n\n```bash  \nnode index.js subscribe  \n```  \n\n* 透過以下格式輸入指令，執行Publish功能。(後面100代表100ms publish一筆，數字可換)  \nRun it for publish mode (100 means sampling time, 100ms. Can be changed.)  \n\n```bash  \nnode index.js publish 100  \n```  \n\n* 透過以下格式輸入指令，執行Server功能。(後面1000代表1000ms publish一筆，數字可換。d代表debug mode，會顯示publish訊息，可省略)  \nRun it for server mode (1000 means sampling time, 100ms. Can be changed. d stands for debug mode and show publish messages which can be skiped)  \n\n```bash  \nnode index.js cpu-server 1000 d  \n```  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynechang65%2Ftry-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaynechang65%2Ftry-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaynechang65%2Ftry-mqtt/lists"}