Skip to content

Commit

Permalink
mDNS support added
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgeiger committed Mar 11, 2019
1 parent b46c5f4 commit a583a77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion GeigerCounter/GeigerCounter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <ESP8266WiFi.h>
#include <WiFiManager.h>
#include <WiFiUdp.h>
#include <ESP8266mDNS.h>
#include "FS.h"

/*=============================================================================
Expand Down Expand Up @@ -91,6 +92,7 @@ WiFiUDP udp;
WiFiManager wifiManager;
WiFiServer server(80);
uint32 webRefresh = 60ul; // how often the webpage refreshes
const char *hostName = "geigercounter";

/*=============================================================================
======= METHODS =======
Expand Down Expand Up @@ -217,7 +219,9 @@ void setup()
}
else
{
Serial.println("WIFI connected");
Serial.println("WIFI connected");
MDNS.begin(hostName);
Serial.println("mDNS responder started");
server.begin();
Serial.println("WEB server started");
udp.begin(localPort);
Expand All @@ -242,6 +246,9 @@ void setup()

void loop()
{
// processing mDNS
MDNS.update();

// piezo tick handling
switch (piezo_state)
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The NTP client adjust the internal clock every 10 minutes. The timestamp (UTC Un

### HTTP server

The HTTP server shows a webpage, which is refreshing its contents every minute or on request by the "Refresh" button, with following contents:
The HTTP server shows a webpage (accessable over http:https://geigercounter.local) , which is refreshing its contents every minute or on request by the "Refresh" button, with following contents:

* the session details (total hit count, total minutes, average CPM and dose) after the last power reset or pressing the "Reset Session" button.
* a link to the download page.
Expand Down

0 comments on commit a583a77

Please sign in to comment.