I2C_Scanner no header no protocol

I modified Adafruit's servo demo program, which controls servos through a shield connected over I2C.

The program loads and runs in Arduino 2, but the serial monitor is being buggy, so I tried to run it in Arduino 1, and it's giving me the following error:
Leaving...
Hard resetting via RTS pin...
Invalid library found in XXXX\Arduino\libraries\I2C_scanner: no headers files (.h) found in XXX\Arduino\libraries\I2C_scanner

So I followed the path, and the header was there. So I tried deleting it, and just reinstalling the library, but when I try to install the I2C_Scanner library it says "no protocol" in the library window, and spits out all the below in the serial window.

I went back to Arduino 2, to see if I could find where it was getting it's I2C-Scanner from, and it doesn't even have the I2C_Scanner library installed, and when I try to install it nothing happens. So I have no clue why it's running on Arduino 2, but not Arduino 1.

Any help on how to manually add this library back or fix this "no protocol" error would be much appreciated.

Thanks
-R

 no protocol: 
java.lang.RuntimeException: java.net.MalformedURLException: no protocol: 
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:250)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.MalformedURLException: no protocol: 
	at java.net.URL.<init>(URL.java:593)
	at java.net.URL.<init>(URL.java:490)
	at java.net.URL.<init>(URL.java:439)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:64)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:60)
	at cc.arduino.contributions.libraries.LibraryInstaller.performInstall(LibraryInstaller.java:155)
	at cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:125)
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:240)
	... 1 more

Arduino1 Arduino2 ?

Arduino IDE 1.8 and Arduino IDE 2.0

I don't heard last News, but I think I2C_scanner Sketch has no lib, exept Wire.h of course. Are you able to reveal more info about your setup?

// --------------------------------------

// i2c_scanner

//

// Version 1

//    This program (or code that looks like it)

//    can be found in many places.

//    For example on the Arduino.cc forum.

//    The original author is not know.

// Version 2, Juni 2012, Using Arduino 1.0.1

//     Adapted to be as simple as possible by Arduino.cc user Krodal

// Version 3, Feb 26  2013

//    V3 by louarnold

// Version 4, March 3, 2013, Using Arduino 1.0.3

//    by Arduino.cc user Krodal.

//    Changes by louarnold removed.

//    Scanning addresses changed from 0...127 to 1...119,

//    according to the i2c scanner by Nick Gammon

//    https://www.gammon.com.au/forum/?id=10896

// Version 5, March 28, 2013

//    As version 4, but address scans now to 127.

//    A sensor seems to use address 120.

// Version 6, November 27, 2015.

//    Added waiting for the Leonardo serial communication.

//

//

// This sketch tests the standard 7-bit addresses

// Devices with higher bit address might not be seen properly.

//

 

#include <Wire.h>

 

 

void setup()

{

  Wire.begin();

 

  Serial.begin(9600);

  while (!Serial);             // Leonardo: wait for serial monitor

  Serial.println("\nI2C Scanner");

}

 

 

void loop()

{

  byte error, address;

  int nDevices;

 

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

 

  nDevices = 0;

  for(address = 1; address < 127; address++ )

  {

    // The i2c_scanner uses the return value of

    // the Write.endTransmisstion to see if

    // a device did acknowledge to the 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

}


Hi @rbwood. Please provide a detailed set of instructions we can follow to reproduce this error. The description as it is now is simply to vague to serve as an effective starting point for the investigation.

And magically it fixed itself.

I went to load it again so I could copy the entire output window for you, and this time (probably the 10th time I've tried loading it today) it loaded and ran just fine in Arduino 1.8. I didn't change a single thing, that I'm aware of.

It is not so satisfying as tracking down the cause of the error, but I guess we should just be happy that the problem solved itself!

If it comes back again, please let us know.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.