{"id":16516608,"url":"https://github.com/eadf/esp_mqtt_ping","last_synced_at":"2026-06-10T15:31:09.532Z","repository":{"id":27783373,"uuid":"31272133","full_name":"eadf/esp_mqtt_ping","owner":"eadf","description":"esp8266 periodically sends HC-SR04 ping results over MQTT","archived":false,"fork":false,"pushed_at":"2015-03-01T20:00:04.000Z","size":276,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T18:19:12.535Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eadf.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":"2015-02-24T17:27:23.000Z","updated_at":"2024-04-04T11:14:22.000Z","dependencies_parsed_at":"2022-09-03T07:23:01.737Z","dependency_job_id":null,"html_url":"https://github.com/eadf/esp_mqtt_ping","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eadf/esp_mqtt_ping","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eadf%2Fesp_mqtt_ping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eadf%2Fesp_mqtt_ping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eadf%2Fesp_mqtt_ping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eadf%2Fesp_mqtt_ping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eadf","download_url":"https://codeload.github.com/eadf/esp_mqtt_ping/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eadf%2Fesp_mqtt_ping/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34159249,"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-10T02:00:07.152Z","response_time":89,"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":[],"created_at":"2024-10-11T16:25:45.735Z","updated_at":"2026-06-10T15:31:09.510Z","avatar_url":"https://github.com/eadf.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp_mqtt_ping\nesp8266 periodically (4Hz) sends ultrasonic sensor ping results over MQTT\n\n\nI'm pulling in several git subtree projects :\n* [tuanpmt's mqtt project: esp_mqtt](https://github.com/tuanpmt/esp_mqtt) \n* [esp8266_ping](https://github.com/eadf/esp8266_ping)\n* [esp8266_easygpio](https://github.com/eadf/esp8266_easygpio)\n* [esp8266_stdout](https://github.com/eadf/esp8266_stdout)\n\nThe makefile is copied from [esp_mqtt.](https://github.com/tuanpmt/esp_mqtt)\n\n# Usage \n\nThe default configuration uses a HC-SR04 connected to GPIO2 (trigger) and GPIO0 (echo). Look at [esp8266_ping](https://github.com/eadf/esp8266_ping) for a more detailed ciruit description.\n\nThis pin configuration makes it impossible to boot the esp normally. You will have to unplug the trigger pin (GPIO2) during reset.\nI included GPIO2 and GPIO0 so that the demo works on an ESP-1.\n\nesp8266 |  level shifter 3V3| level shifter 5V | HC-SR04\n--------|-------------|-----------------------|------------\nGPIO2   |port1 3V3   | port1 5V| sensor 0 trigger\nGPIO0   | port2 3V3   | port2 5V| sensor 0 echo\nGPIO5   | port3 3V3   | port3 5V| sensor 1 trigger\nGPIO4   | port4 3V3   | port4 5V| sensor 1 echo\nGPIO13   | port5 3V3   | port5 5V| sensor 2 trigger\nGPIO12   | port6 3V3   | port6 5V| sensor 2 echo\n\nThis is only how the default app is configured, it is really easy to change.\nYou can even configure the sensors in \"one-pin mode\", that means you can attach one ultrasonic sensor to each interrupt enabled GPIO. See [esp8266_ping](https://github.com/eadf/esp8266_ping) for details.\n\nLook in the console for the mqtt topic it uses (it's unique to each esp).\n\n\n###Building and installing:\n\nFirst you need to install the sdk and the easy way of doing that is to use [esp_open_sdk.](https://github.com/pfalcon/esp-open-sdk)\n\nYou can put that anywhere you like (/opt/local/esp-open-sdk, /esptools etc etc)\n\nThen you could create a small ```setenv.sh``` file, containing the location of your newly compiled sdk and other platform specific info;\n```\nexport SDK_BASE=/opt/local/esp-open-sdk/sdk\nexport PATH=${SDK_BASE}/../xtensa-lx106-elf/bin:${PATH}\nexport ESPPORT=/dev/ttyO0  \n```\n(or setup your IDE to do the same)\n\nYou will have to edit the ```include/user_config.h``` file to suit your WiFi and mqtt settings. Alternatively you can copy ```include/user_config.h``` into ```localinclude/user_config.h``` and git will not bother you about modified files.\n\nTo make a clean build, flash and connect to the esp console you just do this in a shell:\n```\nsource setenv.sh # This is only needed once per session\nmake clean \u0026\u0026 make test\n```\n\nYou won't be needing esptool, the makefile only uses esptool.py (provided by esp-open-sdk)\n\nI have tested this with sdk v0.9.4 and v0.9.5 (linux \u0026 mac)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feadf%2Fesp_mqtt_ping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feadf%2Fesp_mqtt_ping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feadf%2Fesp_mqtt_ping/lists"}