-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from tuftsceeo/dev/nick
Dev/nick
- Loading branch information
Showing
32 changed files
with
3,295 additions
and
344 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Open Terminal | ||
Type ls/dev/tty.* and hit enter | ||
find the serial port for your esp32c3 - most likely /dev/tty.usbmodem101 or similar | ||
Now cd yourself into the firmware folder | ||
and run the command below | ||
|
||
|
||
esptool.py -p /dev/tty.usbmodem101 -b 460800 --before default_reset --after hard_reset --chip esp32c3 --no-stub write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 bootloader/bootloader.bin 0x8000 partitiontable/partition-table.bin 0x10000 micropython.bin |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from machine import Pin | ||
import machine | ||
import gc | ||
gc.collect() | ||
|
||
import time | ||
|
||
print("Running pyscript networking tool") | ||
|
||
from networking import Networking | ||
|
||
#Network | ||
networking = Networking(True, True, True) | ||
peer_mac = b'\xff\xff\xff\xff\xff\xff' | ||
|
||
print(f"{(time.ticks_ms() - networking.inittime) / 1000:.3f} Name: {networking.name}, ID: {networking.id}, config: {networking.config}, Sta mac: {networking.sta.mac()}, Ap mac: {networking.ap.mac()}, Version: {networking.version_n}") | ||
|
||
lastPressed = 0 | ||
|
||
message="Boop!" | ||
|
||
def boop(pin): | ||
global lastPressed | ||
if(time.ticks_ms()-lastPressed>1000): | ||
lastPressed = time.ticks_ms() | ||
networking.aen.ping(peer_mac) | ||
networking.aen.echo(peer_mac, message) | ||
networking.aen.send(peer_mac, message) | ||
print(f"{(time.ticks_ms() - networking.inittime) / 1000:.3f} Networking Tool: Sent {message} to {peer_mac}") | ||
print(f"{(time.ticks_ms() - networking.inittime) / 1000:.3f} Networking Tool: RSSI table: {networking.aen.rssi()}") | ||
|
||
switch_select = Pin(9, Pin.IN, Pin.PULL_UP) | ||
|
||
#Buttons | ||
switch_select = Pin(9, Pin.IN, Pin.PULL_UP) | ||
switch_select.irq(trigger=Pin.IRQ_FALLING, handler=boop) | ||
|
||
def heartbeat(timer): | ||
print("") | ||
print(f"{(time.ticks_ms() - networking.inittime) / 1000:.3f} Networking Tool: {gc.mem_free()} bytes") | ||
print("") | ||
gc.collect() | ||
|
||
timer = machine.Timer(0) | ||
timer.init(period=5000, mode=machine.Timer.PERIODIC, callback=heartbeat) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from machine import Pin | ||
import machine | ||
import gc | ||
gc.collect() | ||
|
||
import network | ||
|
||
print("Running pyscript networking tool") | ||
|
||
sta = network.WLAN(network.STA_IF) | ||
ap = network.WLAN(network.AP_IF) | ||
sta.active(True) | ||
ap.active(True) | ||
sta.active(False) | ||
ap.active(False) | ||
|
||
from networking import Networking | ||
|
||
#Network | ||
networking = Networking(True, True, True, True) |
Oops, something went wrong.