maehw / maehw/WebPBrick

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

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
JavaScript
Stars
34
Forks
8
PR merge metrics
No merged PRs in 30d

Description

**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.
1. Press the "Serial Connect" button
1. 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."_
1. 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.
1. 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](https://github.com/maehw/WebPBrick/assets/6305922/cb803500-5591-47d5-b294-92539cf429c5)

**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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the JavaScript handler for the “Serial Connect” button and trace the failed connection path through the serial status update. Check how the connection button is relabeled after the RCX communication error, then verify that a failed attempt can be retried without requiring a separate disconnect action.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
embedded-iot, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.