iicsys / pypmu

pyPMU - Python implementation of the IEEE C37.118 synchrophasor standard
BSD 3-Clause "New" or "Revised" License
62 stars 46 forks source link

Received data with tinyPDC too long when receiving PMU data from another PC #38

Open Hofsmo opened 2 years ago

Hofsmo commented 2 years ago

Hi, I am having trouble hosting a PMU on one PC and sending it to tinyPDC on another PC.

I have a script that sends PMU data. I can receive this data using the example script tinyPDC.py, if I have the two scripts on the same PC. However, when I try to have the scripts on two different PCs it does not work anymore. After having received the first frame, the script stops.

To debug a bit I changed the get method of the Pdc class to print both the bytes received and the total frame size. It seems that in the first iteration in tinyPDC.py the get method works nicely. However, in the next iterations the get method receives 224 or 336 bytes, while the total frame size is 112. I managed to bypass this problem by splitting the received data into chunks of the total frame size. However, I am a bit confused why this problem happens, since it does not happen when the scripts are on the same pc. The PMU Connection Tester also manage to receive the data nicely.

Have anyone else experienced something similar and does my fix seem reasonable?