Bluefy connection to watch or puck.js #7983
|
I'm trying to connect to watch with Bluefy and I can see the device and select it and then it connects for second and then it disconnects. BLuefy doesn't give any error message. This happens with watch and puck.js. If I try to connect to ide I get error: "connection Failed: TypeError: JSON.stringify cannot serialize cyclic structures." So I don't know who doesn't want to speak: espurino or bluefy. Everything works fine with WebBLE, but they don't develop it forward and it has a lot of bugs. |
Replies: 1 comment 3 replies
|
Which pages are you trying to connect with? Obviously the IDE, but the other one you were having trouble with was https://banglejs.com/apps/ ? What about https://espruino.github.io/EspruinoWebTools/examples/uart.html which is a really basic test of Web Bluetooth? I haven't heard of issues before. There are other iOS browsers (they seem to come and go) like https://apps.apple.com/us/app/ble-link-web-ble-browser/id6468414672 that might behave better. If WebBLE (and normal browsers outside iOS) work I'd be tempted to blame Bluefy. If you could get the console logs somehow I could look and see if that JSON.stringify error came from our code and whether there's something that could be done to fix it on our side... |
Please can you try https://espruino.github.io/EspruinoWebTools/examples/uart.html and the Web IDE now?
I had a quick look and I spotted that when connecting all the espruino libraries use
JSON.stringifyto output some log messages (which aren't even shown by default anyway), and if Bluefy output a circular structure for the charactertistics (which is likely) then it would fail and cause the error.I've attempted to fix it now so it'd be interesting to see if it works.