curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Sending ASCII commands to a device

From: Kaya Saman via curl-users <>
Date: Sun, 2 Aug 2020 15:21:39 +0100

On 2020-08-02 14:24, Rainer Canavan via curl-users wrote:
> On Sat, Aug 1, 2020 at 7:58 PM Kaya Saman via curl-users
> <> wrote:
>> Hi,
>> I have a device which is an ASCII HVAC (air conditioning) Wifi gateway
>> and I'm trying to use Curl to send commands to it.
>> I'm not sure if it has a RESTful API or not as very little information
>> is given. The developer documentation for the protocol says this:
> There's very little information because the protocol is indeed that
> trivial. There' s no HTTP or anything else between the simple ASCII
> commands and TCP. Just use netcat / nc, e.g.
> (echo ID; echo LOGOUT) | nc 3310
> rainer
> -----------------------------------------------------------
> Unsubscribe:
> Etiquette:

Many thanks Rainer,

netcat does seem to perform much better then using curl.

Just as an addition for my second question the curl flag needed was: -m
, a 2 second value seems to work well.

Using netcat I am terminating the connection after 1 second using -w as
nc seems to be more zippy, I guess because curl is doing a lot more in
the background hence being overkill.



Received on 2020-08-02