Date   

Re: New OCS developments

Howard Dutton
 

On Tue, Oct 5, 2021 at 05:34 AM, Fernando Nino Sr wrote:
Got it, thanks Howard
No problem.  The thermostat now has (untested) BME280, BMP280, DHT11/21/22, and Si7021 support.


Re: New OCS developments

Fernando Nino Sr
 

Got it, thanks Howard


Re: New OCS developments

Howard Dutton
 

On Mon, Oct 4, 2021 at 11:34 AM, Fernando Nino Sr wrote:
Just a quick question about the section on Thermostat, is there a reason to use a BME280 instead of the BMP280 or DHT11?  I guess the question for inside the Observatory do we really need the BP?  I have just used Temp and Humidity to turn on my exhaust fan. The coding just ties one sensor to use (BME280) rather than a DHT11 or BMP280

#define THERMOSTAT_SENSOR_TPH_BME280   //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure, humidity.
That isn't done.  My intention is to add the other relevant sensors same as WEATHER has.

Also in this section it does not note which sensor goes with inside or outside use. only one BME280 has the BP, Temp and Humidity. All the others only note Temp and Humidity.
THERMOSTAT is inside.  WEATHER is outside.

#define WEATHER_SENSOR_TPH_BME280     0x76 //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure, humidity.   Option
#define WEATHER_SENSOR_TP_BMP280      0x77 //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure.             Option
#define WEATHER_SENSOR_TH_DHT            OFF //    OFF, n. Where n=1..8 (Sense#) to enable. Temperature, humidity.               Option
#define WEATHER_SENSOR_TH_DHT_TYPE    OFF //  DHT11, or DHT21, DHT22. DHT device type.                                        Option
#define WEATHER_SENSOR_TH_SI7021      OFF //    OFF, 0x40 (I2C Address) to enable. Temperature, humidity.                     Option

If I wanted to use the BME280 for outside is it safe to change the code, example #define WEATHER_SENSOR_TP_BME280 and   #define WEATHER_SENSOR_TPH_BMP280, just switch the sensor coding around, will that cause problems with the rest of the code?
You can't change the #defines there.  If you want an outside BME280 just set it.  The BMP280 being enabled too as you did in the example above shouldn't cause a problem, it just wouldn't do anything (everything TPH being already assigned to the BME280 first.)  Now if you had a BMP280 and a DHT22 enabled it'd assign temperature and pressure to the BMP280 then just humidity to the DHT22.  All of this is for weather/outside and nothing to do with the thermostat.


Re: New OCS developments

Fernando Nino Sr
 

Just a quick question about the section on Thermostat, is there a reason to use a BME280 instead of the BMP280 or DHT11?  I guess the question for inside the Observatory do we really need the BP?  I have just used Temp and Humidity to turn on my exhaust fan. The coding just ties one sensor to use (BME280) rather than a DHT11 or BMP280

#define THERMOSTAT_SENSOR_TPH_BME280   //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure, humidity.

Also in this section it does not note which sensor goes with inside or outside use. only one BME280 has the BP, Temp and Humidity. All the others only note Temp and Humidity.

#define WEATHER_SENSOR_TPH_BME280     0x76 //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure, humidity.   Option
#define WEATHER_SENSOR_TP_BMP280      0x77 //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure.             Option
#define WEATHER_SENSOR_TH_DHT            OFF //    OFF, n. Where n=1..8 (Sense#) to enable. Temperature, humidity.               Option
#define WEATHER_SENSOR_TH_DHT_TYPE    OFF //  DHT11, or DHT21, DHT22. DHT device type.                                        Option
#define WEATHER_SENSOR_TH_SI7021      OFF //    OFF, 0x40 (I2C Address) to enable. Temperature, humidity.                     Option

If I wanted to use the BME280 for outside is it safe to change the code, example #define WEATHER_SENSOR_TP_BME280 and   #define WEATHER_SENSOR_TPH_BMP280, just switch the sensor coding around, will that cause problems with the rest of the code?
Thanks
Nino
 


Re: New OCS developments

Fernando Nino Sr
 

Thanks, I found it. Looks like I need to get a Teensy board. Nicely laid out script. Looks like VS Coding. 


Re: OCS 3 power relays question

Howard Dutton
 

On Mon, Oct 4, 2021 at 03:11 AM, Howard Dutton wrote:
And I wouldn't run this on any real OCS hardware yet.  It's not done.
Let alone tested.


Re: OCS 3 power relays question

Howard Dutton
 

On Sun, Oct 3, 2021 at 03:44 PM, koal01 wrote:
I didn't know i could copy all my Power panel from OCS 2 and paste it to OCS3, nice !
I only changed Config.h settings where required or very desirable.  They were close to what I feel is optimal to start with.

The sensors errors have also disappeared, for the bmp280 after a google research i found guys advicing to add Adafruit_BusIO-master in the library folder, doing this fixed the issue.
As for the MLX i just updated the library and the problem was gone.
Only, the  the Rev-P modern device sensor is still causing errors :
C:\Users\me\AppData\Local\Temp\arduino_build_374851\sketch\src\lib\weatherSensor\WindModernRevP.cpp: In member function 'bool WindRevP::init()':
C:\Users\me\AppData\Local\Temp\arduino_build_374851\sketch\src\lib\weatherSensor\WindModernRevP.cpp:25:59: error: 'windRevPTask' was not declared in this scope
   if (tasks.add(WEATHER_SENSOR_SAMPLE_PERIOD, 0, true, 7, windRevPTask)) {
                                                           ^~~~~~~~~~~~
C:\Users\me\AppData\Local\Temp\arduino_build_374851\sketch\src\lib\weatherSensor\WindModernRevP.cpp:25:59: note: suggested alternative: 'windRevP'
   if (tasks.add(WEATHER_SENSOR_SAMPLE_PERIOD, 0, true, 7, windRevPTask)) {
                                                           ^~~~~~~~~~~~
                                                           windRevP

Good.  I patched the little typo for the RevP compiles now.


Thes ETHERNET_RESET_PIN and CONNECTION_CHECK_HOURS parameters need also some debugging in the extended config.h
I skipped over implementing that on the first pass over the code.

And I wouldn't run this on any real OCS hardware yet.  It's not done.


Re: OCS 3 power relays question

koal01
 

Magical, nearly everything solved.
I didn't know i could copy all my Power panel from OCS 2 and paste it to OCS3, nice !
The sensors errors have also disappeared, for the bmp280 after a google research i found guys advicing to add Adafruit_BusIO-master in the library folder, doing this fixed the issue.
As for the MLX i just updated the library and the problem was gone.
Only, the  the Rev-P modern device sensor is still causing errors :
C:\Users\me\AppData\Local\Temp\arduino_build_374851\sketch\src\lib\weatherSensor\WindModernRevP.cpp: In member function 'bool WindRevP::init()':
C:\Users\me\AppData\Local\Temp\arduino_build_374851\sketch\src\lib\weatherSensor\WindModernRevP.cpp:25:59: error: 'windRevPTask' was not declared in this scope
   if (tasks.add(WEATHER_SENSOR_SAMPLE_PERIOD, 0, true, 7, windRevPTask)) {
                                                           ^~~~~~~~~~~~
C:\Users\me\AppData\Local\Temp\arduino_build_374851\sketch\src\lib\weatherSensor\WindModernRevP.cpp:25:59: note: suggested alternative: 'windRevP'
   if (tasks.add(WEATHER_SENSOR_SAMPLE_PERIOD, 0, true, 7, windRevPTask)) {
                                                           ^~~~~~~~~~~~
                                                           windRevP

Thes ETHERNET_RESET_PIN and CONNECTION_CHECK_HOURS parameters need also some debugging in the extended config.h

Outside it doesn't stop raining, when the weather is better i'll update the mega and let you know

Thank you


Re: OCS 3 power relays question

Howard Dutton
 

On Sat, Oct 2, 2021 at 02:12 PM, koal01 wrote:
Howard, i was using in OCS 2 the power panel in config.h for specific use and i really did like as they relay were named as Device 1, 2, 3 etc..
My shelter is not a standard
In OCS3, the power panel has become a roof panel.
I've scripted many commands to switch on and off my devices in OCS2, in this new version i'm quite lost to use it as i was doing before.
Let me show you as i was using the power panel, the example will certainly be clearer than explanations
I'm not sure what you mean by "scripted" but generally the "Power Panel" works as before.

I did test with your settings and they would crash it though, this was a buffer overflow, the scratchpad for data from flash storage wasn't large enough.  I fixed that and it's better optimized now (smaller memory footprint) and can handle quite large strings before it overflows now (just keep the _NAMES strings <= 40 chars and you should be good.)


Re: OCS 3 compiling error on 2 sensors

Howard Dutton
 

I'm guessing these are both related to your not having the proper libraries installed for the Arduino IDE.

I think you might have realized/fixed this but not sure, at any rate I can enable both of these and it compiles successfully here.


Re: New OCS developments

koal01
 

Hi Fernando ocs 3 is in the master branch


Re: New OCS developments

Fernando Nino Sr
 

Hi Howard, is there a link to the new OCS, I would like to try it on my spare set up. Just checked the GitHub, is the 2.33 version the latest?
Thanks
Nino


Re: OCS 3 power relays question

koal01
 
Edited

Feedback :
The wind sensor RevP is not operational
I also tried to activate ETHERNET_RESET_PIN and CONNECTION_CHECK_HOURS parameters in the extended config.h and the IDE display errors

When these options are not activated the compiling ok, big job ! Nice !
Thanks


OCS 3 power relays question

koal01
 

Howard, i was using in OCS 2 the power panel in config.h for specific use and i really did like as they relay were named as Device 1, 2, 3 etc..
My shelter is not a standard
In OCS3, the power panel has become a roof panel.
I've scripted many commands to switch on and off my devices in OCS2, in this new version i'm quite lost to use it as i was doing before.
Let me show you as i was using the power panel, the example will certainly be clearer than explanations
// POWER PANEL ---------------------------------------------------------------------------------------------------------------------
#define POWER                         ON //    OFF, ON to enable the OCS website power panel display.                        Option
 
#define POWER_DEVICE1_RELAY           1 //    OFF, n. Where n=1..14 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE1_MEMORY          ON //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE1_NAME "OnStep_12V-2A+Hub"
 
#define POWER_DEVICE2_RELAY           2 //    OFF, n. Where n=1..14 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE2_MEMORY          ON //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE2_NAME "Camera_RAF_12V-4A"
 
#define POWER_DEVICE3_RELAY           3 //    OFF, n. Where n=1..14 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE3_MEMORY          ON //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE3_NAME "ReculCabane_12V"
 
#define POWER_DEVICE4_RELAY           4 //    OFF, n. Where n=1..14 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE4_MEMORY          ON //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE4_NAME "AvanceCabane_12V"
 
#define POWER_DEVICE5_RELAY           5 //    OFF, n. Where n=1..14 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE5_MEMORY          ON //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE5_NAME "Ouverture_Fermeture_Porte"
 
#define POWER_DEVICE6_RELAY           6 //    OFF, n. Where n=1..14 (Relay#) with _NAME below                               Option
#define POWER_DEVICE6_MEMORY          ON //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE6_NAME "AllSky"

Thanks again


OCS 3 compiling error on 2 sensors

koal01
 

Howard, i have errors with 2 sensors, the MLX90614 and the bmp280 (actually i'm using the bmp180 but i downloaded the bmp280 lib for the test, the bme280 works fine as well as other sensors.

Error on the MLX :
C:\Users\me\AppData\Local\Temp\arduino_build_975909\sketch\src\lib\weatherSensor\CloudMlx90614.cpp: In member function 'bool Mlx90614w::init()':
C:\Users\me\AppData\Local\Temp\arduino_build_975909\sketch\src\lib\weatherSensor\CloudMlx90614.cpp:25:52: error: no matching function for call to 'Adafruit_MLX90614::begin(int)'
   if (mlxSensor.begin(WEATHER_SENSOR_CLOUD_MLX90614)) {                                                    ^
In file included from C:\Users\me\AppData\Local\Temp\arduino_build_975909\sketch\src\lib\weatherSensor\CloudMlx90614.cpp:8:0:
C:\Users\me\Documents\Arduino\libraries\Adafruit-MLX90614/Adafruit_MLX90614.h:52:11: note: candidate: boolean Adafruit_MLX90614::begin()
   boolean begin();
           ^~~~~
C:\Users\me\Documents\Arduino\libraries\Adafruit-MLX90614/Adafruit_MLX90614.h:52:11: note:   candidate expects 0 arguments, 1 provided

Error with the bmp280 :
In file included from C:\Users\me\AppData\Local\Temp\arduino_build_975909\sketch\src\lib\weatherSensor\TpBmp280.cpp:9:0:
Plusieurs bibliothèque trouvées pour "SD.h"
C:\Users\me\Documents\Arduino\libraries\Adafruit_BMP280/Adafruit_BMP280.h:26:10: fatal error: Adafruit_I2CDevice.h: No such file or directory
Utilisé : C:\Users\me\Documents\Arduino\libraries\SD
 #include <Adafruit_I2CDevice.h>

Thank you for your help


Re: New OCS developments

koal01
 

I've just deleted 2 messages i send since i couldn't compile but seeing the arduiino IDE error it was a library problem with the digitalWriteFast lib, i downloaded it and the compilation is ok


Re: New OCS developments

Howard Dutton
 
Edited

Yes for weather but untested, look in Config.h they are listed.

Only Bme280 for thermostat now, easy to add others though.

Reminds me i should attach thermostat pressure to weather as it applies.


Re: New OCS developments

koal01
 

Are the bmp180 and si7021 sensors compatible with ocs3 ?


Re: New OCS developments

Howard Dutton
 

Speaking of new features... one of them is due to using the Sense class (from OnStepX) for digital inputs:

Now these digital inputs have a built-in ability to filter noisy conditions.

Normally, you specify the ON state as follows:
#define SENSE1_ON_STATE HIGH

To enable filtering add an extra bit specifying the filter time (how long the signal needs to be stable to be accepted.)  In this example it's 50 milliseconds...
#define SENSE1_ON_STATE HIGH|HYST(50)

The above line (and similar) can be added to the Config.h file if you want to change the default behavior for any sense inputs.


Re: New OCS developments

Howard Dutton
 

I have things mostly working I think (on a Mega2560).

The BME weather sensor works (new design/code there so that's good.)
The website and charts work.
NPT works.
Relays almost work.  The fast relay pwm has problems, so its commented out, but otherwise things look ok.
Sense inputs are untested.
I see Analog inputs floating as they should when disconnected (test h/w).

Memory is tighter on the Mega2560, as expected... you don't get lots of new features without a price.
So the new much more elaborate DEBUG mode makes things REALLY tight if enabled.  If disabled things seem fine, not sure how many sensors can be enabled all at once though.  As this is targeted primarily at more capable h/w (Teensy etc.) this is an acceptable situation.

81 - 100 of 536