don/node-eddystone-beacon

Unhandled 'error' event when running simpleBeacon.js

Closed this issue · 2 comments

Hi,
I was just testing simpleBeacon.js and see how Physical Web works and I am stuck at one point. Could you please point out whre I might be going wrong??
First my configuration:
OS: Ubuntu 12.04 LTS 32 bit
RAM:2GB
Nodejs version: v0.10.33
NPM version: 1.4.28

1)So I basically downloaded the repository using git clone in my home directory:
git clone git clone https://github.com/don/node-uri-beacon.git

2)Changed to directory
cd node-uri-beacon

3)Then I used install command
npm install

4)Then ran test command
npm test
/*************************************************************************************************************************************************************************************************************************************************************

uri-beacon@0.1.1 pretest /home/physicalweb/node-uri-beacon
jshint *.js lib/. test/. examples/.

uri-beacon@0.1.1 test /home/physicalweb/node-uri-beacon
mocha -R spec test/*.js

Advertisement Buffer
✓ should match known message

URI Encoder
✓ should encode URIs
✓ should use first protocol match
✓ should handle unknown protocols
✓ should handle unknown domains
✓ should handle url path
✓ should encode data without a protocol or domain
should substitute known protocols
✓ http
✓ https
✓ tel
✓ mailto
✓ geo
should substitute known domains
✓ com
✓ org
✓ net

15 passing (16ms)


5)Assuming everything is OK, I changed directory to examples
cd examples

6)Ran simpleBeacon.js
sudo nodejs simpleBeacon.js
got following error:


events.js:72
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at errnoException (net.js:904:11)
at Object.afterWrite (net.js:720:19)


Here is log file generated:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'test' ]
2 info using npm@1.4.28
3 info using node@v0.10.33
4 verbose node symlink /usr/bin/node
5 error Error: ENOENT, open '/home/physicalweb/node-uri-beacon/examples/package.json'
6 error If you need help, you may report this entire log,
6 error including the npm and node versions, at:
6 error http://github.com/npm/npm/issues
7 error System Linux 3.2.0-29-generic-pae
8 error command "/usr/bin/node" "/usr/bin/npm" "test"
9 error cwd /home/physicalweb/node-uri-beacon/examples
10 error node -v v0.10.33
11 error npm -v 1.4.28
12 error path /home/physicalweb/node-uri-beacon/examples/package.json
13 error code ENOENT
14 error errno 34
15 verbose exit [ 34, true ]


don commented

@simishu07 I'd guess this is a problem with an old version of bluez or unsupported BLE hardware.

Can you see if you can connect to a BLE device using bluez?

Try something like this

chronos@localhost / $ hcitool dev
Devices:
        hci0    68:AF:FE:BE:B4:60
chronos@localhost / $ sudo hcitool lescan
Password: 
LE Scan ...
E9:0F:90:0F:3B:38 Foo
E9:0F:90:0F:3B:38 (unknown)
78:C5:E5:9A:15:AA (unknown)
78:C5:E5:9A:15:AA Robosmart
5C:F9:38:AF:8E:4D (unknown)
5C:F9:38:AF:8E:4D (unknown)
20:C9:D0:46:D1:C0 Battery
20:C9:D0:46:D1:C0 (unknown)
D0:39:72:C8:CE:1E (unknown)
D0:39:72:C8:CE:1E Bean
84:DD:20:EA:F3:0B (unknown)
84:DD:20:EA:F3:0B df1
^C
chronos@localhost / $ gatttool -b D0:39:72:C8:CE:1E -I
[D0:39:72:C8:CE:1E][LE]> connect
Attempting to connect to D0:39:72:C8:CE:1E
Connection successful
[D0:39:72:C8:CE:1E][LE]> char-desc
handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb
handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb
handle: 0x0003, uuid: f000ffc1-0451-4000-b000-000000000000
[D0:39:72:C8:CE:1E][LE]> ^D
don commented

Assuming Ubuntu 12.04 or bluez was too old. Closing since no response.