I have a lot of boards and usually need to re-use code even for different projects.
cube c32b562c9d Update 'CARDPUTER CircuitPython/projects/udp_socket_chat/code.py' 1 mēnesi atpakaļ
..
client.py Upload files to 'CARDPUTER CircuitPython/projects/udp_socket_chat' 1 mēnesi atpakaļ
code.py Update 'CARDPUTER CircuitPython/projects/udp_socket_chat/code.py' 1 mēnesi atpakaļ
readme.md Add 'CARDPUTER CircuitPython/projects/udp_socket_chat/readme.md' 1 mēnesi atpakaļ
server.py Upload files to 'CARDPUTER CircuitPython/projects/udp_socket_chat' 1 mēnesi atpakaļ

readme.md

features

  • uses wifi switcher - be sure to set up the list + settings.toml appropriately
  • automatically tries to "connect" to cubes.link:1337 - server.py
  • uses asyncio to swap between checking for keypresses and checking for incoming messages, typing is seamless and incoming messages aren't missed waiting for key presses
  • udp so there is no connection, and no regard for whether packets actually arrive. this is by design since it simplifies things
  • check out server.py and client.py for compatible CLI programs. server.py should be ran on cubes.link server (or adjust internal ip addresses in the code.py and client.py) and client.py can be ran on any machine that supports python files

notes

  • the keyb.py lib was updated for this project, be sure to grab the new one
  • since the serial read that is used in keyboard scanning needs to be handled by the program so it can be dropped if nothing is detected in half a second, pass to checking for messages, then come back again - keyb.py now accepts a key code in kwargs