Python can be used to control an OSP chain, by sending commands to the command interpreted that is part of the firmware in the ESP32. This is still a proof-of-concept in an experimental phase.
The experiment in this directory consists of the following ingredients.
-
OSP32 board with the ESP32 flashed with the osplink.ino firmware.
-
An experimental Python library libosplink. It contains two modules:
cmdint.pyinteracts with the command interpreter in the ESP (sending and receiving strings over serial), and moduleosplink.pymakes the ESP commands available on high level in Python.For example the python function
osp_goactive(<addr>)in the Python liblibosplink.osplinkuses the Python liblibosplink.cmdintto send the string"osp send <addr> goactive"over serial. The command interpreter in the ESP would receive that string and call the C functionaoosp_tele_goactive(<addr>). -
A simple Python example excmdint. A Python program that sends plain command strings like
"echo Hello, world!"; thus only usinglibosplink.cmdint. -
A simple Python example exosplink. A Python program that calls high level functions like
osplink.osp_setpwmchn(0x001,0,0x3333,0x0000,0x0000); thus usinglibosplink.osplinkon top oflibosplink.cmdint.
Try one of the two examples
(end)
