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

Dev/nick #38

Merged
merged 3 commits into from
Dec 7, 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
Binary file modified software/.DS_Store
Binary file not shown.
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
Loading