Asked
Resolved Resolved by DJ Sures!

How To Recover Rgb Animator I2c Address

Hi,

I connected two RGB eyes to an EZ-B v4 using the RGB Animator robot skill, and initially, everything was fine. I could animate the LEDs, and both RGBs worked together. Then, I decided to control both RGBs separately. I entered a new address for one RGB but didn't ensure that both RGBs were disconnected during this process. Now, I can't remember the address I assigned (despite the comments advising caution).

Currently, the RGB eyes light up fully blue with a white dot in the middle, regardless of whether I connect one or both RGBs. The behavior is the same.

Is there a way to find out this unknown address? I tried using the RGB Animator settings to set the current address and a new address. If I leave the current address blank and enter 0xA0 for the new address, ARC returns an error. If I try to bypass this by entering an address like 0x05 in the "current address" field and 0xA0 in the "new address" field, ARC shows no error, and a pop-up window tells me it is done. However, the RGBs remain blue, and I can't change anything.

I also tried connecting the RGBs to different ports, but the problem persists. I even tested another EZ-B v4 controller, connected to ARC with only the RGB skill loaded, and encountered the same issue-the RGBs light up blue, and I can't control them.

Since both RGBs exhibit the same behavior, I don't think they are broken.

JP


Related Hardware Roli Rover

ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

PRO
Canada
#9  

Hi JP,Thank you for the update and for trying the provided script.The error code 2 in the Arduino I2C library indicates a "NACK on transmit of address," which means the device did not acknowledge the address sent by the master. This could be due to several reasons, such as incorrect wiring, the device not being powered, or the device not being in a state to accept the address change command.

Let's go through a few troubleshooting steps to address this issue:

Troubleshooting Steps

  1. Check Wiring:

    • Ensure that the SDA and SCL lines are correctly connected to the Arduino (SDA to A4, SCL to A5).
    • Verify that the VCC and GND lines are properly connected to the power supply.
  2. Power Cycle:

    • Disconnect the RGB eye from power for a few minutes and then reconnect it. Sometimes, a power cycle can help reset the device.
  3. Test I2C Communication:

    • Use a simple I2C scanner sketch to verify that the RGB eye is detected on the I2C bus. This will help confirm that the device is properly connected and powered.

I2C Scanner Sketch

Here is a simple I2C scanner sketch to check if the RGB eye is detected on the I2C bus:

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  while (!Serial); // Wait for Serial to be ready
  Serial.println("I2C Scanner");
}

void loop() {
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for (address = 1; address < 127; address++) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address < 16) 
        Serial.print("0");
      Serial.print(address, HEX);
      Serial.println("  !");

      nDevices++;
    } else if (error == 4) {
      Serial.print("Unknown error at address 0x");
      if (address < 16) 
        Serial.print("0");
      Serial.println(address, HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000); // wait 5 seconds for next scan
}

Steps to Execute

  1. Upload the I2C Scanner Sketch:

    • Upload the provided I2C scanner sketch to the Arduino Uno.
  2. Monitor Serial Output:

    • Open the Serial Monitor in the Arduino IDE to see if the RGB eye is detected on the I2C bus.
  3. Verify Address:

    • Note the address detected by the I2C scanner. If the RGB eye is detected, use this address in the changeI2CAddress function.

Modify the Address Change Sketch

If the I2C scanner detects the RGB eye, modify the address change sketch to use the detected address:

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
  while (!Serial); // Wait for Serial to be ready
  Serial.println("Changing I2C Address from detected address to 0xA0");
  changeI2CAddress(0x40, 0xA0); // Use the detected address here
}

void loop() {
  // Nothing to do here
}

void changeI2CAddress(byte currentAddress, byte newAddress) {
  Wire.beginTransmission(currentAddress);
  Wire.write(30 + 3); // Command to change address
  Wire.write(newAddress);
  byte error = Wire.endTransmission();
  if (error == 0) {
    Serial.print("I2C address changed to 0x");
    Serial.println(newAddress, HEX);
  } else {
    Serial.print("Error changing I2C address: ");
    Serial.println(error);
  }
}

Additional Notes

  • Ensure Device is Ready: Make sure the RGB eye is in a state to accept the address change command. Some devices may require specific conditions to be met before accepting address changes.
  • Test with Different Addresses: If resetting to 0xA0 does not work, try resetting to another address within the valid range (e.g., 0x82, 0x84, 0x86, etc.) and see if any of these addresses work.

Please let me know how it goes, and if you need further assistance, we can explore additional troubleshooting steps.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Germany
#10  

@athena @DJ_Sures  Good news, both RGBs are working fine now!  I have not seen a cable mismatch but  i powered off/on 2,3 times the arduino.I ran again the change address script and the i2c scanner. The script found the address 0x50 which is correct according the message from DJ (0xa0 is 8 bit which means 0x50 receives and 0x51 transmits). I plug the rgb and could create frames, no problem. second rgb works fine as well. In the future i will be careful not to use 2 RGBs at the same time . If i need more lights, we must be able to use 2 x iotiny or the rgb 8x8 . Many thanks for your help. Great job!

PRO
Canada
#11  

That's fantastic news! I'm glad to hear that both RGBs are working fine now. Power cycling the Arduino and running the change address script again seems to have resolved the issue. It's great that you were able to find the correct I2C address and get everything working smoothly.

Future Tips

  1. Single Device Configuration: When changing I2C addresses, always ensure only one device is connected to avoid conflicts.
  2. Document Addresses: Keep a record of the I2C addresses you assign to each device to avoid confusion in the future.
  3. Use Multiple Controllers: As you mentioned, using multiple controllers like IoTiny or RGB 8x8 displays can help manage more lights without address conflicts.

Additional Resources

If you have any more questions or need further assistance in the future, feel free to reach out. Happy robot building!

Great job troubleshooting and resolving the issue!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.