I'm trying to communicate with an arduino over serial. I've used PuTTY just fine, but for my current project, it would be really useful to use a batch program. Naturally, I googled it and found out you can use the following:
echo a > COM3
to send 'a' to com 3. The issue is that this only works after already opening the PuTTY command line. Even if I just open it and close it again, it will work, but I need it to be functional without the use of PuTTY at all. Any suggestions?
sending things over serial
Moderator: DosItHelp
Re: sending things over serial
You would probably be better off posting on an Arduino forum but I just did my usual Google Foo.
http://stackoverflow.com/questions/9247 ... or-arduino
http://stackoverflow.com/questions/1100 ... ot-working
Running it as a Powershell command looks like your best option but are you sure you are using the correct COM port?
Another article said that Arduino does not allow Carriage Return and Line Feeds to be sent to it. So that may cause some issues using cmd.exe. If that is the case then maybe you can do this trick.
http://stackoverflow.com/questions/9247 ... or-arduino
http://stackoverflow.com/questions/1100 ... ot-working
Running it as a Powershell command looks like your best option but are you sure you are using the correct COM port?
Another article said that Arduino does not allow Carriage Return and Line Feeds to be sent to it. So that may cause some issues using cmd.exe. If that is the case then maybe you can do this trick.
Code: Select all
set /p "=a" >COM3 <nul
Re: sending things over serial
Although based on your example I am betting that you forgot to use the MODE command first.
Code: Select all
mode COM3 BAUD=9600 PARITY=n DATA=8
echo a > COM3
Re: sending things over serial
As there may be problems in sending special data (for example a single '='-char) you may create a file and use copy, to communicate with the com port 3 instead of redirecting "echo" or "set/P" (assumed you wanted example.text to be send):
penpen
Code: Select all
copy /B "example.txt" COM3
penpen
Re: sending things over serial
Your best bet may be to find an older DOS comm program like quicklink that had scripting capability.
Re: sending things over serial
Real Terminal emulation software:
http://realterm.sourceforge.net/
Command line and script options are available. The version I use only runs on Win 32 bit but they may have updated the program since I downloaded it. I have serial devices attached to PC via serial to USB cables and this software works great capturing serial output and sending commands, handshakes, etc. Hope this helps. Carl
http://realterm.sourceforge.net/
Command line and script options are available. The version I use only runs on Win 32 bit but they may have updated the program since I downloaded it. I have serial devices attached to PC via serial to USB cables and this software works great capturing serial output and sending commands, handshakes, etc. Hope this helps. Carl