-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbage when clients don't disconnect #72
Comments
Not sure I've seen that behavior before myself. First thing that comes to
mind on garbled characters is if you open at a different baud rate than
last time. Is there a test page I could hit to try it out and see if I see
anything in the code logic? I presume you're writing your own front-end to
spjs?
…On Sat, May 5, 2018 at 9:05 AM, Mark-81 ***@***.***> wrote:
It *seems* that if clients (or even the same client) reconnect without
disconnect first, they will receive garbage chars.
For example in an html page I have a "Connect" button:
1. load the page
2. press connect
3. open the port and all is fine
4. reload the page, *without disconnect first*
5. try to connect again - ok
6. open the port - ok
7. now the received data is wrong, with all the chars shuffled
To get the things back to work I have to restart the
serial-port-json-server.
it's a known behavior? Is there a way to avoid this? I'm interested in
only one client at time, so it would be fine to forcefully disconnect
*any* client before accept a new connection.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#72>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHidbW7wRBkT166VhBrh4t4rI4Tk7WaWks5tvc3ngaJpZM4TzsRQ>
.
|
What if you just try the serial port workspace on chilipeppr.com to connect
to your spjs? Does it behave the same?
…On Sat, May 5, 2018 at 11:40 AM, John Lauer ***@***.***> wrote:
Not sure I've seen that behavior before myself. First thing that comes to
mind on garbled characters is if you open at a different baud rate than
last time. Is there a test page I could hit to try it out and see if I see
anything in the code logic? I presume you're writing your own front-end to
spjs?
On Sat, May 5, 2018 at 9:05 AM, Mark-81 ***@***.***> wrote:
> It *seems* that if clients (or even the same client) reconnect without
> disconnect first, they will receive garbage chars.
> For example in an html page I have a "Connect" button:
>
> 1. load the page
> 2. press connect
> 3. open the port and all is fine
> 4. reload the page, *without disconnect first*
> 5. try to connect again - ok
> 6. open the port - ok
> 7. now the received data is wrong, with all the chars shuffled
>
> To get the things back to work I have to restart the
> serial-port-json-server.
> it's a known behavior? Is there a way to avoid this? I'm interested in
> only one client at time, so it would be fine to forcefully disconnect
> *any* client before accept a new connection.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#72>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AHidbW7wRBkT166VhBrh4t4rI4Tk7WaWks5tvc3ngaJpZM4TzsRQ>
> .
>
|
BTW, the main repo is now chilipeppr/serial-port-json-server not the
johnlauer one anymore.
…On Sat, May 5, 2018 at 11:41 AM, John Lauer ***@***.***> wrote:
What if you just try the serial port workspace on chilipeppr.com to
connect to your spjs? Does it behave the same?
On Sat, May 5, 2018 at 11:40 AM, John Lauer ***@***.***> wrote:
> Not sure I've seen that behavior before myself. First thing that comes to
> mind on garbled characters is if you open at a different baud rate than
> last time. Is there a test page I could hit to try it out and see if I see
> anything in the code logic? I presume you're writing your own front-end to
> spjs?
>
> On Sat, May 5, 2018 at 9:05 AM, Mark-81 ***@***.***> wrote:
>
>> It *seems* that if clients (or even the same client) reconnect without
>> disconnect first, they will receive garbage chars.
>> For example in an html page I have a "Connect" button:
>>
>> 1. load the page
>> 2. press connect
>> 3. open the port and all is fine
>> 4. reload the page, *without disconnect first*
>> 5. try to connect again - ok
>> 6. open the port - ok
>> 7. now the received data is wrong, with all the chars shuffled
>>
>> To get the things back to work I have to restart the
>> serial-port-json-server.
>> it's a known behavior? Is there a way to avoid this? I'm interested in
>> only one client at time, so it would be fine to forcefully disconnect
>> *any* client before accept a new connection.
>>
>> —
>> You are receiving this because you are subscribed to this thread.
>> Reply to this email directly, view it on GitHub
>> <#72>, or mute
>> the thread
>> <https://github.com/notifications/unsubscribe-auth/AHidbW7wRBkT166VhBrh4t4rI4Tk7WaWks5tvc3ngaJpZM4TzsRQ>
>> .
>>
>
>
|
Sorry you're right. I didn't notice I was on the wrong page. Do you think it's better I move the question there? |
Probably, just so future users can see the discussion thread in case they run into the same problem.
From: Mark-81 <[email protected]>
Sent: Saturday, May 5, 2018 11:44 AM
To: johnlauer/serial-port-json-server <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [johnlauer/serial-port-json-server] Garbage when clients don't disconnect (#72)
Sorry you're right. I didn't notice I was on the wrong page. Do you think it's better I move the question there?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#72 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AA8jldmhmcB1sdBpuL4JKR9b5n6UedLSks5tvfLRgaJpZM4TzsRQ>.
|
This issue was documented by me way back in 2016 - but because I lack personal skills it was ignored. https://www.youtube.com/watch?v=70uAKhbGXIk The issue has to do with the handling of the PORT open command. The SPJS expects the user to check if the port is open before opening the port. If the user opens the same port multiple times, my guess is that the SPJS software just creates more threads parsing input of the serial port. So some characters go to one thread but other characters are handled by a different thread. It basically breaks the parsing of JSON. An easy fix would be to simply check to see if the port is open, and if the port open request is based on the same parameters, just ignore the request. Otherwise, just close the port and re-open it? << this last idea could be problematic if you are in a CNC program executing and someone opens up a new terminal on a new workstation. But as my experience with code and troubleshooting is not appreciated here - I will not be publishing the fix. It truly is sad, here I came with an issue and was willing to troubleshoot it, isolate the bad code, publish my findings, and probably would have created a patch. But when I submitted the issue. instead of accepting that I could have something to bring to this project, the admins assumed I just didn't know what I was going. Then got really irate and "offended" when I tried to explain I didn't need help - i was here to help. Anyways - good luck with a bug the developers refuse to fix because I brought it to them and they hate me over trivialness. |
It seems that if clients (or even the same client) reconnect without disconnect first, they will receive garbage chars.
For example in an html page I have a "Connect" button:
To get the things back to work I have to restart the serial-port-json-server.
it's a known behavior? Is there a way to avoid this? I'm interested in only one client at time, so it would be fine to forcefully disconnect any client before accept a new connection.
The text was updated successfully, but these errors were encountered: