Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Connection testing - first milestone (#90)
Browse files Browse the repository at this point in the history
We have a pet object and are sending events over the dispatcher. First
working thing.
Testet at monday
  • Loading branch information
moritzholzer authored May 30, 2024
2 parents 2af0ba7 + 62b4561 commit 57bcd26
Show file tree
Hide file tree
Showing 31 changed files with 12,936 additions and 210 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
"lv_event.h": "c",
"lv_group.h": "c",
"lv_hal_indev.h": "c"
"shell.h": "c",
"msg.h": "c"
},
"[shellscript][c][cpp]": {
"editor.tabSize": 4,
Expand Down
44 changes: 37 additions & 7 deletions node/code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BOARD = feather-nrf52840-sense

# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/RIOT
TEAMAGOTCHI_NODES_BASE = $(CURDIR)

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
Expand All @@ -19,8 +20,9 @@ FEATURES_REQUIRED += periph_gpio_irq
# Internal Modules
# Teamagotchi MODULES
#USEMODULE += lwm2m_handler
USEMODULE += io_handler
#USEMODULE += io_handler
USEMODULE += display_handler
USEMODULE += lwm2m_handler
EXTERNAL_MODULE_DIRS += modules

# External modules
Expand Down Expand Up @@ -50,18 +52,32 @@ CXXEXFLAGS += -std=c++20 -Wall -Wextra
# reverted in C++23 because it wasn't thought through
CXXEXFLAGS += -Wno-volatile


BOARD_BLACKLIST += native64

include $(RIOTBASE)/Makefile.include


## DEBUG
CFLAGS += -DDEBUG_ASSERT_VERBOSE
# Configure server via CFLAGS only if not done via Kconfig

##### LWM2M #####
LWM2M_SERVER_SHORT_ID ?= 1
CFLAGS += -DEVENT_THREAD_MEDIUM_STACKSIZE='(3*1024)'
# Uncomment to enable Wakaama debug log
#CFLAGS += -DCONFIG_LWM2M_WITH_LOGS=1
# Specific the server URI address (NOTE: Domain names not supported yet)
#LWM2M_SERVER_URI ?= '"coap://[2001:db8:1::1]:5683"'
LWM2M_SERVER_URI ?= '"coap://[fd00:dead:beef::1]:5683"'
# Configure via CFLAGS only if not done via Kconfig
ifndef CONFIG_LWM2M_SERVER_URI
CFLAGS += -DCONFIG_LWM2M_SERVER_URI=$(SERVER_URI)
CFLAGS += -DCONFIG_LWM2M_SERVER_URI=$(LWM2M_SERVER_URI)
CFLAGS += -DCONFIG_LWM2M_SERVER_SHORT_ID=$(LWM2M_SERVER_SHORT_ID)
CFLAGS += -DCONFIG_DTLS_PEER_MAX=2
CFLAGS += -DCONFIG_MAX_BUF=1024
# Uncomment to enable Wakaama debug log

endif
##### /LWM2M #####


include $(RIOTBASE)/Makefile.include


CFLAGS += -DDISPLAY_STACKSIZE=2*1024
Expand All @@ -76,3 +92,17 @@ else
endif


# Note that this will probably only work for me <3
windows: all
@echo "Creating UF2"
@python RIOT/dist/tools/uf2/uf2conv.py -f 0xADA52840 bin/feather-nrf52840-sense/teamagotchi.hex --base 0x1000 -c
@echo "Flashing UF2 via Windows (Make sure your device is actually at D)"
@powershell.exe -command "cp ./flash.uf2 d:/flash.uf2"
@echo "Connecting COM via USBIPD (Make sure you have the USBIPD installed + your device bound to the WSL)"
@sleep 3
@usbipd.exe attach --wsl -i 1209:7d00
@sleep 3
@echo "Connected :D"
@echo "Cleaning up uf2 flash file"
@rm flash.uf2

7 changes: 7 additions & 0 deletions node/code/dev/border_router/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BOARD ?= feather-nrf52840-sense
UPLINK ?= cdc-ecm
PREFIX_CONF ?= uhcpd
# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../../RIOT

include $(RIOTBASE)/examples/gnrc_border_router/Makefile
14 changes: 14 additions & 0 deletions node/code/dev/border_router/Makefile.cdc-ecm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# USB Modules
USEMODULE += auto_init_usbus
USEMODULE += usbus_cdc_ecm

ifeq (dhcpv6,$(PREFIX_CONF))
FLAGS_EXTRAS += --use-dhcpv6
else ifeq (auto_subnets,$(PREFIX_CONF))
FLAGS_EXTRAS += --use-radvd
endif

# Configure terminal parameters for UHCP
TERMDEPS += host-tools
TERMPROG ?= sudo sh $(RIOTTOOLS)/usb-cdc-ecm/start_network.sh
TERMFLAGS ?= $(FLAGS_EXTRAS) $(IPV6_PREFIX) $(PORT)
10 changes: 10 additions & 0 deletions node/code/dev/border_router/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- Build the border router
- flash the border router
- connect the dongle to the VM or linux machine

- start start.sh there with whole project cloned as root


it will:
- set ub the usb network card of the border router
- set an dummy network adapter with the ip of the coap server
Binary file not shown.
Loading

0 comments on commit 57bcd26

Please sign in to comment.