-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support for OTA updates #3777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I got the CircuitPython update working. The changes are in my With the current implementation the user provides buffer to be placed in Question:
Todo enhancements:
Test Code:
import ota
import ssl
import time
import wifi
import socketpool
import microcontroller
import adafruit_requests
# Firmware
url = "https://adafruit-circuit-python.s3.amazonaws.com/bin/microdev_micro_s2/en_US/adafruit-circuitpython-microdev_micro_s2-en_US-6.1.0-beta.2.bin"
# Start Address 0x10000 (refer: partitions.csv/makefile)
header = {}
header["Range"] = "bytes=65536-"
# Configure Wifi
for network in wifi.radio.start_scanning_networks():
print(network, network.ssid, network.rssi, network.channel)
print()
wifi.radio.stop_scanning_networks()
wifi.radio.connect("ssid", "password")
# Setup Requests
pool = socketpool.SocketPool(wifi.radio)
requests = adafruit_requests.Session(pool, ssl.create_default_context())
# Log Time
start_time = time.monotonic()
# Get Firmware
response = requests.get(url, headers=header)
print(response.status_code)
print(response._headers)
print()
# Update Firmware
print("Preparing Update")
ota.flash(response.content)
print("Update took:", time.monotonic() - start_time, "sec")
print()
print("done")
# Reset Microcontroller
microcontroller.reset() |
Not now, let's start simple. :-) |
CircuitPython update is implemented and User Code update can be done by a FTP server implementation in python layer as a library instead of implementing it in the core. |
User Code update can be done by a FTP server implementation @microdev1 Any example available ? |
Hi @jamesjian007 There isn't a CircuitPython library to implement FTP server yet... I found a few MicroPython implementations which could be ported to |
Very interested in something like this; Managing the several devices scattered about would be magnitudes easier once this is implemented. |
Agree, a critical feature for real consumer applications. Please let me know if there is any progress on this. It would be great to be able to download both Circuitpython and user code over HTTPS and flash in smaller chunks, using Dualbank. |
The esp32s2 brings
WiFi
support and with that the possibility to have a mechanism forOTA
updates.There are two domains for
OTA
update implementation:User Code Update
For this my plan is to expose the
circuitpy
drive as a network drive.CircuitPython Update
The plan here is to have the user code handle firmware grabbing and for the flashing part I agree with what @tannewt suggests.
The text was updated successfully, but these errors were encountered: