Skip to content

Commit

Permalink
Merge pull request #24 from tuftsceeo/dev/nick
Browse files Browse the repository at this point in the history
Dev/nick
  • Loading branch information
NicK4rT authored Dec 4, 2024
2 parents b0aede2 + 740a3b8 commit 4ddd464
Show file tree
Hide file tree
Showing 32 changed files with 3,295 additions and 344 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added firmware/.DS_Store
Binary file not shown.
Binary file added firmware/ESP32_GENERIC_C3-20241129-v1.24.1.bin
Binary file not shown.
Binary file added firmware/bootloader/bootloader.bin
Binary file not shown.
8 changes: 8 additions & 0 deletions firmware/instruction.txt
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 added firmware/micropython.bin
Binary file not shown.
Binary file added firmware/partitiontable/partition-table.bin
Binary file not shown.
Binary file modified software/.DS_Store
Binary file not shown.
48 changes: 48 additions & 0 deletions software/archive/extended net code.py
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)



20 changes: 20 additions & 0 deletions software/archive/net code.py
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)
Loading

0 comments on commit 4ddd464

Please sign in to comment.