Terrabits / rohdeschwarz

Rohde & Schwarz python instrument control toolbox
https://vna.rs-us.net/python/
Other
37 stars 18 forks source link

Vna and open_tcp (TcpBus): Sending large amounts of data (i.e. VnaFileSystem::upload_file) causes VNA to crash #6

Closed Terrabits closed 8 years ago

Terrabits commented 8 years ago

Reported by: Vincent Lim @ Google

The method Vna.file.upload_file does not work, and in fact crashes the Vna, when sending a large file and connected via direct tcp socket.

The crashing behavior is not consistent; it seems to depend on the operating system and/or version of Python that you are using (was observed in Ubuntu 14.04 with Python 2.7.6).

Terrabits commented 8 years ago

The TcpBus class uses a python socket to communicate to the VNA. Unfortunately, I was using the socket.send method where I was expecting a socket.sendall-like behavior. So the send would sometimes not complete, but I would not handle this case and the firmware would eventually disconnect and crash.

There is a fix in rohdeschwarz 0.6.2dev1: I replaced socket.send with socket.sendall. Now everything works.