This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- DHT22 to MQTT Publisher | |
-- Andrew Elwell, 2016-06-08 | |
client='ESP-'..node.chipid() | |
m = mqtt.Client(client, 60) | |
m:lwt("status/"..client, "offline", 0, 1) | |
m:connect("10.1.1.251", 1883, 0, 1, function(hohoho) | |
print("connected") | |
hohoho:publish(string.format("status/%s", client, 0, 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# script to poll growatt PV inverter and spit out values | |
# Andrew Elwell <[email protected]> 2013-09-01 | |
import ConfigParser | |
from pymodbus.client.sync import ModbusSerialClient as ModbusClient | |
import time | |
import mosquitto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <modbus.h> | |
#define SM4_ID 3 | |
#define P120_ID 2 |