summaryrefslogtreecommitdiff
path: root/fw/prj.conf
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-03-21 22:33:41 +0100
committerxengineering <me@xengineering.eu>2025-03-21 22:33:41 +0100
commite042129eddeb06c9272a6544c67f9222c347ab10 (patch)
tree6fdd4e337485ef08961d3145479621ffd4a53184 /fw/prj.conf
parent58e8dd56e233f482dc0dbe0cb8f56ef3bab7b998 (diff)
downloadiot-contact-e042129eddeb06c9272a6544c67f9222c347ab10.tar
iot-contact-e042129eddeb06c9272a6544c67f9222c347ab10.tar.zst
iot-contact-e042129eddeb06c9272a6544c67f9222c347ab10.zip
fw: ws: Add WebSocket interface
The primary interface for this firmware was so far HTTP. This protocol is not suitable for small and bidirectional messages which are time-critical. If something like this needs to be implemented with HTTP the best approach is likely long-polling which at least makes it possible for the server / the firmware to send data to the client / user as reaction to an event like a closed door sensor. TCP would fix this issue and is a good choice. Nevertheless web clients are not allowed to open TCP connections for security purposes. Thus the WebSocket protocol was created to fill this gap. To not duplicate the any effort the WebSocket API should be used for small, time-critical messages for all clients (one with TCP support like CLI tools as well as web clients). HTTP is still kept to provide a web page but also for functionality where HTTP is more suitable like firmware uploads.
Diffstat (limited to 'fw/prj.conf')
-rw-r--r--fw/prj.conf4
1 files changed, 4 insertions, 0 deletions
diff --git a/fw/prj.conf b/fw/prj.conf
index 7984caa..ac120b9 100644
--- a/fw/prj.conf
+++ b/fw/prj.conf
@@ -24,11 +24,15 @@ CONFIG_HTTP_PARSER=y
CONFIG_HTTP_PARSER_URL=y
CONFIG_HTTP_SERVER=y
+CONFIG_HTTP_SERVER_WEBSOCKET=y
CONFIG_FILE_SYSTEM=y
CONFIG_EVENTFD=y
+CONFIG_ZVFS_OPEN_MAX=32
+CONFIG_ZVFS_POLL_MAX=32
+
CONFIG_ZBUS=y
CONFIG_ZBUS_MSG_SUBSCRIBER=y
CONFIG_HEAP_MEM_POOL_SIZE=2048