Skip to content

Commit

Permalink
Merge pull request #38 from tuftsceeo/dev/nick
Browse files Browse the repository at this point in the history
Dev/nick
  • Loading branch information
NicK4rT authored Dec 7, 2024
2 parents 6b485f6 + 9a70f29 commit 7d121aa
Show file tree
Hide file tree
Showing 16 changed files with 627 additions and 539 deletions.
Binary file modified software/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion software/main/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions software/main/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions software/main/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions software/main/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
sta.active(False)
ap.active(False)

from networking import Networking
from ssp_networking import SSP_Networking

#Network
infmsg = False
Expand All @@ -27,11 +27,12 @@
if configuration == "AM1":
infmsg = True

networking = Networking(infmsg, dbgmsg, errmsg)
networking = SSP_Networking(infmsg, dbgmsg, errmsg)

peer_mac = b'\xff\xff\xff\xff\xff\xff'

import time
global timer

print("{:.3f} Name: {}, ID: {}, Configuration: {}, Sta mac: {}, Ap mac: {}, Version: {}".format(
(time.ticks_ms() - networking.inittime) / 1000,
Expand Down Expand Up @@ -73,5 +74,8 @@ def heartbeat(timer):

def deinit():
networking.cleanup()
timer.deinit()
try:
timer.deinit()
except Exception as e:
print(e)
machine.reset()
11 changes: 8 additions & 3 deletions software/main/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
sta.active(False)
ap.active(False)

from networking import Networking
from ssp_networking import SSP_Networking

#Network
infmsg = False
Expand All @@ -27,11 +27,12 @@
if configuration == "AM1":
infmsg = True

networking = Networking(infmsg, dbgmsg, errmsg)
networking = SSP_Networking(infmsg, dbgmsg, errmsg)

peer_mac = b'\xff\xff\xff\xff\xff\xff'

import time
global timer

print("{:.3f} Name: {}, ID: {}, Configuration: {}, Sta mac: {}, Ap mac: {}, Version: {}".format(
(time.ticks_ms() - networking.inittime) / 1000,
Expand All @@ -43,6 +44,7 @@
networking.config["version"]
))


def idle():
lastPressed = 0

Expand Down Expand Up @@ -73,7 +75,10 @@ def heartbeat(timer):

def deinit():
networking.cleanup()
timer.deinit()
try:
timer.deinit()
except Exception as e:
print(e)
machine.reset()

def run_config_module(module_name):
Expand Down
Binary file modified software/networking/.DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion software/networking/README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ A short description of the directories can be found below.
| examples | This directory hosts example code | Nick |
| examples/example.py | This is some basic example code on how to use my networking library | Nick |
| examples/long_message_example.py | This code showcases the long message capabilities built into my code. By sending multiple messages that are then stitched back together by the recipient the max payload can be increased from 241 bytes to 256 x 238 = 60928 bytes, although in reality the ESP32 boards will start running out of memory with messages above 30 kilobytes. | Nick |
| networking.py | This is the main networking code that builds on ESP-NOW. There are many prepared functionalities (and some more that I am working on), such as long message support, sending of various variable types (bytes, bytearray, dicts, lists, int, float, char, string), as well as different types of messages such as ping, echo and more. There are also various features in place to make the networking more robust. It needs config.py to function. | Nick |
| networking.py | This is the main networking code that builds on ESP-NOW. There are many prepared functionalities (and some more that I am working on), such as long message support, sending of various variable types (bytes, bytearray, dicts, lists, int, float, char, string), as well as different types of messages such as ping, echo and more. There are also various features in place to make the networking more robust. | Nick |
| ssp_networking.py | This is the SSP networking code that builds on the above networking.py. This adds even more functionality on top (many more commands) and customises certain use for the Smart Systems Platform. Needs a config.py to properly work. | Nick |
Binary file modified software/networking/examples/.DS_Store
Binary file not shown.
Loading

0 comments on commit 7d121aa

Please sign in to comment.