https://github.com/kamaslau/iot-client
IoT edge computing/gateway client, collecting DHT sensor time serie datas and report to RESTful API.
https://github.com/kamaslau/iot-client
dht11 dht22 iot nodejs
Last synced: 2 months ago
JSON representation
IoT edge computing/gateway client, collecting DHT sensor time serie datas and report to RESTful API.
- Host: GitHub
- URL: https://github.com/kamaslau/iot-client
- Owner: kamaslau
- Created: 2021-12-18T12:42:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-20T08:20:45.000Z (10 months ago)
- Last Synced: 2025-09-20T10:14:51.059Z (10 months ago)
- Topics: dht11, dht22, iot, nodejs
- Language: TypeScript
- Homepage:
- Size: 180 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README.md
## Usage
Connect GPIO4 pin with sensor data output, together with 3.3V and GND pins.
```bash
# Mount overlay to GPIO 4, and persist it between reboots
sudo sh -c 'echo "dtoverlay=dht11,gpiopin=4" >> /boot/firmware/config.txt'
sudo reboot
# Init .env file, modify and use your own InfluxDB Cloud tokens
cp .env.sample .env
# Do reading
go mod tidy
go run ./...
# Build executable
go build ./src/main.go # Output file will be placed under ./tmp
```
## Run in background
```bash
cd ./Demos/golang-gpio && nohup ./tmp/main > output.log 2>&1 &
```
## Run on OS start
Use with systemd:
```bash
# Initiate systemd config file
sudo nano /etc/systemd/system/golang-gpio.service
```
```ini
[Unit]
Description=Golang-GPIO
After=network.target
[Service]
ExecStart=/home/pi/Demos/golang-gpio/tmp/main
Restart=always
User=pi
WorkingDirectory=/home/pi/Demos/golang-gpio
[Install]
WantedBy=multi-user.target
```
After that, enable service and start for the first time:
```bash
# Enable & start service
sudo systemctl enable golang-gpio.service
sudo systemctl start golang-gpio.service
# Check status
sudo systemctl status golang-gpio.service
```