Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
esp [2020/06/02 17:15] – [Allgemein] geraldesp [2025/05/04 23:58] (aktuell) – [esp32-cam] gerald
Zeile 23: Zeile 23:
 ==== Linux ==== ==== Linux ====
  
-=== Esptools ===+=== Esptools Python ===
  
 <code>git clone https://github.com/themadinventor/esptool.git</code> <code>git clone https://github.com/themadinventor/esptool.git</code>
Zeile 35: Zeile 35:
 <code>sudo python esptool.py --port /dev/ttyUSB0 erase_flash</code> <code>sudo python esptool.py --port /dev/ttyUSB0 erase_flash</code>
  
 +=== ESPtool ===
  
-===== Development =====+ 
 + 
 +Ist bei Ubuntu schon dabei. 
 + 
 +Checken, was für Flash-Speicher verbaut ist (Größe) (ist ja extern beim ESP) 
 +<code> 
 + esptool --port /dev/ttyUSB0 flash_id 
 +</code> 
 + 
 +== flashen == 
 + 
 + 
 +If you have an ESP-01 or other device without built-in USB, you will need to enable flashing yourself by pulling GPIO0 low or pressing a "flash" switch, while powering up or resetting the module. 
 + 
 +<code> 
 +sudo esptool --port /dev/ttyUSB0 write_flash -fm dio 0x00000 tasmota.bin 
 +</code> 
 + 
 +== CH340 Serial USB-driver == 
 + 
 +Manche ESP haben einen USB-Chip eingebaut (z.B. Dmos D1 mini), der den CH340 driver benötigt. Der eingebaute von Ubuntu ist Scheisse (auch 2022 noch). Daher gibt es einen gepatchten driver: 
 + 
 + 
 +[[https://github.com/juliagoda/CH341SER]] 
 + 
 +Quelle((https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/linux)) 
 + 
 +  * cd into the directory where the files are saved 
 +  * make clean 
 +  * make 
 +  * sudo make load 
 +  * sudo rmmod ch341 to uninstall the broken driver 
 +  * lsmod | grep ch34 to list what modules are currently installed 
 +  * Plug and unplug your CH340 device again on the USB port 
 +  * dmesg 
 +    
 +        Expected output (should show "ch34x" now): 
 +<code> 
 +[  xxx] ch34x ttyUSB0: ch34x converter now disconnected from ttyUSB0 
 +[  xxx] ch34x 3-2:1.0: device disconnected 
 +</code> 
 +Depending on your root permissions, you may need to configure the serial port with the following two commands. Make sure to adjust the $username with respect to the user ID that is currently logged in. 
 + 
 +<code> 
 +sudo usermod -a -G dialout $username  
 +sudo chmod a+rw /dev/ttyUSB0 
 +</code> 
 + 
 +Siehe auch Arduino IDE auf Quellenseite! 
 + 
 + 
 + 
 +===== Development /Programmierung ===== 
 + 
 +DerESP8266 hat 2 UART eingebaut UART0 ist der ganz normale Serielle Anschluss über TX (GPIO1)  
 + & RX (GPIO3)  
 + 
 + 
 +Der ESP8266 verfügt über zwei UART-Schnittstellen: UART0 und UART1. Diese können für die Kommunikation mit seriellen Geräten genutzt werden, haben jedoch unterschiedliche Einschränkungen. 
 + 
 +**UART0 (Haupt-UART)** 
 + 
 +Standard-Pins: 
 +  * TX: GPIO1 
 +  * RX: GPIO3 
 +Eigenschaften: 
 + 
 +Volle Duplex-Kommunikation (kann senden und empfangen). 
 +Wird standardmäßig für die serielle Kommunikation und Debugging genutzt. 
 + 
 +Kann über Software auf andere GPIOs gemappt werden (via Serial.swap()): 
 + 
 +  * TX: GPIO15 
 +  * RX: GPIO13 
 + 
 +**UART1** 
 + 
 +Standard-Pin: 
 + 
 +  * TX: GPIO2 
 +Einschränkungen: 
 + 
 +  * Nur TX ist verfügbar; RX ist nicht nutzbar. 
 +  * Typischerweise für Debug-Ausgaben genutzt. 
 +  * Kann nicht für vollständige UART-Kommunikation verwendet werden (kein Empfang).
  
 ==== Arduino IDE ==== ==== Arduino IDE ====
Zeile 50: Zeile 135:
  
  
-===== ESP8266 =====+===== ESP8266 Projekte =====
  
  
Zeile 117: Zeile 202:
 https://hackaday.com/2019/04/15/a-robust-esp8266-rfid-access-control-system/ https://hackaday.com/2019/04/15/a-robust-esp8266-rfid-access-control-system/
  
 +
 +
 +==== McLighting v2 - The ESP8266 based multi-client lighting gadget ====
 +
 +Open Source projekt zur LED-Steuerung mit ESP
 +
 +McLighting (the multi-client lighting gadget) is a very cheap internet-controllable lighting solution based on the famous ESP8266 microcontroller and WS2811/2812 led strips. It features among other things a web-interface, a REST-API and a websocket connector.
 +
 +Because of it's open architecture and APIs it's easy to build new clients for different platforms (iOS, Android, Windows Universal Apps, Siri/Cortana integration, ...).
 +
 +[[https://github.com/toblum/McLighting]]
  
  
Zeile 124: Zeile 220:
  
 [[https://github.com/arendst/Tasmota/wiki/Tuya-OTA]] [[https://github.com/arendst/Tasmota/wiki/Tuya-OTA]]
 +
 +==== DeAuther ====
 +
 +[[https://github.com/SpacehuhnTech/esp8266_deauther]]
 +
 +==== Relais Boards ====
 +
 +=== LC Technology 4CH Relay ===
 +
 +TASMOTA
 +
 +
 +Tasmota->Einstellungen->Sonstige Einstellungen->Vorlage
 +
 +Ist-Zustand (Relais schalten nicht, obwohl Oberfläche so tut, als wäre dem so)
 +
 +<code>
 +{"NAME":"LC Technology 4CH Relay","GPIO":[224,0,225,0,226,227,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
 +</code>
 +
 +Tasmota 12.0.2 von Theo Arends
 +
 +[[https://tasmota.github.io/docs/devices/LC-Technology-WiFi-Relay/#lc-technology-wifi-relay-quad-relay-note-older-versions-of-this-board-used-a-baud-rate-of-9600-so-if-115200-doesnt-work-try-9600]]
 +
 +<code>
 +{"NAME":"LC Technology 4CH Relay","GPIO":[52,255,17,255,255,255,255,255,21,22,23,24,255],"FLAG":0,"BASE":18}
 +</code>
 +
 +{{::lc-4-relais-tasmota.jpg?200|}}
 +
 +2023: bekomm's nicht wieder hin. Vielleicht hier? : [[https://templates.blakadder.com/LC-ESP01-4R-5V.html]]
 +
 +Spezifikationen:
 +
 +Boardgröße: 60 * 63mm
 +
 +Schnittstelle an Bord:
 +  * IN +, IN-: 5V Spannungseingang;
 +  * 5V, GND, TX, RX: serielle UART-Port-PIN;
 +  * SWIM, PIN8, NRST: reservierter MCU-Download-Port.
 +
 +  * Taste S1: Änderungsmodus, Standardmodus ist Modus 1
 +  * Taste S2: Zurücksetzen
 +   
 +  * LED D1 / D2 / D3 / D4 (rot): Relais arbeitet LED, LED leuchtet bei eingeschaltetem Relais
 +  * LED D7 (rot): Anzeige für Modus 1
 +  * LED D5 (blau): Anzeige für Modus 2
 +  * LED D6 (grün): Werkstattindikator, genaue Details wie folgt:
 +
 +  - Wenn er gelöscht wird, wird er vom Router konfiguriert oder getrennt.
 +  - 0.5s schnelles Blinken stellt dar, dass Handy-APP WIFI-Konto und Kennwort für ESP-01-Modul konfiguriert
 +  - 2S blinkt langsam, um die Konfiguration zu beenden, und warten auf die Verbindung mit dem Mobiltelefon über TCP
 +  - LED leuchtet immer auf TCP-Verbindungen mit Mobiltelefon erfolgreich
 +
 +Anschluss für reservierten Zwei-Kappen-Jumper:
 +  * Im Allgemeinen, fügen Sie sie nach unten, das ist RX zu RX1, TX zu TX1. Setzen Sie sie nach oben, wenn Sie es als USB-Modul verwenden
 +
 +  * COM1 COM2 COM3 COM4: Gemeinsames Terminal;
 +  * NC1 NC2 NC3 NC4: normal geschlossen
 +  * NO1 NO2 NO3 NO4: normal geöffnet
 +
 +Steuerbefehl für Relais (Hex-Format):
 +  * Relais 1 öffnen: A0 01 01 A2
 +  * Relais 1 schließen: A0 01 00 A1
 +  * Relais 2 öffnen: A0 02 01 A3
 +  * Relais 2 schließen: A0 02 00 A2
 +  * Relais 3 öffnen: A0 03 01 A4
 +  * Relais 3 schließen: A0 03 00 A3
 +  * Relais 4 öffnen: A0 04 01 A5
 +  * Relais 4 schließen: A0 04 00 A4
 +
 +Anleitung sieht auch gut aus: [[https://gripseljagd.wordpress.com/2022/02/08/tasmota-relais-das-3te/]]
 +
 +=== 2er Relais Board (Garage) ===
 +
 +2 Relais
 +
 +ESP-12F 5V/8-80V 2 Channel Relay Board (ESP12F_Relay_X2) {{ ::esp12f_relay_x2.webp |}}
 +
 +{{ ::esp12f_relay_x2.pdf |Datenblatt/Instruction}}
 +
 +5x8cm
 +
 +zusätzliche Kontakte (gegen GRN, Pull-Up 10k Ohm) ((https://tasmota.github.io/docs/Expanding-Tasmota/#electrical-considerations))
 +
 +Stecker:
 +  * GPIO 12
 +  * GPIO 13
 +  * GPIO 02
 +  * Schwarz = GND
 +
 +
 +  * Switch1 (Garagentor offen): GPIO 02
 +  * Switch2 (Garagentür): GPIO 12
 +  * Switch3 (Garagentür geschlossen): GPIO 13
 +
 +
 +Ein Relais nur kurz schalten: [[https://nerdiy.de/de_de/tasmota-nachlaufen-eines-relais-einstellen/]]
 +
 +SetOption26 (Anzeige der Relais-Indizes) aktivieren:
 +
 +<code>SetOption26 1</code>
 +
 +Weitere Beispiele für den Bereich 0,1 bis 11,1:
 +
 +Haltezeit von 3,7 Sekunden:
 +<code>PulseTime 37</code>
 +
 +Haltezeit von 4,2 Sekunden:
 +<code>PulseTime 42</code>
 +
 +PulseTime deaktiveren:
 +<code>PulseTime 0</code>
 +
 +
 +{{::bildschirmfoto_vom_2024-11-28_14-56-25.png?400|}}
 +
 +
  
 ====== ESP32 ====== ====== ESP32 ======
Zeile 135: Zeile 349:
 [[https://www.fambach.net/esp32-cam-modul/]] [[https://www.fambach.net/esp32-cam-modul/]]
 ==== esp32-cam ==== ==== esp32-cam ====
 +
 +=== Tasmota ESP32 Cam ===
 +
 +
 +[[https://github.com/prusa3d/Prusa-Firmware-ESP32-Cam]]
 +
 +Turn on/off rtsp: [[https://cgomesu.com/blog/Esp32cam-tasmota-webcam-server/#rtsp-server]]
 +
 +Konsole: command:
 +
 +<code>WcRtsp 1</code>
 +
 +Now, the video stream should be accessible via RTSP using the following address:
 +
 +
 +<code>rtsp://DEVICE_IP:8554/mjpeg/1</code>
 +Vogelcam1: .137
 +
 +Vogelcam2: .60
 +
 +Um den RTSP-Stream zu youtube zu übertragen, braucht man einen Zwischenserver
 + Ein Raspi sollte reichen. Lt. ChatGPT reicht evtl. ein 2 oder 3: Umkodieren von RTSP zu H264. YouTube erwartet einen RTMP-Stream mit einem effizienteren Video-Codec wie H.264. 
 +
 +<code>
 +ffmpeg -rtsp_transport tcp -i rtsp://<KAMERA_IP>:8554/mjpeg/1 \
 +-f lavfi -i anullsrc \
 +-c:v libx264 -preset veryfast -tune zerolatency \
 +-c:a aac -ar 44100 -ac 2 \
 +-f flv rtmp://a.rtmp.youtube.com/live2/<DEIN_STREAMSCHLÜSSEL>
 +</code>
 +
 +  * -f lavfi -i anullsrc : Erzeugt einen stillen Audio-Stream, da YouTube einen Audio-Kanal erwartet.
 +  * -rtsp_transport tcp : Verwendet TCP für den RTSP-Transport, was stabiler ist.
 +  * -i rtsp://<KAMERA_IP>:8554/mjpeg/1 : RTSP-URL deiner Tasmota-CAM.
 +  * -c:v copy : Kopiert den Video-Stream ohne Neukodierung.
 +  * -c:a aac : Kodiert den Audio-Stream im AAC-Format.
 +  * -f flv : Setzt das Ausgabeformat auf FLV, das von YouTube erwartet wird.
 +  * rtmp://a.rtmp.youtube.com/live2/<DEIN_STREAMSCHLÜSSEL> : Ziel-URL für den YouTube-Live-Stream.
 +
 +
 +=== Tasmota-Cam-releases ===
 +
 +
 +Tasmota: [[http://ota.tasmota.com/tasmota32/release/]]
 +
 +=== External/internal WiFi antenna ===
 +
 +Quelle((https://github.com/prusa3d/Prusa-Firmware-ESP32-Cam/blob/master/doc/AI_Thinker-ESP32-cam/README.md))
 +
 +The standard ESP32-CAM board utilizes an internal antenna on the PCB. However, this antenna can sometimes cause issues with the quality of the WiFi signal, leading to slow photo uploads to PrusaConnect or connectivity problems. Fortunately, there is an option to connect an external antenna. This requires changing the resistor position, as shown in the picture below. Then, you can use a 2.4GHz Wi-Fi cable with a U.FL to RP-SMA connector and a standard 2.4GHz WiFi antenna
 +
 +{{::esp32-cam_ext_ant.png?600|}}
 +
 +=== Infrarotfilter entfernen ===
 +
 +
 +[[https://www.visualmicro.com/page/ESP32-NightVision.aspx]]
 +
 +Der Filter ist ein quadratisches, bunt glänzendes Glas auf der Oberseite. Man muss vorne die linse mit einem Skalpell rundrum aufschneiden.
 +
 +=== IR-Scheinwerfer ===
 +
 +
 +IR-Licht:
 +
 +{{::raspberry-pi-night-vision-camera-ir-led-b-600x600.jpg?600|}}
 +
 +-ich denke, der kleine Poi regelt, ab wie viel Licht (Sensor) sich das IR-LED einschaltet.
 +
 +
 +
 +
 +=== alt: ===
 +
  
  
Zeile 239: Zeile 527:
  
 Stream speichern unter Linux: [[https://www.fambach.net/mpv-linux/]] Stream speichern unter Linux: [[https://www.fambach.net/mpv-linux/]]
 +
 +
 +=== Wasseruhr /Stromzähler auslesen mit ESP32Cam ===
 +
 +Mit AI
 +
 +[[https://community.symcon.de/t/wasseruhr-auslesen-mit-einem-esp32-cam/122960]]
 +
 +AI-on-the-edge-device: 
 +[[https://github.com/jomjol/AI-on-the-edge-device/wiki/Installation]]
 +
 +
 +
 +
 +
  
  
 
Nach oben
esp.1591118115.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp   Dogecoin Donations Accepted Here    DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp  DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp