You have here 4 kind of firmware: - stable builds for device with 1024kb and above - daily builds for device with 1024kb and above - daily builds for device with 512kb - work-in-progress OTA update Firmware
usb connector with serial converter, it just works. A LITTLE BIT TRICKY WAY: But in other case you could need a usb to ttl converter (5v or 3,5 v) for example in sonoff you have to put GPIO0 to ground-> on boot
MicroPython supports esptool (https://github.com/espressif/ esptool/), a python-based, open source and platform independent utility to write the ROM in ESP8266 and ESP32 chips: pip install esptool
type... ESP8266 Chip is ESP8266EX Features: WiFi Uploading stub... Running stub... Stub running... Erasing flash (this may take a while)... Chip erase completed successfully in 8.5s Hard resetting via RTS pin...
WIFI AP SSID: MICROPYTHON-XXXX AND PASSWD: micropythoN Connect via serial and get REPL: Read Evaluate Print Loop -> the easiest way to test your code! screen /dev/cu.SLAB_USBtoUART 115200
A BROWSER LET'S ENABLE IT! import webrepl_setup FOLLOW THE ON-SCREEN INSTRUCTION. NOW YOU ARE READY TO CONNECT TO MICROPYTHON VIA WEB REPL PROMPT. HTTP://WWW.MICROPYTHON.ORG/WEBREPL/ HTTPS://GITHUB.COM/MICROPYTHON/WEBREPL FOR OFF-LINE USE AND FOR USE COMMANDLINE TOOL, BASICALY TO COPY FILE IN YOUR DEVICE python webrepl_cli.py boot.py 192.168.4.1:/boot.py
your mac ioreg -p IOUSB -w0 +-o Root <class IORegistryEntry, id 0x100000100, retain 15> +-o AppleUSBXHCI Root Hub Simulation@14000000 <class AppleUSBRootHubDevice, id 0x1000003f8, registered, matched, active, busy 0 (1 ms), retain 10> +-o iBridge@14200000 <class AppleUSBDevice, id 0x1000003fa, registered, matched, active, busy 0 (50 ms), retain 36> +-o CP2102 USB to UART Bridge Controller@14600000 <class AppleUSBDevice, id 0x100002114, registered, matched, active, busy 0 (68 ms), retain 11> when I plugin the node mcu in my mac I view this new usb device, but it don't load the right usb-serial driver…
Drivers for nodemcu serial adapter built-in from: https://www.silabs.com/products/development-tools/ software/usb-to-uart-bridge-vcp-drivers after a reboot of your mac you could able to view /dev/ cu.SLAB_USBtoUART LAST TIP: make sure to try out different USB cables as well!
['boot.py', 'webrepl_cfg.py'] >>> the boot.py is executed when device boot up. Insert in boot.py the code that you want to execute when the board start up. After boot.py your board runs main.py.
time >>> pwm_led = machine.PWM(machine.Pin(2)) >>> pwm_led.duty(1023) >>> for i in range(3): ... for up in range(1023, -1, -50): ... pwm_led.duty(up) ... time.sleep(0.05) ... time.sleep(0.5) ... for down in range(0, 1023, 50): ... pwm_led.duty(down) ... time.sleep(0.05) ... time.sleep(0.5) ...
led >>> button = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_UP) >>> while True: ... if not button.value(): ... led.value(not led.value()) ... time.sleep(0.4) ... while not button.value(): ... pass
are strings separate by slash "/" For example : home/living/lamp for example you could send (publish) a message on topic "home/living/lamp" to turn on the lamp in your living room. The lamp receives this message because subscriber of that topic. A message is the information sent, it is a simple command or data
route their to subscribed clients Home assistant has an embedded MQTT Broker: hbmqtt, a python mqtt broker It exists many other MQTT Broker, for example: Mosquitto broker - http://mosquitto.org)