Tinkerforge Device Manager
A node library to make connecting to and accessing Tinkerforge devices easier. Created at the University of Applied Sciences in Osnabrueck.
Supported Devices
Currently supported Tinkerforge devices:
- Accelerometer Bricklet
- Air Quality Bricklet
- Ambient Light 2.0 Bricklet
- Barometer 1.0 Bricklet
- Barometer 2.0 Bricklet
- C02 Bricklet
- Dust Detector Bricklet
- Distance IR Bricklet
- Distance US Bricklet
- GPS 2.0 Bricklet
- Humidity 2.0 Bricklet
- LCD 128x64 Bricklet
- Motion Detector 2.0 Bricklet
- NFC Bricklet
- OLED 128x64 Display Bricklet
- Outdoor Weather Bricklet
- Piezo Speaker Bricklet
- RGB LED Bricklet
- RGB LED Button Bricklet
- Sound Intensity Bricklet
- Sound Pressure Level Bricklet
- Thermal Imaging Bricklet
- UV Light 1.0 Bricklet
- UV Light 2.0 Bricklet
Example
Consider you have a Humidity V2 Bricklet connected to a Master Brick. You can then use the device manager to get the Humidity V2 Bricklet via its UID or its device identifier. The process is as follows:
- Initialize the device manager (
dm.initialize()
) - Set a callback that is called for each connected device (e.g.
dm.setConnectCallback(start);
) - In
start(device)
you'll have the current device as a wrapper object. Now you can check the type and register listeners (or do anything else)
Here is a full example (see also test.js
):
var dm = ; // You can pass host and port, default is 'localhost' and 4223dm; // This will call start for each enumerated devicedm; { // Check the name of the current device console; // Humidity V2 Bricklet if device == 283 device // Accelerometer Bricklet if device == 250 device // And so on...} { console;} { console;}