chilipeppr / serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
321 stars 101 forks source link

Question #58

Open Taillaert opened 5 years ago

Taillaert commented 5 years ago

We are using the 1.95 version of the serial json service. Is there a command to check if a comport is already open? When we sending JSON command to open com port in several browser instances we get open com3 9600 (for example) and then the JSON services stops. doesn't respond anymore to request and we need to restart

chilipeppr commented 5 years ago

You can list the serial ports and it returns whether the port is open or not.

I have seen the bug you're describing occur every now and then and it's probably not hard to track down if you wanted to help fix it and check in your changes on Github.

On Tue, Oct 2, 2018 at 5:29 AM Taillaert notifications@github.com wrote:

We are using the 1.95 version of the serial json service. Is there a command to check if a comport is already open? When we sending JSON command to open com port in several browser instances we get open com3 9600 (for example) and then the JSON services stops. doesn't respond anymore to request and we need to restart

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chilipeppr/serial-port-json-server/issues/58, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbagPOiaqen_D5L6lx8vJWpt1Jcggks5ug1wlgaJpZM4XD7bB .

Taillaert commented 5 years ago

Thank you for the reply. I've found! Seems when opening the port 2-3 times it gives this bug.

Taillaert commented 5 years ago

Hi,

Here you can find verbose logging when error occurs. At the end it gives inside spHandler and then it stops. http://prntscr.com/l1aaug

chilipeppr commented 5 years ago

Any way you could take a look at spHandler in the code and see where it might be getting stuck?

On Tue, Oct 2, 2018 at 6:58 AM Taillaert notifications@github.com wrote:

Hi,

Here you can find verbose logging when error occurs. At the end it gives inside spHandler and then it stops. http://prntscr.com/l1aaug

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chilipeppr/serial-port-json-server/issues/58#issuecomment-426283969, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbcZ0DyAQr3azT5f851V-Ljnqh_2Oks5ug3EggaJpZM4XD7bB .

Taillaert commented 5 years ago

I will check. Thnx!

leonua commented 5 years ago

Have problems with pushing it to git now, but looks like issue is solved with this patch:

leonua commented 5 years ago

patch.win-open-open.txt

chilipeppr commented 5 years ago

This patch looks good. So you're saying that on that error there was just an oversight on not removing the mutex lock. Makes sense actually that this got missed. Thanks for the help.