Shop OBEX P1 Docs P2 Docs Learn Events
Raspberry Pi, PI4J, I2C, IOException, Invalid argument using module MS5607 — Parallax Forums

Raspberry Pi, PI4J, I2C, IOException, Invalid argument using module MS5607

Hello I cannot send a RESET command to the module, this should be simple.

I have tried module swap (got 3) and nothing changed. Other I2C module such as BME280 works. Checked all the voltages and they are OK. This is the code (extracts) and error message

// Parallax Device I2C MS5607 I2C address
public static final int MS5607_WRITE_ADDR = 0xEE;
public static final int MS5607_READ_ADDR = 0xEF;

// Parallax Device I2C MS5607 chip commands
public static final byte MS5607_CMD_RESET = (byte) 0x1E; // ADC reset command

try {

ms5607DeviceWriter = i2cSensorBus.getDevice(MS5607_WRITE_ADDR);
ms5607DeviceReader = i2cSensorBus.getDevice(MS5607_READ_ADDR);

} catch (IOException e) {
System.err.println(RED + systemDateFormat.format(new Date()) + " " + "--> <ERROR> Unable to find MS5607 device" + RESET);
System.err.println(RED + "--> <ERROR> " + e.getMessage() + RESET);
}

// MS5607
try {
System.out.println("******************************************************");
System.out.println("MS-5607 attempt RESET");
ms5607DeviceWriter.write(MS5607_CMD_RESET);
System.out.println(GREEN + "MS-5607 RESET successful" + RESET);
sleep(10); // from C code, wait 3 ms but chose 10ms

} catch (IOException e) {
System.err.println(RED + systemDateFormat.format(new Date()) + " " + "--> <ERROR> Unable to reset MS5607 device" + RESET);
System.err.println(RED + "--> <ERROR> " + e.getMessage() + RESET);
}
The output at runtime:

MS-5607 attempt RESET
2018-09-18 20:18:23 --> Unable to reset MS5607 device
--> Invalid argument

I am unable to find what is wrong. The PI4J documentation indicates void return and byte as a parameter.

Any idea??

Comments

Sign In or Register to comment.