iicsys / pypmu

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

Trouble reading from PMU #11

Closed matevzv closed 5 years ago

matevzv commented 5 years ago

Hello,

I am trying to use tinyPDC.py to read data from PMU. I've tested the PMU with PMU Connection Tester and everything works as it should. However, tinyPDC seems to have trouble reading the header message from PMU. Please find attached the pcap file.

tinyPDC-PMU.zip

tinyPDC concole output:

2019-05-09 11:33:23,984 INFO [1] - PDC successfully connected to PMU (89.212.126.91:44713) 2019-05-09 11:33:23,984 INFO [1] - Requesting to stop sending from PMU (89.212.126.91:44713) 2019-05-09 11:33:23,985 INFO [1] - Requesting header message from PMU (89.212.126.91:44713) 2019-05-09 11:33:23,989 WARNING [1] - Received unknown message from PMU (89.212.126.91:44713) Traceback (most recent call last): File "examples/tinyPDC.py", line 20, in header = pdc.get_header() # Get header message from PMU File "/usr/local/lib/python3.6/dist-packages/synchrophasor/pdc.py", line 90, in get_header raise PdcError("Invalid Header message received") synchrophasor.pdc.PdcError: Invalid Header message received

Thank you.

sstevan commented 5 years ago

Hey @matevzv,

You can try to decode raw bytes into a Header frame and see what is wrong. Best way to do it is inside the validate_frames.py script. Just add these two lines at the end

header_bytes = binascii.unhexlify("aa11001a00000000000000000000504d552056455220312e0c5f")
header_frame = HeaderFrame.convert2frame(header_bytes)

This is what PMU sent as header message aa11001a00000000000000000000504d552056455220312e0c5f. You will notice that the first issue is PMU ID which is zero (0x0000). So I guess some additional configuration on the PMU side is required.

Please note that we are having a few unresolved issues that will cause trouble with data (frequency) interpretation.