OCS crashing after adding IR component


koal01
 

Hello OCS users !
After months with OCS very stable i decided to add the MLX90614 component yesterday.
At the beginning everything was ok on the website showing values correctly but a few hours later the website has beggining to lag and now it is unreachable.
What process would you choose to debug that ?

Thank you ?
Koal01


Fernando Nino Sr
 

That is exactly what mine did, after three megas,two shields and three pc's, the issue that I discovered was my weather page had an error somewhere in the coding and a bad bme280 sensor.  Might want to look at your coding for the weather.


Howard Dutton
 

On Mon, Oct 12, 2020 at 12:40 AM, koal01 wrote:
What process would you choose to debug that ?
Isolate where the problem lies, first you might try to make the OCS behave as though an MLX is present when it really isn't.  If the problem disappears this is a solid indication the trouble is in the Libraries (Arduino and/or Adafruit MLX.)  If the problem still exists I'd electrically disconnect the MLX to ensure its very presence (even if not active) is not corrupting the I2C bus.  If this second test doesn't make things work again I guess the trouble is likely a bug in the OCS.

Replace:

#include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();  // I2C address 0x5A

// return (invalid) if not implemented or if there's an error
double weatherSkyTemp() {
  if (!skyTempGood) return (invalid);

  double t = mlx.readObjectTempC();
  if (t<-100.0 || t>100.0) t=invalid;
  return t;
}

bool initSkyTemp() {
  mlx.begin();
  return true;
}

With:

// return (invalid) if not implemented or if there's an error
double weatherSkyTemp() {
  if (!skyTempGood) return invalid;
  return 5.0;
}

bool initSkyTemp() {
  return true;
}


koal01
 

Thanks for your answers
I think both tests have already been done.
first you might try to make the OCS behave as though an MLX is present when it really isn't. 
During several months OCS was working with IR code and activated but no IR component was physically plugged. In this case OCS works nicely.

 If the problem still exists I'd electrically disconnect the MLX to ensure its very presence (even if not active) is not corrupting the I2C bus
I wired the MLX on my stable OCS and the website has crashed a few hours later and became unreachable...
As you recommended me i will replace the piece of code in weather ino file to see OCS behavior and let you know

Koal01


koal01
 

Hi, 
I'm not progressing on that weather panel problem since i tried to add physically an MLX sensor to OCS.
I can't make work any sensor.
I launched a debub weather monitor but it is not very verbose :

Debug weather start
OUTSIDE TEMP sense fail
SKY IR sense fail
WINDSPEED sense fail
PRESSURE sense fail
HUMIDITY sense fail
RAIN sense fail
SKY QUAL fail

Any possible way to get more information ?


Howard Dutton
 

On Wed, Oct 21, 2020 at 08:53 AM, koal01 wrote:
Any possible way to get more information ?
The "fail" message means that the init() function for each sensor returned false.  The reason for that depends on what's in the Weather.ino file and what's attached.


koal01
 

Thanks for your answer Howard.
The weather.ino is exactly the same as your observatory example.
What is attached ? IR MLX, SQM 2591, BMP180, temp and humidity sensor S071...
By the way I replaced the mega by a brand new one.
Ocs is behaving as if the i2c interface was not working any more.
I checked the current on one component and I can read 4,96 v. 
Shall I suspect something going wrong on the pcb ? 

A debug mode showing that i2c interface works fine independently from sensors would be nice and very helpful if possible !

Koal01


koal01
 

I'm testing OCS on a bench with debug_weather ON without any sensor connected, only a mega.
I have no error in compiling but two sensors are failing while the respective libraries seem correctly installed (BMP180 and TSL2591)

Debug weather start
OUTSIDE TEMP sense up
SKY IR sense up
WINDSPEED sense up
PRESSURE sense fail
HUMIDITY sense up
RAIN sense up
SKY QUAL fail

Do you confirm Howard that the debug_weather is testing only the software or do i have to wire these two sensors specifically in this mode ?

Thank you 
Koal01


Howard Dutton
 

On Fri, Oct 23, 2020 at 08:28 AM, koal01 wrote:
Debug weather start
OUTSIDE TEMP sense up
SKY IR sense up
WINDSPEED sense up
PRESSURE sense fail
HUMIDITY sense up
RAIN sense up
SKY QUAL fail
What these return depends on the sensor library support for determining if it was detected/init'd successfully.  Most libraries don't support that so success is assumed otherwise.


Howard Dutton
 

You could run an I2C scanner Sketch on the Mega2560 to see what attached devices it finds (each has an unique id number.)


koal01
 

Hi,
I changed the sensor box making a new one with RJ45 female plugs firmly connected and everything is ok now.
I would say it is a 2.0 box ! it has been running for 2 days now with temp, sqm, pressure and humidity sensors
My first box was too small and maybe some water came into it from the IR sensor hole, this one will be in a separate box in the future to avoid this kind of problem.

Thanks for your help !
Koal01


Howard Dutton
 

Great to hear you are back in business!