Skip to content
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

[Bug] "Long" Handset connection process if Primehub is not connected to Console #466

Closed
Vinz1911 opened this issue Sep 5, 2021 · 4 comments
Labels
bug Something isn't working hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: bluetooth Issues involving bluetooth

Comments

@Vinz1911
Copy link
Sponsor

Vinz1911 commented Sep 5, 2021

Describe the bug
I'm not sure if this is a bug. I discovered that the handset took longer to connect if I store a program on the Hub without attached to the console. It's not related if the program is stored. if I connect the hub to the Pybricks website and run the stored program that flashed with the firmware. the connection process is as fast as expected.

what means "long". it took about 6,5 seconds to connect to the remote if the console is not attached.
if the console is attached, it took only about 2 seconds.

I only discovered this with the Spike/RI Hub. On the Technic Hub this "problem" does not exist

To reproduce
Steps to reproduce the behavior:

  1. make a simple program which connects to the remote
  2. put it in the main.py from the firmware
  3. flash the firmware
  4. run the program (without connected to Pybricks website)

Expected behavior
same connection time with or without attached console

@Vinz1911 Vinz1911 added the triage Issues that have not been triaged yet label Sep 5, 2021
@dlech dlech added bug Something isn't working hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: bluetooth Issues involving bluetooth and removed triage Issues that have not been triaged yet labels Sep 5, 2021
@dlech
Copy link
Member

dlech commented Feb 24, 2023

I am able to reproduce using firmware v3.2.2-456-g830579b2 and the following program.

from pybricks.hubs import PrimeHub
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor, Remote
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch

hub = PrimeHub()

# turn on remote before starting program for accurate time!

connect_timer = StopWatch()
remote = Remote()
hub.display.text(f"{connect_timer.time() / 1000:0.1f}")

@dlech
Copy link
Member

dlech commented Feb 24, 2023

Sniffing packets shows the delay is after enabling notifications on the LWP3 hub characteristic. Eventually a Connection Parameter Update Request comes from the remote and gets things moving again.

image

@laurensvalk
Copy link
Member

I'm re-opening this momentarily as a reminder to double check that this also fixes the delay of connecting to an LWP3 Duplo device. It sounds like it should.

@dlech
Copy link
Member

dlech commented Feb 27, 2023

Confirmed that LWP3Device is fixed as well (using mario).

@dlech dlech closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub software: pybricks-micropython Issues with Pybricks MicroPython firmware (or EV3 runtime) topic: bluetooth Issues involving bluetooth
Projects
None yet
Development

No branches or pull requests

3 participants