Skip to content

Commit

Permalink
Final
Browse files Browse the repository at this point in the history
  • Loading branch information
GreaseMonkey88 committed Nov 6, 2020
1 parent 3e1f7d0 commit 5f006ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Phototransistor pulls D2 to GND on increment from Smartmeter
// Wifi and mqtt network settings
const char *ssid = "the dude-net";
const char *password = "iR3DNw8ZFk-t9e3ixVJjhAE-2d9374H9sw5-Sv99fC645C2-6G4359L463tY";
const char *HostName = "ESP8266-SMdual"; // Edit the hostname which will be shown in your LAN
const char *mqtt_server = "10.0.0.10";
const char *mqtt_user = "mark";
const char *mqtt_pass = "8749";
Expand Down Expand Up @@ -57,7 +58,7 @@ void setup_wifi()
delay(100);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.hostname("ESP8266-SMdual"); // Edit the hostname which will be shown in your LAN
WiFi.hostname(HostName); // Edit the hostname which will be shown in your LAN
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
Expand Down Expand Up @@ -123,12 +124,12 @@ void setup()
Serial.println("Starting up...");
pinMode(pinD1, INPUT);
pinMode(pinD2, INPUT);
attachInterrupt(digitalPinToInterrupt(pinD1), IncrementCountA, RISING);
attachInterrupt(digitalPinToInterrupt(pinD2), IncrementCountB, RISING);
setup_wifi();
client.setServer(mqtt_server, 1885);
timeClient.begin();
Serial.println(version);
attachInterrupt(digitalPinToInterrupt(pinD1), IncrementCountA, RISING);
attachInterrupt(digitalPinToInterrupt(pinD2), IncrementCountB, RISING);
}

void loop()
Expand Down

0 comments on commit 5f006ac

Please sign in to comment.