967Re: [smartsockets] Re: Using IV-17 smartsocket with usb>ttl adapter
- Dec 16, 2012
> I think I am going to hook up my Arduino to it and try to send commands from there, I can't trust Linux, echo and a CP2102 USB-TTL adapter to do this properly it seems.Linux and the CP2102 aren't your problem. Echo is your problem. It's designed to send human-readable ASCII text to terminals from shell scripts. While it can be coerced into sending (some) arbitrary bytes, it's not happy or coöperative about it. Normally, if I want to send arbitrary bytes, I'll just assemble them in a file and
send them out the serial port with the "cat" command. Alternatively, some systems have a "convert" sort of command that will take pairs of hex digits and send
the corresponding bytes. And, since you're willing to program an Arduino, you can similarly write a program for Linux to send whatever you want. If you want
to get more fancy than sending canned text, that's really the way to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So you
could use C or C++ without having to learn a lot of new things.
If you like, I can write a C program equivalent to the Arduino one you posted to get you started.
- << Previous post in topic Next post in topic >>