From b5b6fec019d43b4cbc492c3db4d798a81259dcf3 Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Tue, 12 May 2020 12:24:13 -0700 Subject: [PATCH] Fix Python2/3 Errors --- tools/rpc/README.md | 4 ++++ tools/rpc/rpc.py | 4 +++- .../rpc/rpc_image_transfer_jpg_as_the_controller_device.py | 6 +++++- ...image_transfer_jpg_streaming_as_the_controller_device.py | 6 +++++- ...rpc_popular_features_as_the_controller_device_example.py | 6 +++++- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/tools/rpc/README.md b/tools/rpc/README.md index 6275c645a..ddf5de683 100644 --- a/tools/rpc/README.md +++ b/tools/rpc/README.md @@ -10,6 +10,10 @@ The OpenMV Cam `rpc` library on the computer only depends on [pyserial](https:// pip install pyserial +However, the examples depend on [pygame](https://www.pygame.org/news) so you need to install pygame too: + + pip install pygame + Because the interface library is implemented in pure python with no external dependencies it works on Windows, Mac, and Linux. # How to use the Library diff --git a/tools/rpc/rpc.py b/tools/rpc/rpc.py index 9ab5d57a1..1c167d85d 100644 --- a/tools/rpc/rpc.py +++ b/tools/rpc/rpc.py @@ -60,7 +60,9 @@ class rpc: def _set_packet(self, magic_value, payload=bytes()): # private new_payload = bytearray(len(payload) + 4) new_payload[:2] = struct.pack("