Re: Sending ASCII commands to a device
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
> <curl-users_at_cool.haxx.se> 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 192.168.123.45 3310
>
> rainer
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html
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.
Regards,
Kaya
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-08-02