cc2uart -- node-cc2540
node.js support for the TI CC2540 UART service. The CC2540 is programmable so there is no guarantee this works with all boards with the CC2540 chip.
This module is built on noble so it should work where ever noble works.
See also nrfuart if using the nRF8001 or nRF51822 chip.
A USB to Bluetooth 4.0 gadget similar to this is required to add BLE support to systems without Bluetooth 4.0/BLE hardware.
Laptop running Ubuntu Linux 14.04
Laptop running Ubuntu 14.04 <-> BLE <-> CC2540 <-> Arduino Uno
Ubuntu 14.04 includes bluez 4.101 which is sufficient for this module. Install the following packages before installing cc2uart.
sudo apt-get install bluetooth bluez-utils libbluetooth-dev
Raspberry Pi running Raspbian Linux
The tested device is a Raspberry Pi Model B running a fresh installation of Raspian release 2015-02-16. Be sure to do the usual post-installation steps such as "sudo apt-get update", "sudo apt-get upgrade", and "sudo raspi-config".
The next step is to install node.js. The version of node.js in the Raspian repo is too old so install a recent version.
wget http://node-arm.herokuapp.com/node_0.10.36_armhf.debsudo dpkg -i node_0.10.36_armhf.deb
Install bluez 4.99 from the Raspian repo. Testing has shown this version works with BLE and noble. This is much easier and faster than install bluez 5.x from source code.
sudo apt-get install bluez bluez-tools libbluetooth-dev
If bluez 4.99 does not work, remove it then install bluez 5.x as described below. Remember, do the next block of commands only if BLE is not working.
sudo apt-get remove bluez bluez-tools libbluetooth-dev# Reference:sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev \libical-dev libreadline-dev libudev-dev libusb-dev makemkdir bluezcd bluezwget https://www.kernel.org/pub/linux/bluetooth/bluez-5.28.tar.xztar xf bluez-5.28.tar.xzcd bluez-5.28./configure --disable-systemd --enable-library# The next step takes a long time.makesudo make installsudo hciconfig hci0 up
Install this module
npm install cc2uart
Use this module
This program sends a test pattern and displays anything that comes back.
var cc2uart = ;cc2uart;