Comments: Logging Data to Google Sheets with the Tessel 2
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
If you've found an issue with this tutorial content, please send us your feedback!
Thanks for a great tutorial, very excited about it, but running into some errors. I'm not sure of the date of this tutorial, maybe the code does not work these days? I'm using node.js 6.11.4 on lates osx.
When running <$ t2 run bmeTest.js> I get an error. <BEGIN TERM> INFO Running bmeTest.js... 1508218909308 Available Tessel 2 (tessy)
Socket: Error occurred: Error: connect EAGAIN /var/run/tessel/port_a 1508218909500 Connected Tessel 2 (tessy)
1508218909553 Repl Initialized
Error: Socket: The Port socket has closed. at Socket.Port.sock.on (/usr/lib/node/tessel-export.js:337:15) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at Pipe._handle.close [as _onclose] (net.js:497:12) <END TERM>
When I run <$ t2 run bmeTest.js --lan> it seems to run but there is not data, just an empty prompt
<BEGIN TERM> INFO Running bmeTest.js... 1508217927430 Available Tessel 2 (tessy)
1508217927597 Connected Tessel 2 (tessy)
1508217927673 Repl Initialized
So I figured maybe it was something about the connection (even though I verified it with t2 wifi and see a connection) and moved on to logging data with usb, figuring that might work, still no dice. I double checked the code, ran <$t2 init> again, still I consistently get the same error <BEGIN TERM> INFO Running usbLog.js... 1508219281268 Available Tessel 2 (tessy)
/tmp/remote-script/usbLog.js:1 (function (exports, require, module, __filename, __dirname) { var e,r,o=require("fs"),n=require("johnny-five"),i=require("tessel-io"),t=new n.Board({io:new i}),l=new Date,a="/mnt/dev/sda0/"+l.now()+".csv",g="";o.appendFileSync(a,headString,e=>{e&&console.log("error setting up log file!")}),t.on("ready",()=>{new n.Multi({controller:"BME280",freq:15e3}).on("data",()=>{e=this.thermometer.fahrenheit,r=this.hygometer.relativeHumidity,g=l.toISOString()+","+e+","+r+","+moisture+"\n",o.appendFileSync(a,logSting,e=>{e?console.log("error logging to file!"):g=""})})}); ^
TypeError: l.now is not a function at Object.<anonymous> (/tmp/remote-script/usbLog.js:1:193) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:390:7) at startup (bootstrap_node.js:150:9) at bootstrap_node.js:505:3 <END TERM>
Any thoughts are appreciated.