Benutzer-Werkzeuge

Webseiten-Werkzeuge


iot:micropython

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
iot:micropython [2019/10/14 02:40] adminiot:micropython [2025/02/11 10:05] (aktuell) – [Asynchronous Programming mit uasyncio:] admin
Zeile 1: Zeile 1:
 ====== MicroPython ====== ====== MicroPython ======
  
-=== MicroPython für esp8266 esp32 ===+[[iot:expressiv|Micropython Installation]] 
 + 
 +==== MicroPython für ESP8266 ESP32 ====
   * https://docs.micropython.org/en/latest/esp8266/general.html   * https://docs.micropython.org/en/latest/esp8266/general.html
   * https://docs.micropython.org/en/latest/esp32/quickref.html   * https://docs.micropython.org/en/latest/esp32/quickref.html
   * https://docs.zerynth.com/latest/official/board.zerynth.nodemcu_esp32/docs/index.html   * https://docs.zerynth.com/latest/official/board.zerynth.nodemcu_esp32/docs/index.html
 +
 +
 +  * [[https://github.com/lvidarte/esp8266/wiki/MicroPython%3A-REPL|Getting a MicroPython REPL prompt]]
 +
 +==== Develop for / with Micropython ====
  
   * https://learn.adafruit.com/micropython-basics-loading-modules/frozen-modules   * https://learn.adafruit.com/micropython-basics-loading-modules/frozen-modules
   * https://github.com/micropython/micropython-lib   * https://github.com/micropython/micropython-lib
 +  * https://github.com/adafruit/circuitpython
  
 +==== Porting Micropython ====
 +  * https://docs.micropython.org/en/latest/develop/porting.html
 +  * https://www.snaums.de/informatik/porting-micropython-to-bare-metal-raspberry-pi.html
 +  * https://www.snaums.de/informatik/porting-micropython-to-the-raspberry-pi-part-2.html
 +  * https://forum.micropython.org/viewtopic.php?t=5779
  
-=== Blink LED: ===+==== Blink LED: ====
  
 <code python> <code python>
Zeile 23: Zeile 36:
 </code> </code>
  
-== MQTT auf dem ESP32: ==+==== LED Helligkeit per PWM regeln: ==== 
 + 
 +<code python> 
 +from machine import Pin, PWM 
 +from time import sleep 
 + 
 +frequency = 5000 # Hz: can be a value between 0 and 78125 
 +led = PWM(Pin(2), frequency) 
 + 
 +while True: 
 +  for duty_cycle in range(0, 1024): #can be a value between 0 and 1023 (100%) 
 +    led.duty(duty_cycle) 
 +    sleep(0.005) 
 +</code> 
 + 
 +Quelle: https://randomnerdtutorials.com/esp32-esp8266-pwm-micropython/ 
 + 
 +==== Ping auf dem ESP32 ==== 
 + 
 +  * https://gist.github.com/shawwwn/91cc8979e33e82af6d99ec34c38195fb 
 + 
 +==== Asynchronous Programming mit uasyncio: ==== 
 + 
 +  * https://gpiocc.github.io/learn/micropython/esp/2020/06/13/martin-ku-asynchronous-programming-with-uasyncio-in-micropython.html 
 +  * https://www.youtube.com/watch?v=2IW-ZEui4h4 -- How To Easily Do Asynchronous Programming With Asyncio In Python 
 +==== MQTT auf dem ESP32: ====
   * https://boneskull.com/micropython-on-esp32-part-2/   * https://boneskull.com/micropython-on-esp32-part-2/
   * https://randomnerdtutorials.com/micropython-mqtt-esp32-esp8266/   * https://randomnerdtutorials.com/micropython-mqtt-esp32-esp8266/
Zeile 40: Zeile 78:
 </code> </code>
  
 +==== I2S Audio auf dem ESP32: ====
  
-=== DHT11/22 (ESP32)===+  * https://www.youtube.com/watch?v=UXt27kOokh0 - MicroPython I2S Audio with the ESP32 
 +  * https://github.com/miketeachman/micropython-i2s-examples 
 + 
 +==== BME280==== 
 + 
 +  * https://randomnerdtutorials.com/micropython-bme280-esp32-esp8266/ 
 + 
 +==== DHT11/22 (ESP32)====
   * https://randomnerdtutorials.com/micropython-esp32-esp8266-dht11-dht22-web-server/   * https://randomnerdtutorials.com/micropython-esp32-esp8266-dht11-dht22-web-server/
 <code python> <code python>
Zeile 61: Zeile 107:
       print(msg)       print(msg)
    except OSError as e:    except OSError as e:
-      return('Failed to read sensor.'+      print('Failed to read sensor.'
-   sleep 2+   sleep(2)
 </code> </code>
  
  
-== MicroPython to AWS-IOT ==+==== MicroPython to AWS-IOT ====
  
   * https://www.hackster.io/user3282664/micropython-to-aws-iot-cc1c20   * https://www.hackster.io/user3282664/micropython-to-aws-iot-cc1c20
  
-=== Enthaltene Module (ESP32)===+==== Enthaltene Module (ESP32)====
 <code python> <code python>
 help('modules') help('modules')
Zeile 94: Zeile 140:
 </code> </code>
  
 +==== Freien Speicher ermitteln ====
 +<code python>
 +>>> import gc
 +>>> gc.collect()
 +>>> gc.mem_free()
 +107488
 +>>> import micropython
 +>>> micropython.mem_info()
 +</code>
iot/micropython.1571020809.txt.gz · Zuletzt geändert: 2019/10/14 02:40 von admin