Oneliner to get / read the serial buffer and return the value to the standard outputBatch script to read/write data using COM portSerial port output buffer size in Windows 7reading serial port blocks for unknown reasonReading data from serial port from Arduino on Windows via PHP. Data not matching serial monitor outputVBScript read text file created in windows terminal substitutes characterstty - write/read to uart scriptsending serial commands to arduinoecho command to serial port in LinuxRead/Write on Serial Port in Windows Universal PlatformReading serial commands takes too much timeProblem with passing constantly reading serial buffer data to another class
Watching something be written to a file live with tail
Why is Minecraft giving an OpenGL error?
Intersection point of 2 lines defined by 2 points each
How much of data wrangling is a data scientist's job?
Perform and show arithmetic with LuaLaTeX
strTok function (thread safe, supports empty tokens, doesn't change string)
How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?
Why are electrically insulating heatsinks so rare? Is it just cost?
What defenses are there against being summoned by the Gate spell?
Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
Find the result of this dual key cipher
Important Resources for Dark Age Civilizations?
Paid for article while in US on F-1 visa?
Why can't I see bouncing of a switch on an oscilloscope?
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
What are these boxed doors outside store fronts in New York?
Today is the Center
Alternative to sending password over mail?
How does quantile regression compare to logistic regression with the variable split at the quantile?
How do I draw and define two right triangles next to each other?
If human space travel is limited by the G force vulnerability, is there a way to counter G forces?
How to efficiently unroll a matrix by value with numpy?
Are the number of citations and number of published articles the most important criteria for a tenure promotion?
Oneliner to get / read the serial buffer and return the value to the standard output
Batch script to read/write data using COM portSerial port output buffer size in Windows 7reading serial port blocks for unknown reasonReading data from serial port from Arduino on Windows via PHP. Data not matching serial monitor outputVBScript read text file created in windows terminal substitutes characterstty - write/read to uart scriptsending serial commands to arduinoecho command to serial port in LinuxRead/Write on Serial Port in Windows Universal PlatformReading serial commands takes too much timeProblem with passing constantly reading serial buffer data to another class
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.
Requirements:
- CMD / batch commands, no powershell
- it must be a oneliner
- preferably using
copy
,type
,more
and other simple commands like these.
Attempts:
A. First assuming I have set the parameters:
mode COM7:9600,N,8,1,P
Then from here I have tried
copy COM7 CON
and
type COM7
but it just doesn't return anything.
B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.
C. From here I also tried:
set /P "var=" < COM7 & echo %var%
but it just returns %var%
obviously not reading the buffer. Adding the cmd /V:ON /C
at the beginning of the above command also did not help.
D. from this page
copy COM7 > CON
and
copy COM7 2>&1
and
copy COM7 | more
all led to the error:
Access is denied.
0 file(s) copied.
I would appreciate if you could help me find the right command. Thanks for your help in advance.
windows batch-file cmd serial-port serial-communication
|
show 3 more comments
I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.
Requirements:
- CMD / batch commands, no powershell
- it must be a oneliner
- preferably using
copy
,type
,more
and other simple commands like these.
Attempts:
A. First assuming I have set the parameters:
mode COM7:9600,N,8,1,P
Then from here I have tried
copy COM7 CON
and
type COM7
but it just doesn't return anything.
B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.
C. From here I also tried:
set /P "var=" < COM7 & echo %var%
but it just returns %var%
obviously not reading the buffer. Adding the cmd /V:ON /C
at the beginning of the above command also did not help.
D. from this page
copy COM7 > CON
and
copy COM7 2>&1
and
copy COM7 | more
all led to the error:
Access is denied.
0 file(s) copied.
I would appreciate if you could help me find the right command. Thanks for your help in advance.
windows batch-file cmd serial-port serial-communication
1
I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files,copy
uses the original file name together with the current directory as the default dest., but when a device likecom#
is given, it might just mirror the data back, likecopy con
mirrors back tocon
). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and forset /P
, end-of-line too; perhaps a null byte might work too?)...
– aschipfl
Mar 22 at 0:02
@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?
– Foad
Mar 22 at 0:05
2
As I said, I can't test it, so it's a bit difficult. I don't know where theAccess denied.
message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, sinceecho %var%
returns the value ofvar
present before the whole line executes (sorry, I forgot this before); you could useset /P "var=" < COM7 & call echo %^var%
, or enable delayed expansion by runningcmd
with the/V
option. But all relies on terminated text data (end-of-file, etc.).
– aschipfl
Mar 22 at 0:16
1
N. B.: You could also trymore < com7
...
– aschipfl
Mar 22 at 0:16
1
@Foad Does the other computer have com7 enabled? if not, find out which com it uses.
– Gerhard Barnard
Mar 22 at 12:05
|
show 3 more comments
I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.
Requirements:
- CMD / batch commands, no powershell
- it must be a oneliner
- preferably using
copy
,type
,more
and other simple commands like these.
Attempts:
A. First assuming I have set the parameters:
mode COM7:9600,N,8,1,P
Then from here I have tried
copy COM7 CON
and
type COM7
but it just doesn't return anything.
B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.
C. From here I also tried:
set /P "var=" < COM7 & echo %var%
but it just returns %var%
obviously not reading the buffer. Adding the cmd /V:ON /C
at the beginning of the above command also did not help.
D. from this page
copy COM7 > CON
and
copy COM7 2>&1
and
copy COM7 | more
all led to the error:
Access is denied.
0 file(s) copied.
I would appreciate if you could help me find the right command. Thanks for your help in advance.
windows batch-file cmd serial-port serial-communication
I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.
Requirements:
- CMD / batch commands, no powershell
- it must be a oneliner
- preferably using
copy
,type
,more
and other simple commands like these.
Attempts:
A. First assuming I have set the parameters:
mode COM7:9600,N,8,1,P
Then from here I have tried
copy COM7 CON
and
type COM7
but it just doesn't return anything.
B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.
C. From here I also tried:
set /P "var=" < COM7 & echo %var%
but it just returns %var%
obviously not reading the buffer. Adding the cmd /V:ON /C
at the beginning of the above command also did not help.
D. from this page
copy COM7 > CON
and
copy COM7 2>&1
and
copy COM7 | more
all led to the error:
Access is denied.
0 file(s) copied.
I would appreciate if you could help me find the right command. Thanks for your help in advance.
windows batch-file cmd serial-port serial-communication
windows batch-file cmd serial-port serial-communication
asked Mar 21 at 23:03
FoadFoad
1,78321335
1,78321335
1
I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files,copy
uses the original file name together with the current directory as the default dest., but when a device likecom#
is given, it might just mirror the data back, likecopy con
mirrors back tocon
). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and forset /P
, end-of-line too; perhaps a null byte might work too?)...
– aschipfl
Mar 22 at 0:02
@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?
– Foad
Mar 22 at 0:05
2
As I said, I can't test it, so it's a bit difficult. I don't know where theAccess denied.
message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, sinceecho %var%
returns the value ofvar
present before the whole line executes (sorry, I forgot this before); you could useset /P "var=" < COM7 & call echo %^var%
, or enable delayed expansion by runningcmd
with the/V
option. But all relies on terminated text data (end-of-file, etc.).
– aschipfl
Mar 22 at 0:16
1
N. B.: You could also trymore < com7
...
– aschipfl
Mar 22 at 0:16
1
@Foad Does the other computer have com7 enabled? if not, find out which com it uses.
– Gerhard Barnard
Mar 22 at 12:05
|
show 3 more comments
1
I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files,copy
uses the original file name together with the current directory as the default dest., but when a device likecom#
is given, it might just mirror the data back, likecopy con
mirrors back tocon
). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and forset /P
, end-of-line too; perhaps a null byte might work too?)...
– aschipfl
Mar 22 at 0:02
@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?
– Foad
Mar 22 at 0:05
2
As I said, I can't test it, so it's a bit difficult. I don't know where theAccess denied.
message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, sinceecho %var%
returns the value ofvar
present before the whole line executes (sorry, I forgot this before); you could useset /P "var=" < COM7 & call echo %^var%
, or enable delayed expansion by runningcmd
with the/V
option. But all relies on terminated text data (end-of-file, etc.).
– aschipfl
Mar 22 at 0:16
1
N. B.: You could also trymore < com7
...
– aschipfl
Mar 22 at 0:16
1
@Foad Does the other computer have com7 enabled? if not, find out which com it uses.
– Gerhard Barnard
Mar 22 at 12:05
1
1
I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files,
copy
uses the original file name together with the current directory as the default dest., but when a device like com#
is given, it might just mirror the data back, like copy con
mirrors back to con
). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P
, end-of-line too; perhaps a null byte might work too?)...– aschipfl
Mar 22 at 0:02
I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files,
copy
uses the original file name together with the current directory as the default dest., but when a device like com#
is given, it might just mirror the data back, like copy con
mirrors back to con
). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P
, end-of-line too; perhaps a null byte might work too?)...– aschipfl
Mar 22 at 0:02
@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?
– Foad
Mar 22 at 0:05
@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?
– Foad
Mar 22 at 0:05
2
2
As I said, I can't test it, so it's a bit difficult. I don't know where the
Access denied.
message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var%
returns the value of var
present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%
, or enable delayed expansion by running cmd
with the /V
option. But all relies on terminated text data (end-of-file, etc.).– aschipfl
Mar 22 at 0:16
As I said, I can't test it, so it's a bit difficult. I don't know where the
Access denied.
message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var%
returns the value of var
present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%
, or enable delayed expansion by running cmd
with the /V
option. But all relies on terminated text data (end-of-file, etc.).– aschipfl
Mar 22 at 0:16
1
1
N. B.: You could also try
more < com7
...– aschipfl
Mar 22 at 0:16
N. B.: You could also try
more < com7
...– aschipfl
Mar 22 at 0:16
1
1
@Foad Does the other computer have com7 enabled? if not, find out which com it uses.
– Gerhard Barnard
Mar 22 at 12:05
@Foad Does the other computer have com7 enabled? if not, find out which com it uses.
– Gerhard Barnard
Mar 22 at 12:05
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290515%2foneliner-to-get-read-the-serial-buffer-and-return-the-value-to-the-standard-ou%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290515%2foneliner-to-get-read-the-serial-buffer-and-return-the-value-to-the-standard-ou%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files,
copy
uses the original file name together with the current directory as the default dest., but when a device likecom#
is given, it might just mirror the data back, likecopy con
mirrors back tocon
). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and forset /P
, end-of-line too; perhaps a null byte might work too?)...– aschipfl
Mar 22 at 0:02
@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?
– Foad
Mar 22 at 0:05
2
As I said, I can't test it, so it's a bit difficult. I don't know where the
Access denied.
message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, sinceecho %var%
returns the value ofvar
present before the whole line executes (sorry, I forgot this before); you could useset /P "var=" < COM7 & call echo %^var%
, or enable delayed expansion by runningcmd
with the/V
option. But all relies on terminated text data (end-of-file, etc.).– aschipfl
Mar 22 at 0:16
1
N. B.: You could also try
more < com7
...– aschipfl
Mar 22 at 0:16
1
@Foad Does the other computer have com7 enabled? if not, find out which com it uses.
– Gerhard Barnard
Mar 22 at 12:05