@thedannicraft/wiresense
v1.0.6
Published
Client libary for Wiresense
Downloads
1
Readme
Client libary for Wiresense
🛠️Features
- Send data to the wiresense frontend
- Works with almost every sensor
- Automaticly saved data into csv files
📖Usage
Install the libary with npm:
npm install @thedannicraft/wiresense
Import the libary and configure it
const { Wiresense } = require('@thedannicraft/wiresense');
Wiresense.config({
port: 8080
});
Setup a new sensor (group)
function readSensor() {
// Replace with you actual sensor reading logic
return {
Pressure: Math.random(),
Humidity: Math.random(),
Temperature: Math.random()
};
}
const mySensor = new Wiresense('Fake-BME280', readSensorData, './data/sensor_data.csv');
Execute a sensor (Send to frontend and save to file)
mySensor.execute();