Compare commits
3 Commits
14f58515cd
...
cce682def8
| Author | SHA1 | Date |
|---|---|---|
|
|
cce682def8 | |
|
|
74104047c9 | |
|
|
604a24086c |
15
README.md
15
README.md
|
|
@ -99,3 +99,18 @@ Der 3,3-V-Pin des Uno liefert nur ca. 150 mA, der ESP-01 braucht beim Start kurz
|
||||||
| WLAN Fehler E2 | ESP antwortet, Station-Modus nicht setzbar |
|
| WLAN Fehler E2 | ESP antwortet, Station-Modus nicht setzbar |
|
||||||
| WLAN Fehler E3 | Hotspot nicht erreichbar: SSID/Passwort, „Maximale Kompatibilität“ aus, Hotspot aus |
|
| WLAN Fehler E3 | Hotspot nicht erreichbar: SSID/Passwort, „Maximale Kompatibilität“ aus, Hotspot aus |
|
||||||
| CCS811 Fehler! | Sensor antwortet nicht am I2C: Verkabelung prüfen, `firmware/ccs811_diagnose` zeigt den genauen Schritt |
|
| CCS811 Fehler! | Sensor antwortet nicht am I2C: Verkabelung prüfen, `firmware/ccs811_diagnose` zeigt den genauen Schritt |
|
||||||
|
|
||||||
|
### „Mal geht's, mal nicht“ (E1 trotz richtiger Verkabelung)
|
||||||
|
|
||||||
|
**Beobachtung:** Bei korrekter, gekreuzter Verkabelung kam trotzdem manchmal „WLAN Fehler E1“. Zuverlässig lief es nur mit diesem Ablauf:
|
||||||
|
1. ESP **gerade** anschließen (TX → Pin 1, RX → Pin 0), Reset am Haupt-Uno
|
||||||
|
2. ESP **gekreuzt** anschließen (TX → Pin 0, RX → Pin 1), nochmal Reset
|
||||||
|
|
||||||
|
**Vermutete Ursache:** Der Sketch sucht beim Start die Baudrate des ESP (115200, 9600, 57600, 38400). Jeder Versuch mit falscher Baudrate – und auch der Uno-Reset selbst, bei dem die TX-Leitung kurz offen ist – kommt beim ESP als Zeichensalat an. Der ESP hängt diesen vor den nächsten Befehl (`x#~AT` statt `AT`), antwortet `ERROR` statt `OK`, und die Suche dreht sich im Kreis.
|
||||||
|
|
||||||
|
**Fix in der Firmware:** `espBaudrateFinden()` in `esp_wifi.h` schickt jetzt vor jedem `AT` eine leere Zeile. Damit schließt der ESP den Zeichensalat als eigene (ungültige) Zeile ab, und das folgende `AT` kommt sauber an. Seitdem reicht einmal gekreuzt anschließen + Reset (am Aufbau bestätigt). Der Ablauf oben ist nur noch Notlösung, falls es doch wieder auftritt.
|
||||||
|
|
||||||
|
Weitere Ursachen für wechselndes Verhalten:
|
||||||
|
- **Strom am Limit:** Ein Elko (100–470 µF) direkt zwischen VCC und GND am ESP fängt die Stromspitzen ab.
|
||||||
|
- **iPhone-Hotspot versteckt sich** nach einer Weile ohne verbundenes Gerät (dann E3): vor dem Reset Einstellungen → Persönlicher Hotspot öffnen.
|
||||||
|
- **Wackelkontakte** an GND, TX oder RX im Steckbrett.
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
|
|
@ -0,0 +1,112 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080" font-family="Arial, Helvetica, sans-serif">
|
||||||
|
<rect width="1920" height="1080" fill="#ffffff"/>
|
||||||
|
|
||||||
|
<text x="960" y="230" text-anchor="middle" font-size="48" font-weight="bold" fill="#1f2937">Kommunikationsweg der Messstation</text>
|
||||||
|
|
||||||
|
<!-- Sensoren -->
|
||||||
|
<rect x="60" y="370" width="220" height="100" rx="14" fill="#dcfce7" stroke="#15803d" stroke-width="3"/>
|
||||||
|
<text x="170" y="413" text-anchor="middle" font-size="26" font-weight="bold" fill="#14532d">DHT11</text>
|
||||||
|
<text x="170" y="445" text-anchor="middle" font-size="18" fill="#14532d">Temp. + Luftfeuchte</text>
|
||||||
|
|
||||||
|
<rect x="60" y="510" width="220" height="100" rx="14" fill="#dcfce7" stroke="#15803d" stroke-width="3"/>
|
||||||
|
<text x="170" y="553" text-anchor="middle" font-size="26" font-weight="bold" fill="#14532d">CCS811</text>
|
||||||
|
<text x="170" y="585" text-anchor="middle" font-size="18" fill="#14532d">eCO₂ + TVOC</text>
|
||||||
|
|
||||||
|
<!-- Uno Messstation -->
|
||||||
|
<rect x="420" y="360" width="220" height="260" rx="14" fill="#dbeafe" stroke="#1d4ed8" stroke-width="3"/>
|
||||||
|
<text x="530" y="440" text-anchor="middle" font-size="26" font-weight="bold" fill="#1e3a8a">Arduino</text>
|
||||||
|
<text x="530" y="472" text-anchor="middle" font-size="26" font-weight="bold" fill="#1e3a8a">Uno R3</text>
|
||||||
|
<text x="530" y="510" text-anchor="middle" font-size="18" fill="#1e3a8a">Messstation</text>
|
||||||
|
<text x="530" y="548" text-anchor="middle" font-size="18" fill="#1e3a8a">liest alle 2 s</text>
|
||||||
|
<text x="530" y="572" text-anchor="middle" font-size="18" fill="#1e3a8a">sendet alle ~4 s</text>
|
||||||
|
|
||||||
|
<!-- ESP-01 -->
|
||||||
|
<rect x="800" y="420" width="200" height="140" rx="14" fill="#ede9fe" stroke="#6d28d9" stroke-width="3"/>
|
||||||
|
<text x="900" y="475" text-anchor="middle" font-size="26" font-weight="bold" fill="#4c1d95">ESP-01</text>
|
||||||
|
<text x="900" y="505" text-anchor="middle" font-size="18" fill="#4c1d95">(ESP8266)</text>
|
||||||
|
<text x="900" y="532" text-anchor="middle" font-size="18" fill="#4c1d95">WLAN-Modul</text>
|
||||||
|
|
||||||
|
<!-- Hotspot -->
|
||||||
|
<rect x="1160" y="420" width="200" height="140" rx="14" fill="#ede9fe" stroke="#6d28d9" stroke-width="3"/>
|
||||||
|
<text x="1260" y="480" text-anchor="middle" font-size="26" font-weight="bold" fill="#4c1d95">Handy-</text>
|
||||||
|
<text x="1260" y="510" text-anchor="middle" font-size="26" font-weight="bold" fill="#4c1d95">Hotspot</text>
|
||||||
|
<text x="1260" y="538" text-anchor="middle" font-size="18" fill="#4c1d95">2,4 GHz</text>
|
||||||
|
|
||||||
|
<!-- Laptop -->
|
||||||
|
<rect x="1520" y="400" width="340" height="170" rx="14" fill="#f3f4f6" stroke="#374151" stroke-width="3"/>
|
||||||
|
<text x="1690" y="455" text-anchor="middle" font-size="26" font-weight="bold" fill="#111827">Laptop</text>
|
||||||
|
<text x="1690" y="490" text-anchor="middle" font-size="18" fill="#111827">Python-Webserver</text>
|
||||||
|
<text x="1690" y="516" text-anchor="middle" font-size="18" fill="#111827">server.py, Port 3000</text>
|
||||||
|
<text x="1690" y="542" text-anchor="middle" font-size="18" fill="#111827">speichert den Verlauf</text>
|
||||||
|
|
||||||
|
<!-- LCD -->
|
||||||
|
<rect x="420" y="720" width="220" height="110" rx="14" fill="#dbeafe" stroke="#1d4ed8" stroke-width="3"/>
|
||||||
|
<text x="530" y="765" text-anchor="middle" font-size="26" font-weight="bold" fill="#1e3a8a">LCD 16×2</text>
|
||||||
|
<text x="530" y="797" text-anchor="middle" font-size="18" fill="#1e3a8a">Anzeige vor Ort</text>
|
||||||
|
|
||||||
|
<!-- Zweiter Uno -->
|
||||||
|
<rect x="800" y="720" width="200" height="110" rx="14" fill="#ffedd5" stroke="#c2410c" stroke-width="3"/>
|
||||||
|
<text x="900" y="765" text-anchor="middle" font-size="26" font-weight="bold" fill="#7c2d12">2. Uno R3</text>
|
||||||
|
<text x="900" y="797" text-anchor="middle" font-size="18" fill="#7c2d12">nur Stromversorgung</text>
|
||||||
|
|
||||||
|
<!-- Browser -->
|
||||||
|
<rect x="1520" y="720" width="340" height="130" rx="14" fill="#f3f4f6" stroke="#374151" stroke-width="3"/>
|
||||||
|
<text x="1690" y="765" text-anchor="middle" font-size="26" font-weight="bold" fill="#111827">Browser (Website)</text>
|
||||||
|
<text x="1690" y="797" text-anchor="middle" font-size="18" fill="#111827">Live-Werte, Verlauf,</text>
|
||||||
|
<text x="1690" y="823" text-anchor="middle" font-size="18" fill="#111827">CO₂-Alarm ab 1000 ppm</text>
|
||||||
|
|
||||||
|
<!-- Datenpfeile -->
|
||||||
|
<g stroke="#1f2937" stroke-width="4" fill="none">
|
||||||
|
<line x1="280" y1="420" x2="406" y2="420"/>
|
||||||
|
<line x1="280" y1="560" x2="406" y2="560"/>
|
||||||
|
<line x1="640" y1="490" x2="786" y2="490"/>
|
||||||
|
<line x1="1000" y1="490" x2="1146" y2="490"/>
|
||||||
|
<line x1="1360" y1="490" x2="1506" y2="490"/>
|
||||||
|
<line x1="530" y1="620" x2="530" y2="706"/>
|
||||||
|
<line x1="1650" y1="720" x2="1650" y2="584"/>
|
||||||
|
<line x1="1730" y1="570" x2="1730" y2="706"/>
|
||||||
|
</g>
|
||||||
|
<g fill="#1f2937">
|
||||||
|
<polygon points="420,420 404,411 404,429"/>
|
||||||
|
<polygon points="420,560 404,551 404,569"/>
|
||||||
|
<polygon points="800,490 784,481 784,499"/>
|
||||||
|
<polygon points="1160,490 1144,481 1144,499"/>
|
||||||
|
<polygon points="1520,490 1504,481 1504,499"/>
|
||||||
|
<polygon points="530,720 521,704 539,704"/>
|
||||||
|
<polygon points="1650,570 1641,586 1659,586"/>
|
||||||
|
<polygon points="1730,720 1721,704 1739,704"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Strompfeil (gestrichelt) -->
|
||||||
|
<line x1="900" y1="720" x2="900" y2="576" stroke="#c2410c" stroke-width="4" stroke-dasharray="12 8"/>
|
||||||
|
<polygon points="900,560 891,576 909,576" fill="#c2410c"/>
|
||||||
|
|
||||||
|
<!-- Pfeilbeschriftungen -->
|
||||||
|
<g font-size="18" fill="#374151" text-anchor="middle">
|
||||||
|
<text x="350" y="406">Digital (Pin 2)</text>
|
||||||
|
<text x="350" y="546">I²C (A4/A5)</text>
|
||||||
|
<text x="720" y="452">UART Pin 0/1</text>
|
||||||
|
<text x="720" y="476">AT-Befehle</text>
|
||||||
|
<text x="1080" y="452">WLAN</text>
|
||||||
|
<text x="1080" y="476">2,4 GHz</text>
|
||||||
|
<text x="1440" y="452">HTTP POST</text>
|
||||||
|
<text x="1440" y="476">JSON</text>
|
||||||
|
<text x="1440" y="520">/api/messwerte</text>
|
||||||
|
</g>
|
||||||
|
<g font-size="18" fill="#374151">
|
||||||
|
<text x="545" y="668">parallel, 4 Bit</text>
|
||||||
|
<text x="915" y="645" fill="#c2410c">3,3 V + GND</text>
|
||||||
|
<text x="1636" y="640" text-anchor="end">HTTP GET</text>
|
||||||
|
<text x="1636" y="664" text-anchor="end">alle 2 s</text>
|
||||||
|
<text x="1744" y="640">JSON-</text>
|
||||||
|
<text x="1744" y="664">Antwort</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Legende -->
|
||||||
|
<line x1="660" y1="960" x2="740" y2="960" stroke="#1f2937" stroke-width="4"/>
|
||||||
|
<polygon points="754,960 738,951 738,969" fill="#1f2937"/>
|
||||||
|
<text x="770" y="967" font-size="22" fill="#374151">Daten</text>
|
||||||
|
<line x1="1000" y1="960" x2="1080" y2="960" stroke="#c2410c" stroke-width="4" stroke-dasharray="12 8"/>
|
||||||
|
<polygon points="1094,960 1078,951 1078,969" fill="#c2410c"/>
|
||||||
|
<text x="1110" y="967" font-size="22" fill="#374151">Stromversorgung</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 6.4 KiB |
|
|
@ -57,6 +57,10 @@ bool espBaudrateFinden() {
|
||||||
for (uint8_t runde = 0; runde < 2; runde++) {
|
for (uint8_t runde = 0; runde < 2; runde++) {
|
||||||
for (uint8_t i = 0; i < 4; i++) {
|
for (uint8_t i = 0; i < 4; i++) {
|
||||||
espSerial.begin(raten[i]);
|
espSerial.begin(raten[i]);
|
||||||
|
// Leere Zeile zuerst: schliesst Zeichensalat ab, den der ESP beim Uno-Reset oder durch
|
||||||
|
// einen Versuch mit falscher Baudrate empfangen hat. Sonst wird daraus z. B. "x#~AT" -> ERROR.
|
||||||
|
espSerial.print(F("\r\n"));
|
||||||
|
delay(100);
|
||||||
if (espBefehl(F("AT"), "OK", 1000)) {
|
if (espBefehl(F("AT"), "OK", 1000)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue