Shortened docstrings. Optimised boot.py for soft-reboots.
This commit is contained in:
parent
03c06219ac
commit
02b51b082e
@ -13,6 +13,10 @@ Preparation
|
|||||||
|
|
||||||
Copy the `config.example.py` to `config.py` and adjust the constants to your home wifi network.
|
Copy the `config.example.py` to `config.py` and adjust the constants to your home wifi network.
|
||||||
|
|
||||||
|
If you want to try the script from a desktop computer, install all needed dependencies with:
|
||||||
|
|
||||||
|
micropython -m upip install -r requirements.txt
|
||||||
|
|
||||||
|
|
||||||
Connecting to the THETA
|
Connecting to the THETA
|
||||||
-----------------------
|
-----------------------
|
||||||
|
6
boot.py
6
boot.py
@ -3,12 +3,14 @@
|
|||||||
|
|
||||||
# Copy config.example.py to config.py and modify to your needs first!
|
# Copy config.example.py to config.py and modify to your needs first!
|
||||||
import config
|
import config
|
||||||
|
import machine
|
||||||
|
|
||||||
from machine import UART
|
#from machine import UART
|
||||||
from os import dupterm
|
from os import dupterm
|
||||||
uart = UART(0, 115200)
|
uart = machine.UART(0, 115200)
|
||||||
dupterm(uart)
|
dupterm(uart)
|
||||||
|
|
||||||
|
if machine.reset_cause() != machine.SOFT_RESET:
|
||||||
from network import WLAN
|
from network import WLAN
|
||||||
wifi = WLAN()
|
wifi = WLAN()
|
||||||
wifi.mode(WLAN.STA)
|
wifi.mode(WLAN.STA)
|
||||||
|
9
http.py
9
http.py
@ -1,10 +1,11 @@
|
|||||||
"""
|
"""
|
||||||
HTTP helper class
|
HTTP helper class
|
||||||
@author Markus Birth <markus@birth-online.de>
|
@author Markus Birth <markus@birth-online.de>
|
||||||
|
|
||||||
RFC: http://www.w3.org/Protocols/rfc2616/rfc2616.html
|
|
||||||
Inspiration: http://www.wellho.net/resources/ex.php4?item=y303/browser.py
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# RFC: http://www.w3.org/Protocols/rfc2616/rfc2616.html
|
||||||
|
# Inspiration: http://www.wellho.net/resources/ex.php4?item=y303/browser.py
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ class HTTP:
|
|||||||
def do_request(self, url, payload=False, type="GET"):
|
def do_request(self, url, payload=False, type="GET"):
|
||||||
urlparts = self.parse_url(url)
|
urlparts = self.parse_url(url)
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class ParseResult():
|
class ParseResult():
|
||||||
def __init__(self, scheme, netloc, path, params, query, fragment, username, password, hostname, port):
|
def __init__(self, scheme, netloc, path, params, query, fragment, username, password, hostname, port):
|
||||||
|
13
ptpip.py
13
ptpip.py
@ -1,13 +1,14 @@
|
|||||||
"""
|
"""
|
||||||
PTP/IP class for MicroPython
|
PTP/IP class for MicroPython
|
||||||
@author Markus Birth <markus@birth-online.de>
|
@author Markus Birth <markus@birth-online.de>
|
||||||
|
|
||||||
PTP/IP abstract: http://www.cipa.jp/ptp-ip/index_e.html
|
|
||||||
PTP packet structure: http://www.gphoto.org/doc/ptpip.php
|
|
||||||
and https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/PTPIP.TXT
|
|
||||||
PTP example implementation in JavaScript: https://github.com/feklee/ptp.js
|
|
||||||
PTP response codes: http://www.javased.com/?source_dir=cameraptp/src/main/java/ste/ptp/Response.java
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# PTP/IP abstract: http://www.cipa.jp/ptp-ip/index_e.html
|
||||||
|
# PTP packet structure: http://www.gphoto.org/doc/ptpip.php
|
||||||
|
# and https://github.com/gphoto/libgphoto2/blob/master/camlibs/ptp2/PTPIP.TXT
|
||||||
|
# PTP example implementation in JavaScript: https://github.com/feklee/ptp.js
|
||||||
|
# PTP response codes: http://www.javased.com/?source_dir=cameraptp/src/main/java/ste/ptp/Response.java
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import socket
|
import socket
|
||||||
import struct
|
import struct
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Install with: micropython -m upip install -r requirements.txt
|
micropython-json
|
||||||
micropython-os
|
micropython-os
|
||||||
micropython-re-pcre
|
micropython-re-pcre
|
||||||
micropython-socket
|
micropython-socket
|
||||||
|
Loading…
x
Reference in New Issue
Block a user