-
AuthorPosts
-
AnonymousInactiveJune 21, 2008 at 10:11 pmPost count: 23
Paul:
To be more correct, it’s “RESTART” rather than “RESET” that I do, and then the Java code won’t get a response until after I run the Utility Suite connect/disconnect.
grif091:
I tried moving the BufferedReader creation to before the println (that sends the request). No change.
David
AnonymousInactiveJune 22, 2008 at 12:58 amPost count: 1001I found that the SHN Utility creates a separate thread for reading from EZSrve, before it writes the GetRevision string. This thread handles all input from EZSrve. Not suggesting this is a requirement, just passing on the differences. Except for the obvious of one being VB and the other Java, I don’t see anything other than the GetRevision command being written to EZSrve. In response to requests from the various GUI objects, commands for listing macros or timers, for example are written but that is far into the Utility logic.
Perhaps reading a full line (readline ?) rather than a single byte would work better. Really just grabbing at straws. My Java books are at a different house so I am doing this from a distant memory.
AnonymousInactiveJune 22, 2008 at 1:57 amPost count: 408Here is another try. If this doesn’t work, send me an email, hopefully with an IP address and if you can open port 8002 for a time. I have tried this code below on several security setups, and it should work fine.
try {
Socket EZSrveSocket = new Socket("192.168.0.107", 8002);
PrintStream out = new PrintStream(EZSrveSocket.getOutputStream());
DataInputStream in = new DataInputStream( EZSrveSocket.getInputStream());
out.print("GetRevision");
long endTime = System.currentTimeMillis()+5000;
System.out.println("Received:");
while (System.currentTimeMillis()<endTime) {
System.out.println(in.readLine()); // Read one line and output it
}
in.close();
}
catch(Exception e) {
System.out.println("Failure:" + e);
}
AnonymousInactiveJune 23, 2008 at 2:12 amPost count: 23Yes, that last one works, even immediately after a RESTART (without having to use the Utility Suite first). It does produce a deprecation warning at compile time, but it’s a huge step in the right direction. Now to figure out what the real difference is..
David
AnonymousInactiveJune 23, 2008 at 2:25 amPost count: 408Beyond just cleaning up an element or two, the only real substantive difference is the use of DataInputStream. To make sure that is the change, alter the code back to BufferedReader and see if the problem returns.
AnonymousInactiveJune 23, 2008 at 2:56 pmPost count: 23Paul:
I’ve concluded that using DataInputStream vs. BufferedReader makes no difference.
What DOES make a difference is the case of the “C” in Command (vs. command).
Specifically, if after a restart of my EZSrve, I send:
GetRevision
it works every time.
If, after a restart, I send:
GetRevision
It will fail every time.
I even sent the upper-case Command two more times (total of three) after a restart, and I get no reponse. Then sent the lower-case command once, and it worked. Then sent the upper-case Command again, and it worked.
David
AnonymousInactiveJune 23, 2008 at 3:27 pmPost count: 1001Now there is one for the books. What in theory should have been a failure all the time works some of the time. Pulled the following from the XML syntax rules…
XML Tags are Case Sensitive
XML elements are defined using XML tags.XML tags are case sensitive. With XML, the tag is different from the tag .
Opening and closing tags must be written with the same case:
All the EZSrve XML Samples I looked at show in lower case. Now the question is not why failed, but why it worked later on. Amazing!!AnonymousInactiveJune 23, 2008 at 4:13 pmPost count: 23But… the EZSrve “Quick-Start Guide” that came with the unit shows “Command” (with upper-case C) in the little box at the bottom right of page 1.
David
AnonymousInactiveJune 23, 2008 at 6:23 pmPost count: 1001Good catch. With more than 150 examples between the XML Samples files and the EZSrve/EZBridge Reference Manual showing , I would take the Quick Start Guide chart to be a typo. However, I don’t speak for SHN so we will have to wait for Paul to tell us if the example in the Quick Start Guide is controlling. If is to be a synonym for , then EZSrve should support all Tags starting with caps as synonyms. Supporting some tags as lower case only and some with leading caps or lower case would just be confusing.
AnonymousInactiveJune 23, 2008 at 9:10 pmPost count: 23Speaking of details of the messages, is the “EZBridge Manual.pdf” revision 1.4 dated 6/12/07 the most current? How up-to-date is it?
David
-
AuthorPosts
- You must be logged in to reply to this topic.