Skip to content
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

mitigate crashing && code refactor #22

Merged
merged 6 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,41 @@

# IDEA files
.idea/
cmake-build-*/

# Results for the checking of the Python coding style and static analysis
.mypy_cache
flake8_output.txt

# ESP-IDF default build directory name
build

# lock files for examples and components
dependencies.lock

# managed_components for examples
managed_components

# pytest log
pytest_embedded_log/
list_job*.txt
size_info*.txt
XUNIT_RESULT*.xml

# clang config (for LSP)
.clangd

# Vale
.vale/styles/*

# pio
.pio

# sqlite
*.db

.env

# vinscant
key.txt
webrepl_cli.py
3 changes: 1 addition & 2 deletions vinscant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ RST: 16
- connect to serial
- connect to wifi and setup webrepl (see https://docs.micropython.org/en/latest/esp8266/tutorial/repl.html)
- get `webrepl_cli.py` from https://github.com/micropython/webrepl
- copy `boot.py`, `main.py` and `key.txt` (with the correct key set on vingo) to the microcontroller using `upload_file.sh`
- download https://github.com/danjperron/micropython-mfrc522/blob/master/mfrc522.py and copy it to the microcontroller as well
- copy all the files in `mpfiles` and `key.txt` (with the correct key set on vingo) to the microcontroller using `upload_file.sh`
- beep boop

# Future additions
Expand Down
19 changes: 0 additions & 19 deletions vinscant/boot.py

This file was deleted.

1 change: 0 additions & 1 deletion vinscant/key.txt

This file was deleted.

143 changes: 0 additions & 143 deletions vinscant/main.py

This file was deleted.

29 changes: 29 additions & 0 deletions vinscant/mpfiles/boot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import gc
import machine
import network
import time
import webrepl

network.hostname("vinscant")
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
print("Connecting to WiFi...")
wlan.connect('Zeus WPI', 'zeusisdemax')
while not wlan.isconnected():
pass
print("Connected to WiFi with ifconfig:", wlan.ifconfig())

print("Starting webrepl...")
webrepl.start()
print("Webrepl started")

print("Heap bytes used before GC:", gc.mem_alloc())
gc.collect()
print("Heap bytes used after GC:", gc.mem_alloc())

print("Boot done")

print("Starting watchdog in 1s, interupt now with Ctrl+C")
time.sleep(1)
watchdog = machine.WDT(timeout=10 * 1000)
print("Watchdog started")
Empty file.
Loading