espruino / EspruinoWebIDE

The Espruino Web IDE - A Chrome Web App for programming Espruino
Apache License 2.0
366 stars 158 forks source link

Bangle.js: Disconnect while getFileList #231

Closed ps-igel closed 3 years ago

ps-igel commented 4 years ago

Yesterday I recorded 2 GPS tracks with the GPS Recording app on the BangleJs. When I tried connecting to it today via the WebIDE it had random disconnects. I rebooted everything, still the same. Also getting the files list did not work properly. Then in the Chrome debug console I saw the following (i spared out all the apps):

\\\\>>> Receiving... index.js:92921 Got "< << [\"\\\"about.app.j< << [\"\\\"about.app.js\\\"\",\"\\\"about.img\\\"\"s\\\"\",\"\\\"about.img\\\"\",\"\\\"about.info\\\"\",\"\\,\"\\\"about.info\\\"\",\"\\\"widbt.wid.js\\\"\",\"\\\"\"widbt.wid.js\\\"\",\"\\\"widbt.info\\\"\",\"\\\"gpswidbt.info\\\"\",\"\\\"gpsinfo.img\\\"\",\"\\\"wclocinfo.img\\\"\",\"\\\"wclock.app.js\\\"\",\"\\\"wclock.app.js\\\"\",\"\\\"wclock.img\\\"\",\"\\\"wclock.ik.img\\\"\",\"\\\"wclock.info\\\"\",\"\\\"hrm.app.jsnfo\\\"\",\"\\\"hrm.app.js\\\"\",\"\\\"hrm.img\\\"\",\"\\\\\"\",\"\\\"hrm.img\\\"\",\"\\\"hrm.info\\\"\",\"\\\"blob\"hrm.info\\\"\",\"\\\"blobclk.app.js\\\"\",\"\\\"bloclk.app.js\\\"\",\"\\\"blobclk.img\\\"\",\"\\\"blobcbclk.img\\\"\",\"\\\"blobclk.info\\\"\",\"\\\"ger-wclk.info\\\"\",\"\\\"ger-wclock.img\\\"\",\"\\\"ger-wlock.img\\\"\",\"\\\"ger-wclock.app.js\\\"\",\"\\\"hclock.app.js\\\"\",\"\\\"toucher.app.j\\\"\",\"\\\"toucher.app.js\\\"\",\"\\\"toucher.setts\\\"\",\"\\\"toucher.settings.js\\\"\",\"\\\"toucheings.js\\\"\",\"\\\"toucher.info\\\"\",\"\\\"toucherr.info\\\"\",\"\\\"toucher.json\\\"\",\"\\\".gpsrc1\\.json\\\"\",\"\\\".gpsrc1\\\\u0001\\\"\",\"\\\".gpsrc1\\u0001\\\"\",\"\\\".gpsrc1\\\\u0002\\\"\",\"\\\".gpsrc\\\\u0002\\\"\",\"\\\".gpsrc1\\\\u0003\\\"\",\"\\\".gpsr1\\\\u0003\\\"\",\"\\\".gpsrc1\\\\u0004\\\"\",\"\\\".gpsc1\\\\u0004\\\"\",\"\\\".gpsrc1\\\\u0005\\\"\",\"\\\".gprc1\\\\u0005\\\"\",\"\\\".gpsrc1\\\\u0006\\\"\",\"\\\".gsrc1\\\\u0006\\\"\",\"\\\".gpsrc1\\\\u0007\\\"\",\"\\\".psrc1\\\\u0007\\\"\",\"\\\".gpsrc2\\\\u0001\\\"\",\"\\\"gpsrc2\\\\u0001\\\"\",\"\\\".gpsrc2\\\\u0002\\\"\",\"\\.gpsrc2\\\\u0002\\\"\",\"\\\".gpsrc2\\\\u0003\\\"\",\"\".gpsrc2\\\\u0003\\\"\",\"\\\".gpsrc2\\\\u0004\\\"\",\\\".gpsrc2\\\\u0004\\\"\",\"\\\".gpsrc2\\\\u0005\\\"\"\"\\\".gpsrc2\\\\u0005\\\"\",\"\\\".gpsrc2\\\\u0006\\\",\"\\\".gpsrc2\\\\u0006\\\"\",\"\\\".gpsrc2\\\\u0007\\\",\"\\\".gpsrc2\\\\u0007\\\"\",\"\\\".gpsrc2\\\\b\\\"\",\"\",\"\\\".gpsrc2\\\\b\\\"\",\"\\\".gpsrc2\\\\t\\\"\",\"\\\"\"\\\".gpsrc2\\\\t\\\"\",\"\\\".gpsrc2\\\\n\\\"\",\"\\\".gp.gpsrc2\\\\n\\\"\",\"\\\".gpsrc2\\\\u000B\\\"\",\"\\\".gsrc2\\\\u000B\\\"\",\"\\\".gpsrc2\\\\f\\\"\",\"\\\".gpsrpsrc2\\\\f\\\"\",\"\\\".gpsrc2\\\\r\\\"\",\"\\\"gpsrec.jc2\\\\r\\\"\",\"\\\"gpsrec.json\\\"\",\"\\\"setting.jsson\\\"\",\"\\\"setting.json\\\"\"] >> >\r\n>" index.js:92921 >>> index.js:92921 getFileList SyntaxError: **Unexpected token \ in JSON at position 23** at JSON.parse (<anonymous>) at index.js:131389 at nextStep (index.js:93250) at index.js:93235 at index.js:95097 at BluetoothRemoteGATTCharacteristic.<anonymous> (index.js:96006) index.js:92921 BT> Disconnected (gattserverdisconnected) index.js:92921 Disconnect callback... index.js:92926 [notify_warn] Disconnected

Not sure whats up with all these .gpsrc2 files. I deleted the two GPS tracks using the App Loader (because I couldn't access the file list via the WebIDE) and now it seems to work just fine again.

gfwilliams commented 4 years ago

Thanks! I guess it timed out receiving the files. The GPS recorder files use StorageFile which creates a bunch of extra Storage entries to handle creating one big extendable file.

I guess we might need to think about ways of fixing file listings then. Potentially it could just be done with a regex in .list().

gfwilliams commented 3 years ago

Pretty sure this is fixed now