Skip to content
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

MS5xxx example does not work on my ESP8266 12E board #6

Closed
kreativnix opened this issue Jul 11, 2020 · 5 comments
Closed

MS5xxx example does not work on my ESP8266 12E board #6

kreativnix opened this issue Jul 11, 2020 · 5 comments

Comments

@kreativnix
Copy link

I have newly installed Arduino IDE v1.8.13 and downloaded the MS5xxx lib, as I remember from arduinolibraries.info but the example program Simple Server does not run.
I always get "Error connecting..." means can not connect to the sensor.
Because I am not a specialist with this breakout board and not that code master, could you help me what I could do ?
Regards Gerald

@Schm1tz1
Copy link
Owner

Schm1tz1 commented Jul 12, 2020

Hi Gerald,

Looks like the I2C-Connection is not working. I don't know all the details of your setup, but some ideas that might help:

  • Please check hardware first:
    • are the cables you are using ok?
    • are you using the correct I2C pins for your chip? Please double-check the pinout.
  • Start with the most simple example (i.e. Test)

If that still doesn't work, try to scan you I2C-Bus. There is a default I2C-Example from Arduino that performs a scan of all I2C-Addresses or use something like this.
It should find a device and give you the I2C-Address. If that still doesn't find a device, there is something not ok with the chip.

If it finds a device, perfect!
Next step: You have to check that the I2C-Address you are using is correct. I am using default addresses from devices from 2012/2013 in my examples. Sometimes manufacturers change these addresses depending on the version of the chip/board. If you find a different I2C-Address, you can simply set it in you code with the public method setI2Caddr(char aAddr) before using running the connect method.

Example:

MS5xxx sensor(&Wire);
sensor.setI2Caddr(0x42); // change the 0x42 to the I2C address that was found by your scan.

void setup() {
  Serial.begin(9600);
  if(sensor.connect()>0) {
    Serial.println("Error connecting...");
    delay(500);
    setup();
  }
}

Hope that helps - please let me know if that works. I really think the manufacturer changed the address as I could find some forks for the same chip with different address.

Cheers,
Roman

@Schm1tz1
Copy link
Owner

Hi @kreativnix - is there any update on this issue? From my point of view it can be only the I2C-Address and this is not a bug but something that needs to be configured. I have added information on how to change it.

@kreativnix
Copy link
Author

kreativnix commented Jul 31, 2020 via email

@Schm1tz1 Schm1tz1 reopened this Aug 1, 2020
@Schm1tz1
Copy link
Owner

Schm1tz1 commented Aug 1, 2020

Concerning the I2C-Address:
Thanks for the update. From the fork at ImperialSpaceSociety I can also see that obviously the default I2C address was changed by the manufacturer.

Interesting problem, seems a bit strange that is issue is rather new and was not observed before (or at least not reported). I am not aware of any differences using the ESP8266 Wire libraries that might cause this issue. I've been using it with ESP8266 and ESP32 for months without any problems. There must be some small difference in code or a different version of one of the libraries... I have to double-check what changes in code might cause this issue.

Questions @kreativnix: Is the MS5607-master the old version of this library or from a different project? Are you using a MS5607 or some different sensor?

@kreativnix
Copy link
Author

kreativnix commented Aug 1, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants