elephantrobotics / pymycobot

This is a python API for ElephantRobotics product.
MIT License
107 stars 54 forks source link

version() returns an empty list #30

Closed 3110 closed 2 years ago

3110 commented 2 years ago

Describe the bug version() returns an empty list.

To Reproduce

$ ipython
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec  6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.30.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from pymycobot import MyCobot

In [2]: mc = MyCobot("COM13", debug=True)

In [3]: mc.version()
03:03:51.402 DEBU [pymycobot.generate] _write: [254, 254, 2, 0, 250]
03:03:51.473 DEBU [pymycobot.generate] _read: no data can be read
Out[3]: []

Expected behavior

The VERSION in common.py should be 0x01, not 0x00. If you change VERSION to 0x01, version() returns the wrong reply [1] for myCobot. It should be 1 for myCobot.

In [1]: from pymycobot import MyCobot

In [2]: mc = MyCobot("COM13", debug=True)

In [3]: mc.version()
03:19:13.736 DEBU [pymycobot.generate] _write: [254, 254, 2, 1, 250]
03:19:13.798 DEBU [pymycobot.generate] _read: b'\xfe\xfe\x03\x01\x01\xfa'
Out[3]: 1

Desktop (please complete the following information):

3110 commented 2 years ago

Confirmed to merge #31