microsoft / jacdac

Device and service catalogs for Jacdac.
https://aka.ms/jacdac
Creative Commons Attribution 4.0 International
66 stars 25 forks source link

Pressing reset while micro:bit is connected to jacdac-ts causes a disconnect #348

Closed jamesadevine closed 3 years ago

jamesadevine commented 3 years ago

Describe the bug Pressing the reset button on the micro:bit seemingly causes jacdac-ts site to break. The micro:bit device disconnects and does not reappear

To Reproduce Steps to reproduce the behavior:

  1. Flash a program to micro:bit with modules.identify()
  2. Go to aka.ms/jacdac and hit connect
  3. reset the micro:bit (more than once might be required)
  4. See the site get confused.
pelikhan commented 3 years ago

Could you copy the output of the javascript console when this happens?

pelikhan commented 3 years ago

I pushed a fix https://github.com/microsoft/jacdac-ts/commit/221732e46e32e43ab207af725edbaa4ba00e36a4 Can you try it out?

pelikhan commented 3 years ago

Please test to see if it works to your taste.

pelikhan commented 3 years ago

Reopen if still an issue.

jamesadevine commented 3 years ago

It doesn't seem to have changed anything on my side. I'll assume that this is because the site hasn't yet updated. What's the best way to get the latest version for sure?

pelikhan commented 3 years ago

You'll see the short sha in the footer which you can compare to the jacdac-docs repo.

jamesadevine commented 3 years ago

Pressing reset whilst the micro:bit is connected (a couple of times) still breaks the website with sha 7b14eaea.

I am using the attached hex file with a micro:bit V2. microbit-enumeration-test (11).hex.zip

pelikhan commented 3 years ago

Can you add ?dbg=1 to the web site and copy the JavaScript console output.

What does break mean?


From: James Devine @.> Sent: Friday, April 23, 2021 3:56:14 AM To: microsoft/jacdac @.> Cc: Peli de Halleux @.>; State change @.> Subject: Re: [microsoft/jacdac] Pressing reset while micro:bit is connected to jacdac-ts causes a disconnect (#348)

Pressing reset whilst the micro:bit is connected (a couple of times) still breaks the website with sha 7b14eaea.

I am using the attached hex file with a micro:bit V2. microbit-enumeration-test (11).hex.ziphttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fjacdac%2Ffiles%2F6364727%2Fmicrobit-enumeration-test.11.hex.zip&data=04%7C01%7Cjhalleux%40microsoft.com%7Cc93a8e8d324f4456381f08d9064669f0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637547721761480399%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1hQKZ5V4qM8copjYyPOcuvdj2HxpsYMOZwyQ9tCw8q4%3D&reserved=0

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fjacdac%2Fissues%2F348%23issuecomment-825577348&data=04%7C01%7Cjhalleux%40microsoft.com%7Cc93a8e8d324f4456381f08d9064669f0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637547721761490393%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pAdaniVFbnF%2BGvoo%2F8R%2FpsjW2ARer9fmS1UOHkzm49I%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKJNLR2FP2FMK7KZNKDTKFG45ANCNFSM43IHKYBA&data=04%7C01%7Cjhalleux%40microsoft.com%7Cc93a8e8d324f4456381f08d9064669f0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637547721761490393%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UK1RslRwXbu7hV57NSJGZXGD%2BvX6w9UUFVY8Gvcgok0%3D&reserved=0.

jamesadevine commented 3 years ago

Jacdac site drops connection to the micro:bit and does not try to reconnect. Will add the dbg flag!

jamesadevine commented 3 years ago
usb: exchange address: 0x200063e8; irqn=12
bus.ts:206 bus: connect USB connected Object
three.module.js:18162 THREE.WebGLRenderer: Context Lost.
transport.ts:195 error USB device "BBC micro:bit CMSIS-DAP" (bad response, 0 != 14 && 0 != 1)
Error: device "BBC micro:bit CMSIS-DAP" (bad response, 0 != 14 && 0 != 1)
    at Transport.error (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:45415:18)
    at CMSISProto.error (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:44050:78)
    at _callee9$ (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:44672:73)
    at tryCatch (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:49952:40)
    at Generator.invoke [as _invoke] (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:50182:22)
    at Generator.next (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:50007:21)
    at asyncGeneratorStep (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:77:24)
    at _next (https://microsoft.github.io/jacdac-docs/app-e8ed9929e852189e1d46.js:99:9)
errorHandler @ transport.ts:195
transport.onError @ usb.ts:103
error @ hf2.ts:200
error @ microbit.ts:59
_callee9$ @ microbit.ts:331
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ utils.ts:238
(anonymous) @ utils.ts:249
enqueue @ utils.ts:227
_callee10$ @ microbit.ts:314
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
writeWords @ microbit.ts:19
writeWord @ microbit.ts:426
_callee4$ @ microbit.ts:190
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
eventsource.ts:117 {context: "USB", exception: Error: device "BBC micro:bit CMSIS-DAP" (bad response, 0 != 14 && 0 != 1)
    at Transport.error (h…}
emit @ eventsource.ts:117
errorHandler @ transport.ts:198
transport.onError @ usb.ts:103
error @ hf2.ts:200
error @ microbit.ts:59
_callee9$ @ microbit.ts:331
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ utils.ts:238
(anonymous) @ utils.ts:249
enqueue @ utils.ts:227
_callee10$ @ microbit.ts:314
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
writeWords @ microbit.ts:19
writeWord @ microbit.ts:426
_callee4$ @ microbit.ts:190
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
three.module.js:18162 THREE.WebGLRenderer: Context Lost.
pelikhan commented 3 years ago

Fixed by https://github.com/microsoft/jacdac-docs/commit/a1ecd4cd63f02c9a88fa9f553be1157fe7a35ad4