We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bonjour , test with unix port on local machine but it is very slow. With ESP32 it's fast. One trick ? thank's for help
The text was updated successfully, but these errors were encountered:
Salut, I'm sorry, I don't know much about the unix port, i dont use it. I use python websockets based server on unix to interface. Something like
websockets
import pathlib import logging import asyncio from collections import defaultdict import json import websockets devices = {} pages = defaultdict(set) async def add_page(websocket, path): print(f"Page connected to {path}") pages[path].add(websocket) try: async for msg in websocket: if path in devices: await devices[path].send(msg) finally: pages[path].remove(websocket) print("Page Left") async def add_device(websocket, path): print(f"Device connected: {path}") if path in devices: ws = devices.pop(path) await ws.close() devices[path] = websocket try: async for msg in websocket: logging.info(path + "/" + msg) if len(pages[path]) > 0: asyncio.gather(*[pg.send(msg) for pg in pages[path]]) finally: if path in devices: devices.pop(path) await websocket.close() page_server = websockets.serve(add_page, '127.0.0.1', 7770, compression=None, ping_interval=None, ping_timeout=None) device_server = websockets.serve(add_device, '0.0.0.0', 7777, compression=None, ping_interval=None, ping_timeout=None) if __name__ == "__main__": logging.basicConfig(filename="stuff.log", format='%(asctime)s %(message)s', level=logging.INFO) loop = asyncio.get_event_loop() loop.run_until_complete(device_server) loop.run_until_complete(page_server) loop.run_forever()
Sorry, something went wrong.
No branches or pull requests
Bonjour ,
test with unix port on local machine but it is very slow.
With ESP32 it's fast.
One trick ?
thank's for help
The text was updated successfully, but these errors were encountered: