user115800
Member since Jul 2020 • Last active Aug 2020Most recent activity
-
- 4 comments
- 1,744 views
-
I just wanted to know if it is possible to log data from RuvviTag into a CSV file using Espruino. If any code is available it would help a lot.
This is the code I'm using to print values on the console
const period = 30*60*1000; // milliseconds (every 30 minutes) const length = 200; // number of records (for 100 hours / 4 days) var ruuvi = require("Ruuvitag"); var records = []; function log() { ruuvi.setEnvOn(true); if (records.unshift({time:getTime(),temp:ruuvi.getEnvData().temp}) > length){ records.pop(); } ruuvi.setEnvOn(false); } function getData() { records.forEach( function(d,i) { console.log(i+"\t"+ d.temp +"\t"+ (getTime()-d.time)); }); } ruuvi.setAccelOn(true); setInterval(log, period);
I am using the code available here, https://www.espruino.com/UART.js, to use UART on RuvviTag. According to the uart.js code, it always asks to connect to a bluetooth device. Is there anyway I can modify the code to automatically connect to my RuuviTag?