Russia
Asked — Edited

Tcp Client

Hello,

I try to link to ARC from my TCP/IP client via Windows socket. Can anybody explain the protocol of communication at the server side? I can successfully connect from both my program and Telnet PuTTY, but calling EZ-Script functions encounters troubles. Using PuTTY, I could generate speech from string with Say( text to speech ), but Print( txt ) outputs nothing. Bare TCP/IP produces no reaction at all. I can send strings and the main question is how to mark their end. I can use null-terminated strings. Does anybody know how the receiving server is implemented?


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

PRO
Synthiam
#1  

There's an example in the ez-sdk package for sending ezscript commands via the tcp server of ARC.

Commands for the tcpcommand console are terminated with a new line.

I need further explanation of these two statements:

  • What is a null-terminated string to a tcp command line console?

  • What is a "bare tcp/ip"?

#2  

I have only used it with a Tasker plugin called Send/Expect which emulates a Telnet client. I needed to terminate commands with \n to make it work. \n I believe is Send/Expect nomenclature for "new line"

Alan

PRO
Synthiam
#3  

Okay - I can help with your misunderstanding of tcp and command line console ui

The "internet" doesn't break up packets, routers do. And the only protocol which would require your application to programmatically assemble received packets into your applications specific packet is if you're using UDP. However, even if you're using UDP, terminating a string with a null character doesn't make a difference unless the application requires it.

There's an OSI network model that you should google to understand the separation of transmission layers. Discussing tcp or UDP in the same conversation as the application protocol is not applicable. It's like discussing how fast you're car is going and how big the trunk is at the same time. They're two separate topics.

There's no need to discuss how tcp works for this thread, however it may benefit you to google a bit because you seem interested in it.

The tcp protocol is transmission controlled. This means the tcp stack takes care of assembling and sorting the incoming packets for you.

The ARC tcp server is a command line console. It accepts a single line of text terminated by a new line (crlf). This means putting putty in regular terminal ascii terminal mode will work just fine.

For code example, use the ez-sdk package.

#4  

sending strings through a socket is all that Telnet does. You can use a Telnet client to test any TCP Socket app. It is the simplest of TCP clients.

Alan

PRO
Synthiam
#5  

get rid of the null - and look at the example in the ez-sdk package please. To repeat, the string in a command line console is terminated with a new line (CRLF).

#7  

I don't believe the print() script command is valid for use over a TCP connection. It is specifically for displaying information in the script debug window in ARC. Since you are issuing script commands over the socket, there is no window for it to display, so not surprised the command is failing.

Not sure about why you are getting a Speech Recognition init error when trying to generate rather than recognize speech. Do you get that error if you issue the same command from a script object in ARC? Do you have a recognition object in your project and does it work?

DotNet version is important, but ARC won't even run if you don't have at least the minimum version.

I question why you would be trying to do anything on Windows 8 (not 8.1, but even 8.1 is questionable - Worst OS since Windows ME. 7 or 10 are both far superior) but I doubt it is in any way related to the issues you are experiencing.

Alan

#9  

Another option to using the Telnet/TCP interface is to use the HTTP Server (custom) object. If you run the server, you can send script commands using HTTP Get in the following format:


get http://hostIP:port/script.cmd?code=script command

for example, I have a script manager with various commands to control my Foscam camera. I can execute the scripts using a controlcommand()


http://192.168.0.203:81/script.cmd?code=ControlCommand("FoscamScripts",ScriptStart,"CamRight")

The web server responds OK

(note: this is not documented, so could potentially change with ARC updates. I discovered it by capturing packets when using the HTTP Server (custom) web page and watching what happened when I hit the buttons)

Alan