I have a panel of 6 Rainbowduinos. Each Rainbowduino has an 8x8 tricolor LED panel with a ATMega chip that you can program just like a regular Arduino. I have a master Arduino that drives it as a clock display. Clock

In addition to showing the time I also pull weather data from a NOAA site. This has been running reliably for the last 4 years or so. I want to use other sources but I have squeezed all I can into the RAM of the Duemilanove. I would like to use a Pi 2 to drive the displays... preferably with node.js.

I have a sample node.js program and WiringPi program sending messages to the 6 panels. Unfortunately, I am getting failures (errno 5) between 5% and 10% of the time with both programs. 90% of the time it works fine and the panel displays the right image. I recently picked up a level converter to eliminate any possible voltage issues but it makes no difference.

I drive the display pretty quickly with the Duemilanove but so far I only send about 1 or two messages per second with the Pi2.

This is a snippet from the WiringPi program:

      unsigned char RainbowCMD[8] = { 0x48, 0x08, 0x03, 0x00, 0x00, 0x0f, 0x00, 0x00 };

      i2cfd = wiringPiI2CSetup(4);
      printf("i2cfd = %d, errno = %d\n", i2cfd, errno);


      errno = 0;
      result = write(i2cfd, RainbowCMD, 8);
      printf("write returned %d, errno = %d\n", result, errno);

I have read other posts from people with i2c issues but nothing helped.

Has anyone had experience with anything like this before. Any tips for reliable i2c communications from the Raspberry Pi.

  • 2
    I2C works fine on the Pi. If anything the underlying software is more reliable than that used on Arduinos. The obvious difference is the Pi's I2C buses are 3V3 rather than the 5V typically used by Arduinos. I/O errors are invariably down to wiring. – joan Jan 3 '16 at 23:21
  • 1
    You might also consider using the native system (i.e., kernel driven) interface to I2C. I don't have any particular reason to consider the wiringPi one worse, but OTOH there is no reason to use it here other than perhaps its familiarity coding wise to an Arduino interface. Investigate joan's premise first. – goldilocks Jan 4 '16 at 2:01
  • 1
    Thanks for the suggestions. From my [reading] (blog.adafruit.com/2014/02/21/…) the Pi can talk directly to an Arduino. I suspected this could be a problem so I tried a 3.3v to 5v level converter but saw the same 5-10% error rate. – ktf Jan 5 '16 at 12:50
  • 1
    One more thing, I left the program running overnight and in the morning the panel had locked up. Same with the node.js program. The Arduino master I had been using is rock solid running for months without a glitch. This made me suspect the wiring but as I said, the level converter yielded the same result. – ktf Jan 5 '16 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.