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

Infinite Cayenne discover/announce loop at startup #62

Closed mgkeeley closed 5 years ago

mgkeeley commented 5 years ago

I get a never ending list of "Announce":"i-am-your-server" messages when connecting Chilipeppr to an already-running SPJS running on a raspberry pi. This only happens when SPJS is already running, and I refresh the Chilipeppr browser page. (If I stop SPJS, refresh the page, start SPJS, then connect via clicking the ws: link on the "Your Servers" recent server list, then tick the checkbox in the "Port List" it works OK).

Seems to be Chilipeppr sends a message msg: {"Cayenn":"Discover"}, then SPJS does a UDP broadcast {"Cayenn":"Discover"}. However, SPJS gets the broadcast back (is that normal?), and sends the announce back to itself. But that fails, and then it loops forever.

See the SPJS log attached. spjs.log

Maybe SPJS should ignore Cayenn messages from itself?

chilipeppr commented 5 years ago

We're at version 1.95 and that looks like you're running 1.88. I believe this bug was fixed a long time ago.

On Sat, Dec 22, 2018 at 1:11 AM Michael Keeley notifications@github.com wrote:

I get a never ending list of "Announce":"i-am-your-server" messages when connecting Chilipeppr to an already-running SPJS running on a raspberry pi. This only happens when SPJS is already running, and I refresh the Chilipeppr browser page. (If I stop SPJS, refresh the page, start SPJS, then connect via clicking the ws: link on the "Your Servers" recent server list, then tick the checkbox in the "Port List" it works OK).

Seems to be Chilipeppr sends a message msg: {"Cayenn":"Discover"}, then SPJS does a UDP broadcast {"Cayenn":"Discover"}. However, SPJS gets the broadcast back (is that normal?), and sends the announce back to itself. But that fails, and then it loops forever.

See the SPJS log attached. spjs.log https://github.com/chilipeppr/serial-port-json-server/files/2704947/spjs.log

Maybe SPJS should ignore Cayenn messages from itself?

— 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/62, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbfaI1Q_WCxJeh4pcKHBRNtv9_8FJks5u7fclgaJpZM4ZfZNx .

mgkeeley commented 5 years ago

Ah, I see. I looked at https://github.com/chilipeppr/serial-port-json-server#binaries-for-download and assumed the top one there (1.88) was the latest. I didn't realise this list wasn't the same as on the releases page. Maybe this list could be marked "Old Releases", or removed altogether?

chilipeppr commented 5 years ago

oh, yeah, that readme just has outdated links now. probably best to just link over to the releases page. up for editing that readme then doing pull request?

On Sat, Dec 22, 2018 at 1:21 PM Michael Keeley notifications@github.com wrote:

Ah, I see. I looked at https://github.com/chilipeppr/serial-port-json-server#binaries-for-download and assumed the top one there (1.88) was the latest. I didn't realise this list wasn't the same as on the releases page. Maybe this list could be marked "Old Releases", or removed altogether?

— 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/62#issuecomment-449598307, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbec6CT7sCFowq9KcD0_DvSFg0SRTks5u7qJdgaJpZM4ZfZNx .

mgkeeley commented 5 years ago

https://github.com/chilipeppr/serial-port-json-server/pull/63

chilipeppr commented 5 years ago

Awesome. Thanks for the help.

On Sat, Dec 22, 2018 at 7:48 PM Michael Keeley notifications@github.com wrote:

63 https://github.com/chilipeppr/serial-port-json-server/pull/63

— 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/62#issuecomment-449612404, or mute the thread https://github.com/notifications/unsubscribe-auth/AHidbb5OTNKZWE8WkvkNdIxeVNJfwfuxks5u7vz8gaJpZM4ZfZNx .