-
Notifications
You must be signed in to change notification settings - Fork 1
ZeroMQ API
Nandan Tumu edited this page Aug 20, 2021
·
5 revisions
cea-os has a ZeroMQ API. It uses json serialized messages for compatibility across platforms. Over time, this API will be the preferred method for communication between external networked sensors/actuators and cea-os. You can use this API to:
- Get sensor values
- Set actuator positions
- Get a list of sensors and actuators in the farm
- Update sensor values
ZeroMQ communicates in raw bytes, so keeping our messages structured and simple is key. We'll use JSON as our standard communication format, and python native serialization and de-serialization to keep ourselves sane. Using protobuf is an option in the future for greater communication efficiency (and potential microcontroller support).
{
"cea-addr": "farm.env1.air_con", # This is the address within the farm to get to the desired target object
"action": "set_point", # This is the method of the object we are targeting
"payload": [23,'C'] # Arguments to give the method
}