Port will not open if executing from file #2290
Unanswered
micromashor
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I've figured out a workaround for the time being, using the const { exec } = require('child_process')
exec('echo CFFFFFF > COM4', {'shell':'cmd.exe'}) The serial port can be configured using: exec('mode COM4 BAUD=115200 PARITY=n DATA=8 STOP=1 to=off xon=off odsr=off octs=off dtr=off rts=off idsr=off', {'shell':'cmd.exe'}) Composing those commands using basic string composition, you can get all of the functionality of Writing to the serial port. Reading is still off the table as far as I can tell, since I can't get |
Beta Was this translation helpful? Give feedback.
0 replies
-
Like if you put it in a .js file? Is it possible you're not using the same version of node? How are you executing it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary of Problem
(Please answer all 3)
Open a port and write data to it
If using the node command and typing program line-by line, port opens and it works correctly.
If executing from file, port never opens and data cannot be written.
Port should have opened.
Code to Reproduce the Issue
Versions, Operating System and Hardware
Beta Was this translation helpful? Give feedback.
All reactions