Nordic Semiconductor provide Node.js library to handle the Bluetooth connection between Thingy:52 and Raspberry Pi or any other Linux based systems.
# Installation
- Download Node.js Armv7 for Raspbian and Binux Binaries (x64) for for Linux system
- Check Node.js and npm version
node -v npm -v
- Install noble-device
npm install noble-device
- Install thingy52 package
npm install thingy52
- Install node version manager and downgrade node to v 8.9.0
sudo npm install -g n sudo n 8.9.0
- Install bluetooth socket
sudo npm install bluetooth-hci-socket --unsafe-perm
- Find examples in following directory
cd node_modules/thingy52/examples
# Examples
A few examples like reading environment sensor data, reading button presses, color sensor calibration, connecting Thingy to Firebase and more can be found in the examples folder.
To run the examples, you must install required npm packages. Open the radio.js example file and find the required packages.
var Thingy = require('../index');
require('console.table');
var enabled;
Install required npm packages.
npm install console.table
Run radio.js example.
sudo node motion.js
To specify Thingy for connection, use option '-a' and UUID.
sudo node motion.js -a xxxxxxxxxxxxxxx
Check motion sensor data on the screen.
'Research > Embedded System' 카테고리의 다른 글
Thingy:52 Multiconnection with Raspberry Pi using C (0) | 2021.09.21 |
---|---|
Thingy:52 Firmware and BLE Services (0) | 2021.09.21 |
Nordic Thingy:52 Hardware and Features (0) | 2021.09.20 |