50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#include <EEPROM.h>
|
|
#include <Ethernet.h>
|
|
|
|
#include "config.h" // Symlinked from boil_kettle sketch
|
|
#include "datatypes.h" //
|
|
|
|
void setup() {
|
|
Vessel BoilKettle;
|
|
strcpy(BoilKettle.name, "boil_kettle");
|
|
strcpy(BoilKettle.setpoint, BOIL_SETPOINT_TOPIC);
|
|
strcpy(BoilKettle.sensor, BOIL_ACTUAL_TOPIC);
|
|
BoilKettle.Rref = RREF_KETTLE;
|
|
BoilKettle.RNominal = RNOMINAL_KETTLE;
|
|
|
|
// Vessel MashTun {mashname, MASH_SETPOINT_TOPIC, MASH_ACTUAL_TOPIC, RREF_MASH, RNOMINAL_MASH};
|
|
Vessel MashTun;
|
|
strcpy(MashTun.name, "mash_tun");
|
|
strcpy(MashTun.setpoint, MASH_SETPOINT_TOPIC);
|
|
strcpy(MashTun.sensor, MASH_ACTUAL_TOPIC);
|
|
MashTun.Rref = RREF_MASH;
|
|
MashTun.RNominal = RNOMINAL_MASH;
|
|
|
|
Topic mqtt_topics;
|
|
strcpy(mqtt_topics.root,TOPIC_ROOT);
|
|
mqtt_topics.mash = MashTun;
|
|
mqtt_topics.boil = BoilKettle;
|
|
|
|
Mqtt mqtt_data;
|
|
mqtt_data.broker = MQTT_BROKER;
|
|
strcpy(mqtt_data.user, MQTT_USER);
|
|
strcpy(mqtt_data.password, MQTT_PASSWORD);
|
|
mqtt_data.topic = mqtt_topics;
|
|
|
|
ConfigData conf;
|
|
conf.mqtt = mqtt_data;
|
|
memcpy(conf.mac, mac, sizeof(mac[0])*6);
|
|
conf.ip = ip;
|
|
conf.interval = UpdateInterval;
|
|
conf.period = PeriodPWM;
|
|
conf.threshold = ThreshPWR;
|
|
conf.hysteresis = Hysteresis;
|
|
|
|
EEPROM.put(0, conf);
|
|
}
|
|
|
|
void loop() {
|
|
|
|
}
|
|
|