-
• #2
You mean using the Puck.js library? (source at https://github.com/espruino/EspruinoWebTools/blob/master/puck.js)
I believe you can use
Puck. /getConnection()
to get the currently active connection (you can usePuck.connect
if not) and then you can doconnection.on('close', function(d) { ... })
on that? -
• #3
Hi Gordon,
Thanks for the hint, we have finally managed it by doing some modifications in our fork:
https://github.com/asterics/EspruinoWebToolsYour Espruino devices and the fact that you can easily program then via Web Bluetooth and Javascript are really awesome. This enables also a lot of possibilities for people with disabilities in combination with our AAC software AsTeRICS Grid.
We have added a UART action which allows to communicate with your devices and enable interfacing accessible toys or using the puckmote webpage and the IR-database to do environmental control for people with disabilities:
https://www.asterics.eu/manuals/asterics-grid/05_actions.html#uart-actionWe will also use new feature this week in a series of workshops in Nairobi in Kenia.
I would be happy, if you could share the AsTeRICS Grid integration also in your platforms.Thanks
Martin -
• #4
Hi,
That's great! It's really good to see it used for this kind of thing.
It looks like the changes in your fork aren't something I could pull back as they delete a bunch of stuff and change the API, but if you did want to contribute something back that added
connectBluetooth/etc
without changing the rest then I'd be happy to pull that in. -
• #5
Hi,
Oh, I was primarily thinking of adding a tutorial about accessibility use cases to the puck-js documentation.
Here are 2 documented tutorials:
https://www.asterics.eu/manuals/asterics-grid/514_uart-action-tutorials.html#uart-action-tutorialsIt's up to you!
Martin
Hi,
I am trying to add puckjs support for the Open Source AsTeRICS Grid AAC software in order to have an IR device or to remote controll battery-powerd toys using the FET output (see PR#340).
Is there a way to handle bluetooth disconnect or write error when using
Puck.write
function?I would like to notify the user in such a case and maybe trigger a reconnect.
I also tried to use
Puck.connect()
, but this always forces me to reconnect to the device. If there was a previous successful connection, I would like to reuse it, not having to ask the user again.Thanks for you help.