From be42153ec4dfe08790ced087a1caa0ef3426261c Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 11 May 2024 13:32:51 -0600 Subject: [PATCH] Add mqtt websocket test page --- btproxy/main.py | 5 +++-- misc/test.html | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 misc/test.html diff --git a/btproxy/main.py b/btproxy/main.py index edf5379..1b201c0 100644 --- a/btproxy/main.py +++ b/btproxy/main.py @@ -32,9 +32,10 @@ async def read(connection, mqtt_client): if uart.in_waiting: res = uart.read(uart.in_waiting) data = res.decode().strip().split() - logging.info('Received data: %s', data) + nums = ','.join(data) + logging.info('Received data: %s', nums) - await mqtt_client.publish('test', payload=str(data)) + await mqtt_client.publish('test', payload=nums) async def main(): while True: diff --git a/misc/test.html b/misc/test.html new file mode 100644 index 0000000..0321594 --- /dev/null +++ b/misc/test.html @@ -0,0 +1,47 @@ + + + + + + Weboscoket MQTT + + + + Use WebSocket client to connect to MQTT server + +