Micropython-osc (aka uosc) is a minimal Open Sound Control (OSC) client and server library for MicroPython and CPython 2 or 3.
https://github.com/SpotlightKid/micropython-osc
Status / Supported Boards
It should work on the Unix, stmhal (Pyboard) and esp8266 port of MicroPython and under CPython 2.7 and 3.3+. Since OSC is a network-protocol using UDP or TCP as a transport, the main requirement is a working and compatible socket module. Currently this module only supports UDP as the transport.
The server code so far has only been tested under the Unix port and CPython 2 and 3, but the client portion has been confirmed to work on a ESP-8266 board running MicroPython 1.8.x.
(NB: I've been sitting on this code for rather a while now and have tested it quite thoroughly under the unix port and CPython, but until recently I didn't have a MicroPython board with a network device to test it with. Today I took some time to try it out on a ESP-8266 board, added some workarounds for a few library incompatibilities and are now happy to report that the client seems to work quite well.)
Usage
Here's a minmal usage example for the client. Further documentation is currently only available by looking at the docstrings and the source code (the whole package has a total LLOC of < 400).
Code: Select all
from uosc.client import Bundle, Client, create_message
osc = Client('192.168.4.2', 9001)
osc.send('/controls/frobnicator', 42, 3.1419, "spamm")
b = Bundle()
b.add(create_message("/foo", bar))
b.add(create_message("/spamm", 12345))
osc.send(b)