-
Notifications
You must be signed in to change notification settings - Fork 22
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
Jacdac: Live view reacts slow to Jacdac modules #271
Comments
I attached 3 Gif videos to show the behaviour. The bug is solved when using a Hex file generated from the micro:bit makecode. As you can see in the first video, sometimes the button is not fully operational, the picture doesn't load or the button presses are not noticed. Capturing the screen video might have had an additional adverse effect. Jacdac using the Calliope Makecode Editor with a Calliope Hex fileJacdac using the Microbit Makecode Editor with a micro:bit Hex fileJacdac using the Calliope Makecode Editor with a micro:bit Hex file |
@pelikhan can you look into this issue and provide some help? Here is a summary:
Calliope mini 3 running the mini 3 firmware
calliopejacdac.mp4Calliope mini 3 running the microbit v2 firmware - how it should be
callioppemicrobitjacdac.mp4 |
Could you try to connect the calliope mini at https://microsoft.github.io/jacdac-docs/dashboard/ and record a trace with calliope firmware vs microbit firmware? |
Is this a regression from a previous calliope firmware version? |
Here is a trace where I just connect the mini and then connect PJ01 Keycap Button: Here is a more complex trace, where the mini is already connected, and I just connect the Keycap Button, wait for it to appear, press the button and remove it. The calliope is not recognized in this trace ( Here are the hex files I used for testing. Just MakeCode files from either Calliope or MicroBit with jacdac extension and scrolling The Firmware for Calliope mini 3 is forked from MicroBit v2. The changes we made are not a regression from previous calliope firmware versions. Here is a comparison of the firmware changes we made:
The changes in codal core are just for inverting the axes of the Magnetometer: |
Coul you scope the data line on the jacdac cable? (if you have a salea https://microsoft.github.io/jacdac-docs/tools/traces/#saleae-logic ) It seems that there is a bunch a broken packets in the cp trace. |
@mmoskal do you have a hunch here? |
I attached a recording of the jacdac data line. The Calliope mini has two Jacdac ports, the recording was made on the second port so I could attach modules on the first port. The mini was connected via USB during the measurement.
Let me know if you need a another recording. |
We are in winter break, realistically looking at this in Jan. |
There is nothing remotely suspicious in the diff and the .sal file looks all right. |
@mmoskal Thank you a lot for looking into this! So this means, that also inside the timing there was nothing suspicious/ All messages are received in the expected timely manner? FIY: The bug is independent from hardware, i.e. the slow reactions can be reproduced with micro:bit hardware in combination with pxt-calliope, and the normal behavior is observed with pxt-microbit on the calliope hardware |
You could try to do a binary search approach by commenting out the differences with micro:bit (like comment out the RGB code) until you do not see the performance degradation. |
You could also try to connect the micro:bit via USB and use it as a "proxy" to channel the jacdac packets. |
Thank you!
While we are continuing the binary search, I tried the following setup with the proxy idea: Microbit (+Jacdaptor) to PC USB; Calliope mini (powered by battery) to the Jacdac Bus; Then Keyboard Key to the Jacdac bus. The micro:bit had a jacdac firmware from makecode.microbit, the mini had a jacdac firmware from makecode.calliope.cc. |
True, there seems to be something wrong with the recoding. I think the device FV93 refers to some device that is OS related, since it is not the micro:bit or calliope mini or anything else. Unclear to me how this happened. I also repeated this recording one more time with the Calliope mini V3 also connected via WebUSB in another browser: trace_ubit45s_miniconnected.jd.txt And made a 3rd trace recording where I connect the trace of the Calliope mini, with the same procedure and the microbit connected via WebUSB: trace_mini45s_ubitconnected.jd.txt. This trace seems a bit off as well, since neither Calliope mini nor micro:bit appear in the list of devices in the beginning of the file. When I replay it the devices VU03 (ubit v2) and UI98 (mini v3) show up in the dashboard however. |
are you seeing packet drops when using the micro:bit as proxy? this would point to an issue with the packet->usb routing |
|
trim.3423C727-8EB2-4900-9D9B-DD414C8DA06B.MOVI connect the microbit to the jacdac-docs dashboard and bridged the calliope through the jacdac bus. The button pakets are flowing correctly through the micro:bit and the calliope is responding correctly to the button presses (see LED blinking on each button press). So this test tells me seems to indicate the calliope is receiving correctly the packets but somehow they are lost in the USB transport. |
Thank you for the video! Great to see the calliope in action, and that the reaction times using code on the calliope mini are short :) The jacdac dashboard was connected to the microbit in this example i assume? |
Yes the micro:bit was connected to the dashboard so it handled the USB routing. |
Do you guys by any chance use |
TEMP_IRQn is used https://github.com/microsoft/pxt-jacdac/blob/master/mbbridge.cpp#L100 |
We tackled it down to the Bluetooth settings. We initially tested disabling Bluetooth, but it seems like the setting was stuck in enabled mode, and therefore we had a false negative (similar to the behavior described in this issue: #264). The content of Here is a Project, where Bluetooth is disabled and Jacdac is working smooth: https://makecode.calliope.cc/_V7g9EfcPrPvi @pelikhan what do you think would be the best option to fix this, when we want to keep bluetooth eabled by default?
|
I've applied the BLE disabling settings to pxt-jacdac 1.9.15. Tested as working, i think you can close this one!!! |
Thank you all! Closing as fixed :) |
Describe the bug
When using the current Calliope Makecode in version 6.0.27 and the Jacdac extension in version 1.9.24, the time of recognizing new modules and showing updated module output is quite long, testet with different minis and different Jacdac modules. E.g. Keycap button 14 seconds and 8seconds on second trial to appear in the live view, the button presses are shown with a big delay (~2s). When using the micro:bit Makecode in Version 6.0.24 and the Jacdac extension in version 1.9.24 the reaction times are much shorter. E.g. Keycap button 0,5s on the first and second trial, button presses are shown in real time. When switching then back to the Calliope Makecode with the previous "micro:bit" hex on the mini, the appearance time stays short. This means that the problem is most likely in the codal-libraries or the jacdac extension.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The module should appear earlier in the device section in the left display pane. The module output should be shown in real time.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: