-
• #2
The simple answer is no - you have the same problem with any BLE device.
Having TCP/IP networking over BLE isn't part of the standard enough that your computer will have a 'bridge' to connect BLE to your computer's network connection pre-installed.
The simplest way to get one would be to follow the instructions here and set one up on a Raspberry Pi: http://www.espruino.com/Puck.js+Node-RED
The sort of thing you're doing would then work - however you'd be better starting off with the
ble_http
example code as I'm pretty sure what you have there isn't right.Or if you're running node.js in your PC, you could use the
noble
library to receive BLE advertising packets, and could then just set your Puck up to change advertising data when the button was pressed - that'd be pretty much the standard way to do it.... although you would probably want to buy a USB BLE adaptor, as 'noble' wants full control of it when running, and you might still want Windows to be able to access BLE.
eventually Puck.js will support Bonding, which will allow you to use it as a BLE Keyboard with windows - when that happens that'd be by far the easiest way to get notified when something happens!
What i'd like to achieve is setting the puck button press as a notifyer to my laptop.
I'm running a simples web server on
http://127.0.0.1/5555/notify
And have tried
The error i'm seeing in the terminal is:
I'll freely admit i'm hacking from various examples and code so i'm not supprised it's not working ..
Is there an approach from the puck that would send a HTTP request to the paired host?