jamesbowman / i2cdriver

I2CDriver open source tools
https://i2cdriver.com/
BSD 3-Clause "New" or "Revised" License
187 stars 57 forks source link

Capture Mode #13

Closed brotherdust closed 5 years ago

brotherdust commented 5 years ago

Hi! THANK YOU for making this device! It's so useful!

While looking through the documentation, I noticed there's a stub header for "Capture Mode", but nothing below it. Are there any plans for a capture mode to be supported? If so, when? I'd like to contribute to your project where I can, so I'd be happy to write up the documentation for this feature once it's available.

Thanks!

simon-rob commented 5 years ago

+1 I twas hoping capture mode would allow capturing of I2C frames as monitor mode seems only to show the current frame on the display which is limited in use when debugging. (due to the small screen)

jamesbowman commented 5 years ago

Hi all, yes, really sorry this isn't done yet. It's coming today.

simon-rob commented 5 years ago

Great, looking forward to giving it ago.

jamesbowman commented 5 years ago

Capture to file is implemented in the new release 0.0.5.

https://i2cdriver.com/windows

It's documented on p.18 of the user guide:

https://i2cdriver.com/i2cdriver.pdf

Note that there's no live graphical display at the yet, but the command-line version does print all the traffic as it arrives.

simon-rob commented 5 years ago

James,

I am using Python 2.7 and I get the follow error when trying to capture: File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "i2cgui.py", line 48, in capture_thr c = sd.capture_start(True) TypeError: capture_start() takes exactly 1 argument (2 given)

If I remove from capture_start() I then get: File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "i2cgui.py", line 52, in capture_thr for token in c(): File "build/bdist.linux-x86_64/egg/i2cdriver.py", line 261, in parser for n in nstream(): File "build/bdist.linux-x86_64/egg/i2cdriver.py", line 258, in nstream yield (b >> 4) & 0xf TypeError: unsupported operand type(s) for >>: 'str' and 'int'

I see that i2cdriver.py has support for PYTHON2, but i guess some of the new capture code needs adapting! (I did have a go, but it kept giving the same error on 258 to my surprise)

Simon

jamesbowman commented 5 years ago

@simon-rob I think you might be running the latest gui with an old i2cdriver. Did you do

pip install -U i2cdriver

(or similar) before running the GUI?

simon-rob commented 5 years ago

James,

I have run python2 setup.py install I also tried pip install -U i2driver

but I still get:

File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "i2cgui.py", line 47, in capture_thr c = sd.capture_start(True) TypeError: capture_start() takes exactly 1 argument (2 given)

jamesbowman commented 5 years ago

That definitely looks like a version mismatch because capture_start's signature changed in 0.0.5.

If I do:

$ python2
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import i2cdriver
>>> i2cdriver.__version__
'0.0.5'

do you get the same version 0.0.5?

simon-rob commented 5 years ago

James,

No, I get version 0.0.4.

I have uninstalled the i2cdriver using pip uninstall i2driver and then reinstalled it again..

Now no error and the correct version 0.0.5.

Thanks for you help,

Simon