How to get data that has line break before and after data #2291
Unanswered
jaydenpung
asked this question in
Q&A
Replies: 2 comments
-
you might want to attach the parser before the port is open |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try to do the following
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary of Problem
I am having trouble getting the "data" event to trigger on SerialPort. Below is the "AT" command I sent, and the line break and "OK" I received:
If I understand correctly, using '@serialport/parser-readline' should be able to get the data (First data empty, second data "OK").
I can confirm the "AT" command is successfully sent, because when I stop the script and connect with putty, I can see a line break and "OK", and if I sent "ATTTTT\r\n" (invalid command), I can see "ERROR".
However, the on "data" event never seems to get triggered. I even tried changing the "\r\n" to buffer, but still no luck:
I have also tried various type of parser including InterByteTimeout at 3000ms with no luck
Code to Reproduce the Issue
Versions, Operating System and Hardware
Beta Was this translation helpful? Give feedback.
All reactions