sparkfun / SparkFun_Si7021_Arduino_Library

Repo for the SparkFun Si7021 Breakout Arduino library
Other
9 stars 16 forks source link

Not working on Arduino Uno WIFI Rev 2 #4

Closed skuske closed 4 years ago

skuske commented 5 years ago

Working fine of Arduino Uno, but not on Arduino Uno WIFI Rev 2:

/tmp/863800601/custom/SparkFun_Si701_Breakout_Arduino_Library/src/SparkFun_Si7021_Breakout_Library.cpp: In member function 'uint16_t Weather::makeMeasurment(uint8_t)':

/tmp/863800601/custom/SparkFun_Si701_Breakout_Arduino_Library/src/SparkFun_Si7021_Breakout_Library.cpp:200:33: error: call of overloaded 'requestFrom(int, uint16_t&)' is ambiguous

Wire.requestFrom(ADDRESS,nBytes);

^

In file included from /tmp/863800601/custom/SparkFun_Si701_Breakout_Arduino_Library/src/SparkFun_Si7021_Breakout_Library.cpp:34:0:

/home/ubuntu/opt/cores/arduino/megaavr/libraries/Wire/src/Wire.h:60:13: note: candidate: virtual uint8_t TwoWire::requestFrom(uint8_t, size_t)

uint8_t requestFrom(uint8_t, size_t);

^

/home/ubuntu/opt/cores/arduino/megaavr/libraries/Wire/src/Wire.h:63:13: note: candidate: uint8_t TwoWire::requestFrom(int, int)

uint8_t requestFrom(int, int);

^

exit status 1 Bildschirmfoto 2019-03-14 um 17 40 20

santaimpersonator commented 4 years ago

Unfortunately, this seems like a compatibility issue. The WiFi Rev 2 uses the AVR mega Arduino core, where the TwoWire library is causing the compilation error. Based on the library example, it was developed with the following specifications:

Development environment specifics:

  • IDE: Particle Dev
  • Hardware Platform: SparkFun RedBoard
    • Arduino IDE 1.6.5

I'll try to bring this up to the engineering team, but this may end up being something that is out of our hands if the TwoWire library is incompatible with the sensor operation.

santaimpersonator commented 4 years ago

Try modifying line 188 from uint16_t nBytes = 3; to int nBytes = 3;. This changes the variable from an unsigned 16-bit integer to just an integer, which seems to be compatable with the AVR mega core. I did a quick test and the code compiles, but I don't have something to easily test if the changes work.

Let me know if that modification works.

reymondRN commented 4 years ago

Intente modificar la línea 188 de uint16_t nBytes = 3;a int nBytes = 3;. Esto cambia la variable de un entero de 16 bits sin signo a solo un entero, que parece ser compatible con el mega núcleo AVR. Hice una prueba rápida y el código se compila, pero no tengo nada para probar fácilmente si los cambios funcionan.

Avíseme si esa modificación funciona.

Si funciona, al menos compila muy bien. este codigo funciona perfecto(solo temperatura y humedad):

include "SparkFun_Si7021_Breakout_Library.h"

include

float humidity = 0; float tempf = 0;

int power = A3; int GND = A2;

//Create Instance of HTU21D or SI7021 temp and humidity sensor and MPL3115A2 barrometric sensor Weather sensor;

//--------------------------------------------------------------- void setup() { Serial.begin(9600); // open serial over USB at 9600 baud

pinMode(power, OUTPUT);
pinMode(GND, OUTPUT);

digitalWrite(power, HIGH);
digitalWrite(GND, LOW);

//Initialize the I2C sensors and ping them
sensor.begin();

} //--------------------------------------------------------------- void loop() { //Get readings from all sensors getWeather(); printInfo(); delay(1000);

} //--------------------------------------------------------------- void getWeather() { // Measure Relative Humidity from the HTU21D or Si7021 humidity = sensor.getRH();

// Measure Temperature from the HTU21D or Si7021 tempf = sensor.getTempF(); // Temperature is measured every time RH is requested. // It is faster, therefore, to read it from previous RH // measurement with getTemp() instead with readTemp() } //--------------------------------------------------------------- void printInfo() { //This function prints the weather data out to the default Serial Port

Serial.print("Temp:"); Serial.print(tempf); Serial.print("F, ");

Serial.print("Humidity:"); Serial.print(humidity); Serial.println("%"); }

reymondRN commented 4 years ago

Al usar esta guía con arduino UNO Wifi R2, no compila al menos que se haga el ajuste que indicó santaimpersonator, cuando compila el código, aparecen lecturas negativas en Presión Barométrica y el anemómetro no funciona

Guia: https://learn.sparkfun.com/tutorials/arduino-weather-shield-hookup-guide-v12/all

santaimpersonator commented 4 years ago

When using this guide with arduino UNO Wifi R2, it does not compile unless the adjustment indicated by santaimpersonator is made, when compiling the code, negative readings appear in Barometric Pressure and the anemometer does not work

@reymondRN

That being said, at the end of that hookup guide we state that the shield is compatible with the RedBoard Photon, which is also a WiFi MCU (if you really need the WIFi functionality).

reymondRN commented 4 years ago

El redboard photon tampoco funciona :( Para esta placa, el problema es el anemometro y pluvionetro que no muestra la mediación. Temperatura, humedad , presión si funciona pero los rj11 no sirven. Ese Shield parece funcionar solo con arduino UNO. Estoy decepcionado.

santaimpersonator commented 4 years ago

The redboard photon doesn't work either :( For this plate, the problem is the anemometer and rain gauge that does not show the mediation. Temperature, humidity, pressure if it works but the rj11 do not work. That Shield seems to work only with arduino UNO. I'm disappointed.

It sounds like this original problem filed for this library had been solved, so I will be closing this issue.

@reymondRN It sounds like you are looking for technical assistance. Please post a topic in our forums. Our technical support team will do their best to assist you there. (This issue was opened in regards to the in regards to the Si701 Arduino library; unfortunately your problem is outside of that scope and should be filed separately.)