-
Notifications
You must be signed in to change notification settings - Fork 43
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
3.18.1 Format of Port Input Format Setup (CombinedMode) > Sub Command = 0x01 SetModeDataSet combination(s) #22
Comments
After working more on this today, I believe I have a better understanding of how to format the message but I am not getting the anticipated reply so something is still not quite right. I have been able to determine the possible combination modes for a motor connected to port zero by sending a Port Information Request (Information Type 0x02). This gives me just one option: 0b_0000_1110 (Mode 1 + Mode 2 + Mode 3). In addition to this I am able to determine the Value Format for each mode using the Port Mode Information Request (Mode Information Type 0x80). This gives me the following: 1.) Send Port Input Format Setup CombinedMode (0x02 Sub-Command Lock LPF2 Device for setup) and currently wait 1000ms since this doesn't seem to trigger any reply I can wait for. 9 Length This is what I expect to reply with 3.24. Port Input Format (CombinedMode) but it doesn't. Is my understanding correct and the message above formatted correctly? It seems so based on the docs but failing to get any data back to give me confidence that I am on the right track with this. |
…ormation to start to integrate support for combined mode. Issue with combined mode logged here: LEGO/lego-ble-wireless-protocol-docs#22
Don't forget to send an unlock message. Without an unlock message, there won't be a confirmation. |
Setup is hard and the fun really starts when receiving mode/datasets. The protocol contains state (you have to remember what you set up to later decode it). This and the three layers of understanding here are a challenge. Very underspeced. By now I hope I got it right in my lib but the documentation is really unclear on it. |
Thank you for the response. Will take a look at that over the next few days to get it working but will continue to refer to your repo regarding new features etc. |
Got it now. This is how I set the TechnicMotorXL to combined mode. locking INFO | | >> Port_Input_Format_Setup__Combined_Mode | 05,00,42, | 03,02, INFO | << | Generic_Error_Messages | 05,00,05, | 42,06, WARNING| Port_Input_Format_Setup__Combined_Mode caused InvalidUse set single mode 1 INFO | | >> Port_Input_Format_Setup__Single | 0a,00,41, | 03,01,01,00,00,00,01, INFO | << | Port_Input_Format__Single | 0a,00,47, | 03,01,01,00,00,00,01, set single mode 2 INFO | | >> Port_Input_Format_Setup__Single | 0a,00,41, | 03,02,01,00,00,00,01, INFO | << | Port_Input_Format__Single | 0a,00,47, | 03,02,01,00,00,00,01, set single mode 3 INFO | | >> Port_Input_Format_Setup__Single | 0a,00,41, | 03,03,01,00,00,00,01, INFO | << | Port_Input_Format__Single | 0a,00,47, | 03,03,01,00,00,00,01, setting ModeDataSet INFO | | >> Port_Input_Format_Setup__Combined_Mode | 09,00,42, | 03,01,00,10,20,30, unlocking INFO | | >> Port_Input_Format_Setup__Combined_Mode | 05,00,42, | 03,04, INFO | << | Port_Input_Format__Combined_Mode | 07,00,48, | 03,00,07,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,4f,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,4f,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,4f,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,50,00, When I send a Port Output Command immediately after that, it looks like that (together with the retrieved speed etc.): INFO | | >> Port_Output_Command | 08,00,81, | 03,10,51,00,32, INFO | << | Port_Value__Combined_Mode | 08,00,46, | 03,00,04,4f,00, INFO | << | Port_Value__Combined_Mode | 0c,00,46, | 03,00,06,f4,2f,00,00,54,00, INFO | << | Port_Value__Combined_Mode | 0d,00,46, | 03,00,07,08,09,30,00,00,69,00, WARNING| WARNING| Speed: 8 WARNING| Position: 12297 WARNING| absolutePosition: 105 INFO | << | Port_Value__Combined_Mode | 0d,00,46, | 03,00,07,19,23,30,00,00,83,00, WARNING| WARNING| Speed: 25 WARNING| Position: 12323 WARNING| absolutePosition: 131 INFO | << | Port_Value__Combined_Mode | 0d,00,46, | 03,00,07,22,3d,30,00,00,9d,00, WARNING| WARNING| Speed: 34 WARNING| Position: 12349 WARNING| absolutePosition: 157 INFO | << | Port_Value__Combined_Mode | 0d,00,46, | 03,00,07,23,55,30,00,00,4d,ff, |
I am trying to set up combined mode sensors on a motor to get notified of changes to either absolute position or speed.
I was able to do this with single mode but I am unclear how to get combined mode working.
In my case I have two modes Speed (0x01) and Position (0x02).
Based on this I believe I want to set combination index based on the combination mode 0b0000000000000110 (Mode 1 and Mode 2).
The part I am unclear on it what I need to send for Mode/DataSet[0], Mode/DataSet[1], Mode/DataSet[n].
Perhaps this is device and mode specific but any guidance would be appreciated.
I know that the Speed mode notifies with a byte value and the Position mode notifies with an Int32 value but this doesn't seem to help me.
The text was updated successfully, but these errors were encountered: