From 2784261e7b83b9549c5e2ba0913303d695493456 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 8 Nov 2022 16:20:55 +0100 Subject: project scaffolding and architecture draft in readme --- .gitignore | 3 +++ assets/fig-architecture.svg | 3 +++ bts/main.c | 7 +++++++ bts/makefile | 24 ++++++++++++++++++++++++ fig.drawio | 1 + nrf528xx/main.c | 0 nrf528xx/makefile | 24 ++++++++++++++++++++++++ nrf528xx/readme.md | 4 ++++ readme.md | 37 ++++++++++++++++++++++++++++++++++++- shared/consts.h | 1 + 10 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 assets/fig-architecture.svg create mode 100644 bts/main.c create mode 100644 bts/makefile create mode 100644 fig.drawio create mode 100644 nrf528xx/main.c create mode 100644 nrf528xx/makefile create mode 100644 nrf528xx/readme.md create mode 100644 shared/consts.h diff --git a/.gitignore b/.gitignore index fda6d56..2806e96 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,10 @@ **/.cache **/compile_commands.json **/.DS_Store +**/.$* copyright/ temp/ +# bts +bts/bts diff --git a/assets/fig-architecture.svg b/assets/fig-architecture.svg new file mode 100644 index 0000000..7196dd8 --- /dev/null +++ b/assets/fig-architecture.svg @@ -0,0 +1,3 @@ + + +
bluetooth mesh network
bluetooth mesh network
bluetooth
bluetooth
node
node
bluetooth
bluetooth
node
node
desktop computer
(on ip network)
desktop computer...
usb power source (no data)
usb power source (...
usb power source (no data)
usb power source (...
Border Transport Server
Border Transport Serv...
USB serial
USB serial
node (as border router)
node (as border router)
light
light
button
button
nRF528xx
nRF528xx
usb controller
usb controller
serial port communication
serial port commun...
TCP socket
TCP socket
TCP socket API
TCP socket API
Configuration UI / Action handler server

(Home Assistant or custom HTML/QT GUI)
Configuration UI / Ac...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/bts/main.c b/bts/main.c new file mode 100644 index 0000000..1be969b --- /dev/null +++ b/bts/main.c @@ -0,0 +1,7 @@ +#include + +int main() { + printf("hello world!\n"); + + return 0; +} diff --git a/bts/makefile b/bts/makefile new file mode 100644 index 0000000..e646524 --- /dev/null +++ b/bts/makefile @@ -0,0 +1,24 @@ +CC = gcc +LD = gcc +RM = rm -f +CFLAGS = +LFLAGS = +TARGET = bts + +SRCS := $(wildcard *.c) +OBJS := $(patsubst %.c,%.o, $(SRCS)) + +all: $(TARGET) + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +$(TARGET): $(OBJS) + $(LD) $^ $(LFLAGS) -o $@ + +clean: + $(RM) $(TARGET) $(OBJS) + +compile_commands: clean + compiledb make + diff --git a/fig.drawio b/fig.drawio new file mode 100644 index 0000000..be88a39 --- /dev/null +++ b/fig.drawio @@ -0,0 +1 @@ +3VrbcqM4EP0aV2UfNgXI18f4kkmqMjXZcVI7eZRBsTWRkUuI2N6v3xYIY5CNb9g444dEahohdZ8+ajXUUG+6+CbwbPKde4TVHMtb1FC/5jhty4a/SrCMBfVOPRaMBfVikZ0KhvQ/ooWWlobUI0FGUXLOJJ1lhS73feLKjAwLwedZtXfOsk+d4TExBEMXM1P6L/XkRC+rYaXyB0LHk+TJtqWvTHGirAXBBHt8viZCgxrqCc5l3JoueoQp2yV2ie+733J1NTFBfLnPDbNO6/fbbPA4cBsjMf/xSn4O5N92Ox7mE7NQr3gELTAxzB4WQQL1zydyzsWHXodcJsYRPPQ9osa3aqg7n1BJhjPsqqtzQAPIJnLKoGdDEzM69qHNyDvMt8vwiLBnHlBJuRK7sAwi4MInEZKCA55yCiMuJZ+uKdzpASVXT3qnjPU44zBE3+c+zKEbSME/SCKsOciKfnCFwyypVJBsqa62AYxLFluta698BlgnfEqkWILKIovXZbY7TzGDEtlkDS8oARLWOB2vRk5dCQ3tzQM8myxhzV3EA2jrLhdywsfcx2yQSrtZh6Y6T1zZOHLjbyLlUscpDiXPOhmsJZa/9P1R5011bhtJt79Yv9hfrnrenYrW1Hkguadqyf3UQ2oBxf6B9fJQuKTAME3NIliMiSwyoLXZ4YIwLOlndiKluw+1igKzCscWO4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528xx/main.c b/nrf528xx/main.c new file mode 100644 index 0000000..e69de29 diff --git a/nrf528xx/makefile b/nrf528xx/makefile new file mode 100644 index 0000000..78d52e2 --- /dev/null +++ b/nrf528xx/makefile @@ -0,0 +1,24 @@ +CC = gcc +LD = gcc +RM = rm -f +CFLAGS = +LFLAGS = +TARGET = main + +SRCS := $(wildcard *.c) +OBJS := $(patsubst %.c,%.o, $(SRCS)) + +all: $(TARGET) + +%.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ + +$(TARGET): $(OBJS) + $(LD) $^ $(LFLAGS) -o $@ + +clean: + $(RM) $(TARGET) $(OBJS) + +compile_commands: clean + compiledb make + diff --git a/nrf528xx/readme.md b/nrf528xx/readme.md new file mode 100644 index 0000000..fcebcf8 --- /dev/null +++ b/nrf528xx/readme.md @@ -0,0 +1,4 @@ +# nrf528xx subdirectory + +- compatible with nrf52833 and nrf52840 +- make for compiling and building diff --git a/readme.md b/readme.md index da1e752..2e360fe 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,38 @@ # project domotica -het is er weer een hoor +still WIP + +## terminology + +|verb/acronym|description| +|-|-| +|dongle|USB stick with a nRF52833 or nRF52840 module| +|bts|Border Transport Server| +|node|A dongle running in node mode| +|border router|A dongle running in border router mode| + +## architecture + +
+ +
+ +Above is a draft version of the system architecture. + +- Each node runs the same firmware, and is capable of being a border router. +- Each dongle starts in "node mode" by default, and only turns into border + router mode once it receives a special command over the USB serial bus. +- A node can turn into a border router, but will still keep functioning as a + normal node as well. +- All blocks in the desktop computer zone can be run on different computers + over the network. +- The BTS creates a TCP socket which sends data to the client on incoming + events from the mesh network, and broadcasts any data received from the + client back to the mesh network. +- The configuration UI / action handler server sends and receives events + to/from the TCP socket API, and will decide which actions should be taken for + each event. +- The protocol used for communicating between network nodes is preferably in a + binary format to save on bandwidth. +- The protocol used by the TCP socket API is text-based, as it's used to + communicate between userspace services on desktop computers. diff --git a/shared/consts.h b/shared/consts.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/shared/consts.h @@ -0,0 +1 @@ +#pragma once -- cgit v1.2.3