Skip to content

Instantly share code, notes, and snippets.

@mattshirtliffe
Created September 1, 2019 18:43
Show Gist options
  • Select an option

  • Save mattshirtliffe/a90ea0afe94a9413d04a2ccbdb5b74c7 to your computer and use it in GitHub Desktop.

Select an option

Save mattshirtliffe/a90ea0afe94a9413d04a2ccbdb5b74c7 to your computer and use it in GitHub Desktop.
getting spi data from zmq
import sys
import zmq
# Socket to talk to server
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect("tcp://localhost:5556")
socket.setsockopt_string(zmq.SUBSCRIBE, 'SPI')
while True:
string = socket.recv_string()
print(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment