maehw / WebPBrick

Web-based IDE for programming the LEGO Mindstorms RCX using NQC with modern technologies
https://www.webpbrick.com
GNU General Public License v3.0
16 stars 4 forks source link

Disconnect before trying to connect again after a failed serial connection attempt #2

Open maehw opened 4 months ago

maehw commented 4 months ago

Describe the bug

Need to disconnect before trying to connect again after a failed serial connection attempt.

To Reproduce

Steps to reproduce the behavior:

  1. Switch RCX off or put out of line of sight from the IR tower.
  2. Press the "Serial Connect" button
  3. See the error message "Connected to serial device (baudrate: 2400). ❌️ No communication with RCX possible. RCX needs to be switched on and placed close to and in line of sight of the IR tower."
  4. Need to press "Serial Disconnect" and then "Serial Connect" again after having switched the RCX on or in line of sight.

Expected behavior

The IDE knows when a connection attempt has failed and could

  1. Close the serial connection.
  2. Re-label the connection button to "Serial Connect" without requiring the user to press the button twice.

Even better would be to leave the serial connection open (the serial device will be the same) and re-attempt the communication ping with the RCX.

Screenshots

grafik

Operating system & webbrowser:

Considered irrelevant.

RCX hardware & firmware:

Considered irrelevant.

Additional context

Only involves changing JavaScript code and no deep insights into how the serial communication between IR tower and RCX works.