Open lyzadanger opened 7 years ago
Update: I've found the underlying source of the problem, generally. I downgraded a Tessel all the way to firmware version 0.0.13. That release's date was May 2016. Release 0.0.14 and after display the broken behavior as documented here.
There's some possibility, then, that I2C support for Tessel via J5/tessel-io has been broken since last September? Is there anyone out there who can help me test this (trying to interact with any I2C sensor device via J5/tessel-io)?
I started working to recreate this issue tonight. I'm using a BME280 from the Johnny-Five Inventor's Kit and the sample code you displayed in the description (using 'BME280' instead of 'BMP180'). I also specifically installed tessel-io
version 0.9.0 as you described and the latest firmware for Tessel.
My code:
const five = require('johnny-five');
const Tessel = require('tessel-io');
const board = new five.Board({
io: new Tessel()
});
board.on("ready", () => {
var monitor = new five.Multi({
controller: "BME280"
});
board.loop(2000, () => {
console.log(monitor.barometer.pressure);
});
console.log("Hey Ho, Let's Go");
});
t2 version
:
hipsterbrown:i2c-test $ t2 version
INFO Looking for your Tessel...
INFO Connected to ava.
INFO Tessel Environment Versions:
INFO t2-cli: 0.1.4
INFO t2-firmware: 0.0.16
INFO Node.js: 4.5.0
Results:
hipsterbrown:i2c-test $ t2 run i2c-test.js
INFO Looking for your Tessel...
INFO Connected to ava.
INFO Building project.
INFO Writing project to RAM on ava (750.08 kB)...
INFO Deployed.
INFO Running i2c-test.js...
1475695004163 Device(s) Tessel 2 (ava)
1475695004321 Connected Tessel 2 (ava)
1475695004379 Repl Initialized
>> Hey Ho, Let's Go
72.984
100.907
100.907
100.907
100.909
100.909
100.909
100.912
100.912
100.912
100.913
100.913
100.913
While it seems to be working for all of my available Tessel boards, I'll continue looking for other I2C sensors to test. I'll also try debugging those specific error message within the t2-firmware
and tessel-io
internals.
Oh, my. I wonder if it could be a combination of the newer firmware and my own system. As I mentioned, I'm on Mac 10.11.6 and have been running various Node.js version (my default system global right now is v6.2.0). Irritatingly, I cannot seem to find my own BME280 (I have one, but it's missing) or I'd test that setup, too.
Maybe I'll try to borrow my partner's laptop (also a Mac) and see if I get the same errors.
@lyzadanger I was working on my home laptop last night, which is running the latest Mac OS. I'll try again tonight with my work laptop, which is running Mac 10.11.6 as well.
How would MacOS version impact remote execution?
@rwaldron No idea, TBH! But I'm trying to grasp at straws as to what makes this reproduce-able...
@lyzadanger fair enough (I didn't know if there was some MacOS update that I had missed that was fucking with USB devices)
Hello!
First and foremost: I am not certain that the issues I am seeing are at the
tessel-io
level, but it seemed the most probable after a long and fruitless debug session, so this is where I'm starting. Happy to move this over tot2-firmware
or elsewhere if that's the culprit.OK, so. I am having a bear of a time with I2C reads and the T2, suddenly (like, I used to be able to use I2C with my Tessels like a boss a few months ago). The majority of my tests are using J5 and J5 component classes for different I2C sensors. I'm not experiencing the absolute same breakage with every sensor, but I cannot currently get a single sensor to work correctly. The problems I am having fall into three areas.
Most commonly, any form of reading via a J5 component object for an I2C sensor is throwing the following error:
Very occasionally this error is not thrown, but any data I'm able to read off of an I2C sensor is invalid—e.g. I'll get constant
0
s on an altimeter, constant32
values forthermometer.F
.Also occasionally I get:
but I have a hunch that latter error may be a symptom of the first.
When I started debugging this, I hoped to hell I had just fried a Tessel. But the bad news is that the behavior I'm observing is consistent across both of my Tessels.
OK, now some details:
node_modules
and reinstall :) )tessel-io
v0.9.0 (vs. 0.10.1)johnny-five
releases (back to 0.10.4)tessel
directly to write to and read from an I2C address. It does not crash (though I haven't taken it far enough to determine whether the data read is particularly valid; running out of time and don't have enough time to write a sensor-specific driver).Here's some brief sample code for a BMP180 that I'm using:
More than 90% of the time this just crashes outright (with the socket error above). On the rare occasions it doesn't, any data read from the BMP180 is invalid. I'm using
board.loop
here because thedata
and/orchange
events on the BMP never fire.I'm at the end of what I can think of to debug this. I'm up against a deadline for a chapter in my book about Tessel and serial so I am anxious at being so deeply entrenched and stuck!