New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't use GrovePi Expander and raspi-io together: "Error: EIO: i/o error, write" #65
Comments
That's...strange. If i2cdetect isn't showing it, this sounds like a slightly catastrophic failure, but unfortunately I have no idea why. Some generic troubleshooting tips that might help:
@fivdi do you have any more ideas on what could be causing this? |
Despite the fact that |
@fivdi : I have everything at the defaults (i.e., I started with a clean Raspbian Jessie image). What's the best way to change the baud rate? I can probably try this out later today. :) |
The default baud rate is 100,000. Change it to 10,000 to see if it works. After installing
to:
Note that the Pi needs a reboot for the change to take effect. |
Strangely, I can't reproduce the red RST light on the GrovePI error anymore. I had some bad SD cards, so I maybe that was the cause of it?? But with the baud rate of 10,000 (still Node v4), everything works great, thanks @fivdi and @nebrius ! For the record, this is the code I tested with: var five = require("johnny-five");
var raspi = require('raspi-io');
var board = new five.Board({
io: new raspi()
});
board.on("ready", function() {
var virtual = new five.Board.Virtual(
new five.Expander("GROVEPI")
);
// Plug the Rotary Angle sensor module
// into the Grove Shield's A0 jack
var rotary = new five.Sensor({
pin: "A1",
board: virtual});
// Plug the LED module into the
// Grove Shield's D6 jack. See
// grove-led for more information.
var led = new five.Led({
pin: "D6",
board: virtual});
// Plug the Rotary Angle sensor module
// into the Grove Shield's A0 jack
var rotary = new five.Sensor({pin: "A0", board: virtual});
// Set scaling of the Rotary angle
// sensor's output to 0-255 (8-bit)
// range. Set the LED's brightness
// based on the value of the sensor.
rotary.scale(0, 255).on("change", function() {
led.brightness(this.value);
});
// Plug the LCD module into any of the
// Grove Shield's I2C jacks.
var lcd = new five.LCD({
controller: "JHD1313M1"
});
// Set scaling of the Rotary angle
// sensor's output to 0-255 (8-bit)
// range. Set the LCD's background
// color to a RGB value between
// Red and Violet based on the
// value of the rotary sensor.
rotary.scale(0, 255).on("change", function() {
var r = linear(0xFF, 0x4B, this.value, 0xFF);
var g = linear(0x00, 0x00, this.value, 0xFF);
var b = linear(0x00, 0x82, this.value, 0xFF);
lcd.bgColor(r, g, b);
});
});
// [Linear Interpolation](https://en.wikipedia.org/wiki/Linear_interpolation)
function linear(start, end, step, steps) {
return (end - start) * step / steps + start;
} P.S. If I get around to it, I'll post some examples using the Raspberry Pi + GrovePi because |
sudo node test.js
I still got the same error above. Specs
|
Crossposting for posterity: So this is a thing: rwaldron/johnny-five#1343 (comment). There's a fix out that may fix your issue too. Can you update to the latest version of raspi-i2c (one of raspi-io's dependencies) when you get a chance and let me know if you still see this issue? |
Stack Trace
i2cdetect -y 1
shows the GrovePi at address 0x04Code
...and then:
i2cdetect -y 1
does NOT show the GrovePi anymore :(Specs
The text was updated successfully, but these errors were encountered: