-
Hi Gordon,
I am keen to avoid using a phone but that does look like a neat solution.
Setting those environment variables in a CMD prompt did not change anything.
I noticed a slight discrepancy
you quoted BLUETOOTH_HCI_SOCKET_USB_PID=0x21e8 but Zadig shows a slightly different address so I also tried PID=0x21e6 both as an environment variable and in USB.js. But still no joy.
Two qns: does your IDE report back if no compatible adaptors are found like node-Bluetooth-hci-socket code does?79 if (!this._usbDevice) { 80 throw new Error('No compatible
USB Bluetooth 4.0 device found!'); 81 }Are you aware of any Live CDs that are likely to work with BLE with minimal config? I figure this might help prove the capabilities of the device.
James -
-
Hi all,
Are there any updates to the above issues?
basically I’m having similar difficulty connecting a puck to my Windows 7 desktop with its inbuilt Broadcom Bluetooth adaptor.
I have downloaded what I think is the native Espruino IDE and have used the Zadig tool as shown below but when I click Connect I am not finding any devices.
I have also tried editing the usb.js file as suggested but no change noticed.
See below for screenshots:
Am I trying to achieve the impossible with Windows 7?James
-
I have an idea to use two Puck.js devices as a rudimentary remote temperature monitoring system.
The two pucks would be located within about 4 metres of each other. The sensor puck will not be easily accessible once installed but the monitoring puck will obviously need to be visible. Precision is not important in this application but I envisage some form of regular heartbeat to provide reassurance that the sensor puck and the monitoring puck are working and a red flash when the measured temperature is above a set level.Has anyone already done anything similar that they would be happy to share?
Tnx
-
-
-
Nice graph - says it all:-)
I have to say that the three pucks I have currently tested are only consistent to within +- 3 degrees of each other at best. This is worse that I was expecting so I will be investing use of a DS18B20 when I find some time to do this. I was wondering whether this might be due to small differences in the config of each. Eg one may not have had its firmware updated yet. One may have had other code loaded previously. -
@jschappet it looks like you are attempting to update the firmware for eeb8 using the CLI? I am not sure if this is supported yet for puck.js. The method that does work as @Ollie says is to download the latest firmware to your phone and then (while the puck is in update mode) use nRF Toolbox app in DFU mode as described elsewhere in this forum.
-
I am reading temps using gatttool but because I have to connect to do this I suspect a purist would point out that this is not Low Energy yet. For that I plan to explore use of Node Red over the holiday but in the meantime, has anyone got broadcasts working? If so, what mobile app or tools are you using to view the advertising? Are you able to post a screenshot?
-
-
Sadly this is not working on my Samsung Galaxy 4 Ace (Model SM-G357F) which runs Android 4.4.4. This phone runs some Android apps that must use similar functions eg. nRF Uart and Bluefruit LE but I have encountered issues that prevent me using nRF Toolbox and some other BLE related apps. I will however mention on the droidscript forum too.
-
-
@MaBe, many thanks for those examples. Really helpful. Worked second time of asking. Weirdly copy / pasting into nano and uploading via CLI on Raspberry resulted in the error below which seen before but luckily the example was easy to retype.
I don't have access to bluefruit but was then able to test the code using the bluez command gatttool to query the characteristic 0x2A6E which responded with '31 39 2e 32 35' which is 19.25 in ascii. The puck was in the warm so it is a sensible result. (This puck stopped working after it got to a temperature of -32 degrees in my freezer but has now recovered)
This is gatttool in action:
pi@raspberrypi:~/puck $ gatttool -I -b F2:91:92:05:39:CE -t random [F2:91:92:05:39:CE][LE]> connect Attempting to connect to F2:91:92:05:39:CE Connection successful [F2:91:92:05:39:CE][LE]> char-read-uuid 0x2A6E handle: 0x0013 value: 31 39 2e 32 35 [F2:91:92:05:39:CE][LE]> disconnect
Here is the error encounted after cut/pasting the code.
Connected Acorn parse for plugins/compiler.js failed.<br/>Check the editor window for syntax errors undefined:44 utf8.encode(c).split('').forEach(function(c) { ^ ReferenceError: utf8 is not defined at escapeChar (eval at loadJS (/usr/lib/node_modules/espruino/index.js:10:10), <anonymous>:44:5) .....
-
I want to monitor the temperature one of my pucks. It is now installed in my freezer.
Initially I wanted to do this monitoring from a RaspberryPi v3 running Jessie which is about 4m behind the freezer through a wall but I would prefer the temp to be broadcast via BLE so that this sensor is readable by tools such as gatttool on the RaspberryPi and other devices that support BLE eg my Android phone.So far I can (1) connect to it from my Raspberrypi using CLI....
pi@raspberrypi:~ $ espruino -p f2:91:92:05:xx:xx Espruino Command-line Tool 0.0.26 Connecting to 'f2:91:92:05:39:ce' Connected
and (2) read the temperature using the built in function E.getTemperature()
>console.log("Temp is "+E.getTemperature()+"°C"); Temp is -26.5°C =undefined >
Now that I know the radio transmission path is OK and the sensor is working the next challenge is to get this puck broadcasting the temp. To maximise battery life I don't want to connect to the puck each time I want a temperature reading; instead I would like to receive data over BLE like a beacon.
Has anyone cracked sensor readings from the puck using the BLE broadcast features?
TIA
-
Cool. I like it. Will recruit all nearby pucks:-)
Suggest that as well as being aware of versions it might benefit from 2 things:- A simple white list and/or blacklist to limit pucks of interest( perhaps with wildcard *)
- Ability to password protect each puck at the same time to prevent others from capturing your pucks in this way.
- A simple white list and/or blacklist to limit pucks of interest( perhaps with wildcard *)
-
Brilliant - That works - I am on a roll now and can get LEDs to come on and off at will.
I wasn't expecting -p to accept the address / name of the puck. Having examined the help for espruiono I was expecting it to be looking for the port eg /dev/ttyAMA0 - I suspect this may catch others out.
If there is more than one puck, espurino seemed unable to connect until I physically removed the first from the room. Is it possible that espurino may not always be disconnecting or do I need to send a disconnect command?I also notice that, unlike bash, when sending commands from in the CLI the cursor must be at the end of the line. This may also catch others out until they realise what's happening.
Thanks for getting me started - I hope this helps others on this journey too.
-
You could also run espruino --list --verbose and see if any errors get
reported - Noble might be trying to say that there was some error - or
it's possible that NPM totally failed to install Noble at all.Ah - that verbose switch was useful - that's exactly what's happening. Have tried repeating the install steps to no avail. Have tried apt-get update + upgrade. Have also tried npm rebuild.
I am not sure if the error referencing 'Acorn Library' is important but the following error stating noble could not be loaded and the following error about 'binding.node' look more significant. Any ideas how I can resolve this?Error: The module '/usr/lib/node_modules/espruino/node_modules/bluetooth-hci-socket/build/Release/binding.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 48. This version of Node.js requires NODE_MODULE_VERSION 51. Please try re-compiling or re-installing
Grateful for any advice on how I could have sorted this in an orderly way but in the meantime I seem to have fixed this after a number of npm rebuild attempts and strangely a reboot.
espruino --list Espruino Command-line Tool 0.0.26 ----------------------------------- PORTS: f2:91:92:05:39:xx (Puck.js 39xx) fe:ec:68:7b:6e:xx (Puck.js 6exx)
Now off to find out how I control which of these 2 pucks I am connecting to.
-
Gordon,
I have run that line of code but have since reinstalled espurino so will do it again tonight.
Also sudo hcitool lescan is finding Bluetooth devices including Pucks so I am confident that the Pi 3 hardware is OK.
I can see that there is lots of reference information here about the API and a number of example code snippits. Maybe I have missed something but what I haven't found and feel may be missing is some fundamentals about how I will then be able to interact with these pucks through the CLI. The detail will of course depend on what I want to do but as a starter for 10 I would like to be able to do some simple things like:- Connect to a puck and Disconnect
- Check the battery level interactively
- Activate LEDs interactively
- Upload a simple code module to for example make LED flash in response to button press
Thanks in advance
James - Connect to a puck and Disconnect
-
Hi,
I have installed espruino on Raspberry pi as per https://www.espruino.com/Raspberry+Pi+Web+IDE
If I run the CLI with --list then I can see a port.espruino --list PORTS: /dev/ttyAMA0
I can also set this port on startup with
espruino -p /dev/ttyAMA0 Espruino Command-line Tool 0.0.26 -----------------------------------
What can I do next?
James
-
Hi,
I initially misinterpreted the instructions. To clarify, when re-inserting the battery, if you hold down the button when inserting battery the LED goes green until the button is released. The LED then stays red whether the button is pressed or not.While in this state, if I run sudo hcitool lescan on my Raspberry Pi it reports Mac address and DfuTarg.
I flashed my puck.js using NRF Toolbox on an Android 5.0 Phone. The LED went blow whilst it was flashed.
James
Gordon,
Will try U17.04
In the meantime, the Console Tab shows the following: