The Crow protocol is designed to allow a PC to control several microcontrollers using a single serial line. The protocol itself has a simple half-duplex, command/response format with basic error checking using Fletcher-16 checksums.
In Crow, the top-level software that generates commands is called a client. The client runs on the host, and it passes the command to a host implementation. The host implementation creates a command packet and sends it over the serial line. A device implementation receives the packet and then passes the command to a service running on that device. The service performs the command and may send a response, depending on the circumstances.
A command has the following properties:
A response has just one property, the payload, which is also 0-2047 bytes of binary data.
The specification can be found at https://github.com/chris-siedell/CrowStandard. As of April 2018 version 2 is in development. The specification for the CrowAdmin service can also be found at this page. The CrowAdmin service defines ping
, echo
, hostPresence
, getDeviceInfo
, getOpenPorts
, and getPortInfo
commands.
A Python 3 host implementation can be installed using "pip install crow-serial
". The source page is at
https://github.com/chris-siedell/PyCrow
and the Python Package Index page is at
https://pypi.org/project/crow-serial/.
A minimalist device implementation for the Parallax Propeller P8X32A can be found at
https://github.com/chris-siedell/PropCR.
PropCR allows only one open service port per instance (in addition to the CrowAdmin service using port 0).
Another caveat: PropCR uses non-standard byte ordering for its command payloads. The PyCrow (aka crow-serial)
host has a propcr_order
option that will take care of the necessary re-ordering.