- Flash ook in standaard run
- about.html heeft handleiding
This commit is contained in:
14
Manual.txt
14
Manual.txt
@@ -6,6 +6,7 @@ Software versie 1.0
|
||||
2: Groen knippert rustig rood uit = NodeMCU is verbonden met netwerk
|
||||
3: Groen knippert rustig rood flitst = Er wordt data verzonden over een connectie (PRTG server, webbrowser).
|
||||
4: Groen knippert rustig rood knippert rustig = Kan geen verbinding maken met de ingestelde PRTG server.
|
||||
5: Groen snel knipperen rood aan = Access point mode.
|
||||
|
||||
|
||||
--- Instellingen
|
||||
@@ -19,13 +20,12 @@ Note:
|
||||
|
||||
|
||||
--- Access Point mode
|
||||
1: rode led continue, groene led uit = NodeMCU probeert verbinding te maken met de ingestelde access point.
|
||||
2: flash knop op de NodeMCU ingedrukt houden tot de groene led continue brandt.
|
||||
3: Start de NodeMCU opnieuw (power cycle / reset knop).
|
||||
4: Rode led continue, groene led snel knipperen = AP mode
|
||||
5: Verbind met wifi netwerk H1602R10 (geen wachtwoord).
|
||||
6: Ga met de browser naar 192.168.1.1
|
||||
7: Wijzing de instellingen en start de NodeMCU opniew op.
|
||||
1: flash knop op de NodeMCU ingedrukt houden tot de groene led continue brandt.
|
||||
2: Start de NodeMCU opnieuw (power cycle / reset knop).
|
||||
3: Rode led continue, groene led snel knipperen = AP mode
|
||||
4: Verbind met wifi netwerk H1602R10 (geen wachtwoord).
|
||||
5: Ga met de browser naar 192.168.1.1
|
||||
6: Wijzing de instellingen en start de NodeMCU opniew op.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ ESP8266HTTPUpdateServer httpUpdater;
|
||||
|
||||
ADC_MODE(ADC_VCC);
|
||||
|
||||
const char* softwareVersion = "1.2 Build 13";
|
||||
const char* softwareVersion = "1.2 Build 14";
|
||||
|
||||
typedef struct {
|
||||
boolean enable;
|
||||
@@ -181,7 +181,7 @@ void setup() {
|
||||
//only config webserver, fast flashing green led
|
||||
server.handleClient();
|
||||
yield();
|
||||
if (ledCounter == 30000) {
|
||||
if (ledCounter == 20000) {
|
||||
digitalWrite(LED_GREEN, !digitalRead(LED_GREEN));
|
||||
ledCounter = 0;
|
||||
}
|
||||
@@ -238,6 +238,9 @@ void loop() {
|
||||
digitalWrite(LED_RED, HIGH);
|
||||
timerRaisedFlag = false;
|
||||
}
|
||||
|
||||
//check AP button
|
||||
checkApButton();
|
||||
}
|
||||
else {
|
||||
//Geen wifi verbinding, attempt to connect to Wifi network:
|
||||
@@ -248,6 +251,25 @@ void loop() {
|
||||
}
|
||||
}
|
||||
|
||||
volatile int buttonCounter = 0;
|
||||
void checkApButton(){
|
||||
//Check for button push
|
||||
if (digitalRead(AP_BUTTON) == 0) {
|
||||
buttonCounter ++;
|
||||
if (buttonCounter == 3) {
|
||||
//AP mode activation
|
||||
eepromStruct.apMode = true;
|
||||
EEPROM.put(0, eepromStruct);
|
||||
EEPROM.commit();
|
||||
digitalWrite(LED_GREEN, LOW);
|
||||
}
|
||||
}
|
||||
else {
|
||||
buttonCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Read eeprom check for empty eeprom
|
||||
void checkEeprom() {
|
||||
EEPROM.get(0, eepromStruct);
|
||||
@@ -329,7 +351,7 @@ int prtgServerUpdate()
|
||||
}
|
||||
}
|
||||
url += "</prtg>";
|
||||
//Serial.println(url);
|
||||
Serial.println(url);
|
||||
|
||||
// Use WiFiClient class to create TCP connections
|
||||
WiFiClient client;
|
||||
@@ -340,12 +362,12 @@ int prtgServerUpdate()
|
||||
// This will send the request to the server
|
||||
client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host:" + eepromStruct.prtgHost + "\r\n" + "Connection:close\r\n\r\n");
|
||||
|
||||
//delay(10);
|
||||
delay(10);
|
||||
// Read all the lines of the reply from server and print them to Serial
|
||||
// while (client.available()) {
|
||||
// String line = client.readStringUntil('\r');
|
||||
// Serial.print(line);
|
||||
// }
|
||||
while (client.available()) {
|
||||
String line = client.readStringUntil('\r');
|
||||
Serial.print(line);
|
||||
}
|
||||
|
||||
client.stop();
|
||||
return 0;
|
||||
@@ -361,30 +383,17 @@ void connectWifi() {
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.disconnect();
|
||||
|
||||
int buttonCounter = 0;
|
||||
|
||||
// attempt to connect to Wifi network:
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
WiFi.begin(eepromStruct.ssid, eepromStruct.password);
|
||||
// wait 5 seconds for connection:
|
||||
delay(5000);
|
||||
|
||||
//Check for button push
|
||||
if (digitalRead(AP_BUTTON) == 0) {
|
||||
buttonCounter ++;
|
||||
if (buttonCounter == 2) {
|
||||
//AP mode activation
|
||||
eepromStruct.apMode = true;
|
||||
EEPROM.put(0, eepromStruct);
|
||||
EEPROM.commit();
|
||||
digitalWrite(LED_GREEN, LOW);
|
||||
}
|
||||
}
|
||||
else {
|
||||
buttonCounter = 0;
|
||||
}
|
||||
}
|
||||
//WiFi.printDiag(Serial);
|
||||
checkApButton();
|
||||
}
|
||||
WiFi.printDiag(Serial);
|
||||
Serial.print("Connected, IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
ledFlashTimer.attach_ms(750, ledFlashChanged);
|
||||
}
|
||||
|
||||
@@ -421,7 +430,12 @@ void tickerChanged()
|
||||
|
||||
//Led flash timer
|
||||
void ledFlashChanged() {
|
||||
digitalWrite(LED_GREEN, !digitalRead(LED_GREEN));
|
||||
if(eepromStruct.apMode == true){
|
||||
digitalWrite(LED_GREEN, LOW);
|
||||
}else{
|
||||
digitalWrite(LED_GREEN, !digitalRead(LED_GREEN));
|
||||
}
|
||||
|
||||
if (connectionErrorFlag == true) {
|
||||
digitalWrite(LED_RED, !digitalRead(LED_GREEN));
|
||||
}
|
||||
@@ -697,7 +711,4 @@ void handleServerRequest(String path) {
|
||||
}
|
||||
digitalWrite(LED_RED, HIGH);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,48 @@
|
||||
<h1>H1602R10 About</h1>
|
||||
<div id="main">
|
||||
<div class="datafield">
|
||||
<h2>H1602</h2>
|
||||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
|
||||
<h2>H1602 </h2>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<th>Led groen</th>
|
||||
<th>Led rood</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Uit</td>
|
||||
<td>Aan</td>
|
||||
<td>NodeMCU probeert verbinding te maken met de ingestelde access point</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Knippert rustig</td>
|
||||
<td>Uit</td>
|
||||
<td>NodeMCU is verbonden met netwerk</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Knippert rustig</td>
|
||||
<td>Flitst</td>
|
||||
<td>Er wordt data verzonden over een connectie (PRTG server, webbrowser)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Knippert rustig</td>
|
||||
<td>Knippert rustig</td>
|
||||
<td>Kan geen verbinding maken met de ingestelde PRTG server</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Snel Knipperen</td>
|
||||
<td>Aan</td>
|
||||
<td>Access point mode (Wifi netwerk H1602R10)</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h4>Access Point mode</h4>
|
||||
<ol type="1">
|
||||
<li>flash knop op de NodeMCU ingedrukt houden tot de groene led continue brandt.</li>
|
||||
<li>Start de NodeMCU opnieuw (power cycle / reset knop).</li>
|
||||
<li>Rode led continue, groene led snel knipperen = AP mode</li>
|
||||
<li>Verbind met wifi netwerk H1602R10 (geen wachtwoord).</li>
|
||||
<li>Ga met de browser naar 192.168.1.1</li>
|
||||
<li>Wijzing de instellingen en start de NodeMCU opniew op.</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -193,3 +193,9 @@ li a:hover:not(.active) {
|
||||
background-color: #555;
|
||||
color: white;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
text-align: center;
|
||||
}
|
||||
Reference in New Issue
Block a user