pylgbst icon indicating copy to clipboard operation
pylgbst copied to clipboard

Cannot subscribe to both ANGLE and SPEED on boost motor

Open nakermann1973 opened this issue 5 years ago • 4 comments

When trying to add a subscription to both ANGLE and SPEED for Motor_A, I get an error on the second subscription:

Code:

self.hub.motor_A.subscribe(test_speed, mode=EncodedMotor.SENSOR_SPEED)
self.hub.motor_A.subscribe(update_angle, mode=EncodedMotor.SENSOR_ANGLE)

Error:

ValueError: Port is in active mode MsgPortInputFmtSingle({'payload': bytearray(b''), 'port': 0, 'mode': 1, 'upd_delta': 1, 'upd_enabled': 1}), unsubscribe all subscribers first

I should be able to subscribe to both of these at the same time.

nakermann1973 avatar Dec 23 '19 15:12 nakermann1973

When you say "I should be able to subscribe to both of these at the same time." - where do you take this assumption from? I don't see any possibility for this in LEGO docs. The port is able to be in one mode at the time and the mode defines the notification kind you will get.

undera avatar Dec 26 '19 11:12 undera

I have assumed that I should be able to, since the lego boost app on my tablet shows speed and angle changing as the motors turn, if I set a variable input to the various sensors. This assumption may not be valid, however.

nakermann1973 avatar Dec 28 '19 10:12 nakermann1973

If the official app can do it, then it exists. But I can't find anything like that in the mobile app. Can you instruct me how to find it?

undera avatar Dec 28 '19 13:12 undera

This should be possible by setting up the port in combined input mode. I am close to having this setup in my C# SDK but not getting an acknowledgement reply when I unlock the port.

Perhaps we can solve together?

See: https://github.com/LEGO/lego-ble-wireless-protocol-docs/issues/22

Vouzamo avatar Apr 21 '20 03:04 Vouzamo