{"id":19811219,"url":"https://github.com/edgenesis/shifu-tdengine-demo","last_synced_at":"2025-05-01T08:32:42.426Z","repository":{"id":111970756,"uuid":"557677896","full_name":"Edgenesis/shifu-tdengine-demo","owner":"Edgenesis","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-13T09:09:11.000Z","size":146,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-06T11:51:47.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Edgenesis.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-26T05:07:30.000Z","updated_at":"2024-12-27T04:03:14.000Z","dependencies_parsed_at":"2023-12-25T09:43:37.262Z","dependency_job_id":"c94c8d58-157a-44ba-9202-f3366403eb58","html_url":"https://github.com/Edgenesis/shifu-tdengine-demo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgenesis%2Fshifu-tdengine-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgenesis%2Fshifu-tdengine-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgenesis%2Fshifu-tdengine-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edgenesis%2Fshifu-tdengine-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edgenesis","download_url":"https://codeload.github.com/Edgenesis/shifu-tdengine-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251847828,"owners_count":21653582,"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-11-12T09:25:23.859Z","updated_at":"2025-05-01T08:32:42.124Z","avatar_url":"https://github.com/Edgenesis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## IMPORTANT❗️❗️❗️\n\n### Please make sure you are currently under Wi-Fi ShifuTest(Password:12345678) so that you can connect to our device. 🪧\n\n## Prepare\n\nkind needs to pull the image from the Docker Hub. If there is a firewall accessing it through your network, you need to configure a proxy for your bash\nyour-ip requires the use of an internal network address, cannot use localhost or 127.0.0.1\n\n```bash\n# export http_proxy=\"http://your-ip:port\"\n# export https_proxy=\"http://your-ip:port\"\n# export all_proxy=\"socks5://your-ip:port\"\n# export no_proxy=\"localhost,127.0.0.1,localaddress,.localdomain.com\"\n```\n\ninstall kind and create cluster\n\n```bash\ngo install sigs.k8s.io/kind@v0.22.0\nkind create cluster\n```\n\nload all images to docker 🪞\n\n```bash\nmake buildx-build-driver-image\nmake kind-load-images\n```\n\n## Install TDEngine\n\nrun tdengine docker container 🏃‍♂️\n\n```bash\ndocker run -d -p 6030:6030 -p 6041:6041 -p 6043-6049:6043-6049 -p 6043-6049:6043-6049/udp --name tdengine tdengine/tdengine:3.0.1.4\n```\n\nmake sure it is running:\n\n```bash\ndocker ps| grep tdengine\n```\n\n```text\n8dc20c5ea43b   tdengine/tdengine:3.0.1.4                        \"/tini -- /usr/bin/e…\"   About a minute ago   Up About a minute   0.0.0.0:6030-\u003e6030/tcp, 0.0.0.0:6041-\u003e6041/tcp, 0.0.0.0:6043-6049-\u003e6043-6049/tcp, 0.0.0.0:6043-6049-\u003e6043-6049/udp   tdengine\n```\n\ngo into tedngine and init table 🚪\n```bash\ndocker exec -it tdengine taos\n```\n\nInit TDEngine and Insert a default Data 🕹\n\n```sql\nCreate database shifu;\nUse shifu;\nCreate TABLE Temperature (ts TIMESTAMP, v FLOAT);\nCreate TABLE Humidity (ts TIMESTAMP, v FLOAT);\nSHOW TABLES;\nexit\n```\n\n🎉🎉 Congratulations on your successful installation of TDEngine! 👁️\n\n## Install Shifu\n\nyou just need to use one command to install Shifu 😋\n\n```bash\nkubectl apply -f https://raw.githubusercontent.com/Edgenesis/shifu/v0.46.0/pkg/k8s/crd/install/shifu_install.yml\n```\n\n## Run Shifu TelemetryService\nFirst, you need to modify `devicedeploy/http-deviceshifu-telemetryservice.yaml`, and change the value of  `spec/serviceSettings/SQLSetting/serverAddress`.\n\n```yaml\n--- #telemetry_service.yaml\napiVersion: shifu.edgenesis.io/v1alpha1\nkind: TelemetryService\nmetadata:\n  name: push-endpoint-1\n  namespace: devices\nspec:\n  telemetrySeriveEndpoint: http://telemetryservice.shifu-service.svc.cluster.local\n  serviceSettings:\n    SQLSetting:\n      serverAddress: [YOUR_IP]:6041 # edit it to your your IP\n      username: root\n      secret: taosdata\n      dbName: shifu\n      dbTable: Temperature\n      dbtype: TDengine\n---\napiVersion: shifu.edgenesis.io/v1alpha1\nkind: TelemetryService\nmetadata:\n  name: push-endpoint-2\n  namespace: devices\nspec:\n  telemetrySeriveEndpoint: http://telemetryservice.shifu-service.svc.cluster.local\n  serviceSettings:\n    SQLSetting:\n      serverAddress: [YOUR_IP]:6041 # edit it to your your IP\n      username: root\n      secret: taosdata\n      dbName: shifu\n      dbTable: Humidity\n      dbtype: TDengine\n\n\n```\n\nYou can also change the dbTable to your table name in your TDEngine database, and of course you can change everything to what you want under SQLSetting. 🤗\n\nThen, you can use the following command to install the telemetry service into your Kind cluster.\n\n```bash\nkubectl apply -f telemetryservicedeploy\n```\n\n🚀 Congratulations on your successful installation of Shifu's Telemetry Service! Following is the last step you need to do. 👍\n\n## Run deviceShifu to Connect to Temperature and humidity meter\n\n🐎 One-liner:\n\n```bash\nkubectl apply -f devicedeploy\n```\nBy default, the tdengine's secret which store the username and password in the file `http-deviceshifu-secret.yaml`\nIf you want to create secret by yourself, you can use following command to create\n```bash\nkubectl create secret  generic taosdata --from-literal=username=\"root\" --from-literal=password=\"taosdata\" -n devices\n```\n\n# Enjoy the results of your work🕹\n\nYou can use the following command to access the TDEngine docker container.\n\n```bash\ndocker exec -it tdengine taos\n```\n\nUse the following SQL command to display the data you have collected.\n\n```sql\nuse shifu;\nSelect * From Temperature;\nSelect * From Humidity;\n```\n\nYou should see something like this:\n![temp\u0026hum](images/temp\u0026hum.png)\n\nt is the current temperature reading, and h is the current humidity reading.\n\n\n😘 Thank you for experimenting all the demos. Have fun today!\n\n# Clean up\n\n```bash\nkubectl delete -f devicedeploy \u0026\u0026 kubectl delete -f telemetryservicedeploy\ndocker stop tdengine\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgenesis%2Fshifu-tdengine-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgenesis%2Fshifu-tdengine-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgenesis%2Fshifu-tdengine-demo/lists"}