Fullstack software engineer who loves building and breaking visually pleasing stuff.
Nest.js / Node.js / Vue.js and DevOps tooling.
๐ฆ Simplest OTA update solution for your Micropython projects.
License: GNU General Public License v3.0
Hi,
Thanks for this easy to use lib for OTA updates.
I was testing this lib to check if I can use this to pull repo from https://gitlab.com/ and I get this error when I try.
NotImplementedError: Redirects not yet supported
i tried this ( RAW) URL and it works fine.
OTA = senko.Senko(user="netdevopstraining", repo="micropython_ota_test", url="https://gitlab.com/netdevopstraining/micropython_ota_test/-/raw/main/app2", files=["main.py"])
Also wanted to check if this lib will work with private repos.
Thanks
Prathap
Hi, Thanks for sharing.
My git repo is private, will the git login work? if so, what part of the lib should I modify?
TIA
Attempting to use the "direct URL" example and ran into several issues:
/
separator at the endSeems /blob
urls may have worked in the past, but no longer work for raw files.
Non-working:
GITHUB_URL = "https://github.com/RangerDigital/senko/blob/master/examples/"
OTA = senko.Senko(url=GITHUB_URL, files=["boot.py", "main.py"])
Working:
GITHUB_URL = "https://raw.githubusercontent.com/RangerDigital/senko/master/examples"
OTA = senko.Senko(None, None, url=GITHUB_URL, files=["boot.py", "main.py"])
def _check_hash(self, x, y) should calculate sha one at a time to support certain implementations (Pycom MicroPython 1.20.3.b4 [v1.11-95ab8f63] on 2021-09-10; FiPy with ESP32)
Line 26 in 3e69507
Suggest simply doing them one after another:
x_hash = sha(x.encode())
x = x_hash.digest()
y_hash = sha(y.encode())
y = y_hash.digest()
Hello is there any plan to publish this to PyPi?
In my ideal iot development I would love to Install Senko with upip:
# main.py
import upip
upip.install('micropython-senko')
I would love to contribute to this!
Congrats this is a great project! and it actually works!
I noted this was originally written for targets including ESP32, but I am having trouble with memory allocation errors on micropython 1.19.1 (possibly older versions as well). It chokes on py files less than 26KB.
>>> OTA.fetch()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/senko.py", line 74, in fetch
File "/lib/senko.py", line 53, in _check_all
File "/lib/senko.py", line 45, in _get_file
File "urequests.py", line 28, in text
File "urequests.py", line 20, in content
MemoryError: memory allocation failed, allocating 12288 bytes
I have had some success in the past using gc.collect()
to help remedy memory allocation failures and even modified the _get_file()
method to collect before the urequests.get()
. SSL connections (using mbedTLS) has severe limitations with micropython due to limited IDF heap available and even is unusable in later versions of the ESP IDF due to memory allocation behavior (micropython/micropython#8940).
From what I can tell, this is not IDF heap related and I am running out of python memory. I moved the senko check in boot.py (before main application imports and init) and it is functioning as expected without error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.