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

PDC stuck on requesting header message #44

Open MauritsMolberg opened 5 months ago

MauritsMolberg commented 5 months ago

I know this issue has been brought up in other threads, but they have been regarding PMU data sent by other programs, and no solution has been found.

I am trying to send PMU data from one of the example PMU scripts to tinyPDC, and tinyPDC never moves on from requesting PMU header. This is printed from tinyPMU:

2024-01-23 18:25:55,261 INFO [7734] - PMU configuration changed.
2024-01-23 18:25:55,261 INFO [7734] - PMU header changed.
2024-01-23 18:25:55,261 INFO [7734] - Waiting for connection on 192.168.0.6:1410
2024-01-23 18:26:03,771 INFO [7734] - Waiting for connection on 192.168.0.6:1410
2024-01-23 18:26:04,512 INFO [7734] - Connection from 192.168.0.6:61719
2024-01-23 18:26:04,512 WARNING [7734] - Received unknown message <- (192.168.0.6:61719)

and this is printed from tinyPDC:

2024-01-23 18:25:57,979 INFO [7] - PDC successfully connected to PMU (192.168.0.6:1410)
2024-01-23 18:25:57,979 INFO [7] - Requesting header message from PMU (192.168.0.6:1410)

The result is the same when any of the three PMU scripts is sending, and when the scripts are both running on a single computer and on two different computers. If I comment out the header = pdc.get_header() line, the same issue happens when requesting config frame.

Through debugging I've found that the program gets stuck when running the socket.recv() function in the get() function on line 129 of pdc.py. bilde

The "Received unknown message" warning always appears after the PDC has requested something, so could there be an issue with the command frame? Or am I doing something wrong?

sstevan commented 4 months ago

Hello @MauritsMolberg, I have just checked, tinyPDC and tinyPMU should work on the same host immediately, out of the box. Please see below.

Screenshot 2024-02-15 at 14 42 14

Maybe you should print/debug bytes coming from tinyPDC, maybe a type of the frame is not correctly recognized.

MauritsMolberg commented 4 months ago

Hi, and thanks for the reply.

That is very strange. I get the same results as in the original post when running the scrips out of the box, and it is the same when I run it on another machine or try to send data between machines.

I unfortunately do not have the time or skills to debug using the bytes in the frames, but I was able to get it to work using this fork, which is good enough for my project. You could take a look there if you are interested in seeing what the differences that make it work could be.