Weird TCP comms issue
regallion
Posts: 95
Hi guys,
Have any of you come across strange TCP/IP issues like this?
I have a very simple test app that sends pings to a media server (DFS Base). The player should receive these ping requests and respond.
My AMX controller, however, only picks up the responses rarely. If it receives the response, it will continue to receive the responses for the duration of the program run. If I re-run the app and it doesn't receive the response - it won't receive any for the duration of the program run.
I see the same issues with the company's own AMX driver as well.
I've run this test app (and their driver) on two separate AMX controllers to the same effect.
I've taken the AMX test code and converted it to Visual Basic and it runs 100% of the time.
I've taken this test code and converted it to run on a Cue controller and it runs 100% of the time.
I wrote an emulator in VB to respond to ping requests and the AMX test code works 100% of the time.
So what we have here is some bizarre issue between the media player and AMX controllers?! I've upgraded firmware to no avail.
I'm pulling my hair out here and grateful for any sources of inspiration!
For interest, here's the test AMX code:
Have any of you come across strange TCP/IP issues like this?
I have a very simple test app that sends pings to a media server (DFS Base). The player should receive these ping requests and respond.
My AMX controller, however, only picks up the responses rarely. If it receives the response, it will continue to receive the responses for the duration of the program run. If I re-run the app and it doesn't receive the response - it won't receive any for the duration of the program run.
I see the same issues with the company's own AMX driver as well.
I've run this test app (and their driver) on two separate AMX controllers to the same effect.
I've taken the AMX test code and converted it to Visual Basic and it runs 100% of the time.
I've taken this test code and converted it to run on a Cue controller and it runs 100% of the time.
I wrote an emulator in VB to respond to ping requests and the AMX test code works 100% of the time.
So what we have here is some bizarre issue between the media player and AMX controllers?! I've upgraded firmware to no avail.
I'm pulling my hair out here and grateful for any sources of inspiration!
For interest, here's the test AMX code:
PROGRAM_NAME='TestMain' DEFINE_DEVICE dvBaseIP1 = 00:03:00 DEFINE_VARIABLE VOLATILE CHAR rxBuffer[4096] VOLATILE INTEGER connected VOLATILE INTEGER count DEFINE_START // I've tried this both with CREATE_BUFFER and using data.text - both have same issue //CREATE_BUFFER dvBaseIP1, rxBuffer WAIT 50 IP_CLIENT_OPEN(dvBaseIP1.PORT, '192.168.67.33', 6002, IP_TCP) DEFINE_EVENT DATA_EVENT[dvBaseIP1] { ONLINE: { SEND_STRING 0:1:0, "'DATA_EVENT[ONLINE]:'" connected = 1 } OFFLINE: { SEND_STRING 0:1:0, "'DATA_EVENT[OFFLINE]:'" connected = 0 } STRING: { STACK_VAR CHAR rx[4096] rx = data.text //rxBuffer SEND_STRING 0:1:0, "'DATA_EVENT[STRING]: (', ITOA(LENGTH_ARRAY(rxBuffer)),') ', rx" //CLEAR_BUFFER rxBuffer } ONERROR: { SEND_STRING 0:1:0, "'DATA_EVENT[ONERROR]: ', ITOA(data.number)" } } DEFINE_PROGRAM if(connected) WAIT 50 { count++ if(count > 5) { IP_CLIENT_CLOSE(dvBaseIP1.PORT) SEND_STRING 0:1:0, "'Done'" } else { SEND_STRING 0:1:0, "'Ping: ', ITOA(count)" SEND_STRING dvBaseIP1, "'*[Ping][][][][][][][][][][][][]#', $0D,$0A" } }
0
Comments
If you look at the code closer, you'll see the LENGTH_ARRAY isn't actually doing anything.
I know the comms is working (code wise) as it does work sometimes.
I guess I'm asking if anyone has had similar issues before with firmware bugs or specific network cards in pcs or IP stack problems etc. There's a real odd niggly incompatibility with AMX controllers and this box and it's real pig tying it down.
I've had the developer of the media server look into it and he's putting some low level debug code onto my server to help find the issue.
I'll post if it's anything interesting!!
I've not actually seen issues like what you're describing, but a call into tech support probably wouldn't hurt.
Is this "Ping" a device specific command or are you actually trying to ping this IP device? Any time I've tried to ping a device I open a telnet session with the master via code and issue "ping URL".
Regardless I don't think I'd do this through define_start at all but use a button event to trigger the IP_CLIENT_OPEN so I can push it as many times as I like, when I like. Mainly cuz I'm too slow to catch it as the system comes online, especially with a short wait. With a longer wait I might stand a chance but typically if I open a socket from define_start I usually wait a few minutes to give the system time to settle down.
For testing I would just create a button_event and the use control device or emulate device to simulate a TP push.
And I've also tried putting the calling code behind a button event as well.
And I've done it within a timeline!
I distilled the test down to it's most simplest form here just to eliminate any other factors but believe me I've tried everything!!
I maintain there's something "odd" with this particular device and AMX controllers because I've duplicated the client code in Visual Basic and a Cue controller and it works fine. I've also duplicated the device with an emulator I wrote and ran on the my PC and the AMX client works fine.
It's infuriating!
EDIT: By the way I appreciate your time guys - keep the ideas coming!!!
That's all I can think of but maybe if you post what prints we could help some more.
Anyway the developer of the kit upgraded my server to their latest beta version and the problem went away.
You guys have given me food for thought though regarding the timing - for which I thank you all for your time!!