Date   

ESP32 Development Board

Bert Kruger
 

Hi Howard and other members.

I've been trying to load the OCS onto an ESP32 Wroom board with 38 pins that I have previously used for Onstep - so I know the board is working and I've also tested a simple wifi sketch to verify that it is working.

I've configured it with no sensors or relays connected - basically just the wifi settings of my home wifi to which it should connect.
I've also created the small file system and uploaded the file from the ..\OCS\Data directory successfully.

However I just can't seem to get it going and I am probably doing something wrong.   

- :IP# on the serial monitor gives no response.  All I am getting on the serial monitor is a repeat of the following (not sure what it means):

ets Jun  8 2016 00:22:57
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1324
ho 0 tail 12 room 4
load:0x40078000,len:13508
load:0x40080400,len:3604
entry 0x400805f0

- I can't see the OCS on my wifi in station or access mode
- obviously I can't acces the OCS web server

I am using the following config settings:
  #define PINMAP                        OCS4E
  #define TIME_LOCATION_SOURCE          NTP 
  The rest of the settings ar OFF or unchanged.

In the Extended Config file I've just specified my Wifi settings to enable station mode.

The Arduino settings selected are as follow:


I am using ESP32 Arduino V2.02 although I have read in one of the posts that V1.04 should be used.  I've tried V1.04 but it is not working.

Sketch uses 719261 bytes (68%) of program storage space. Maximum is 1048576 bytes.
Global variables use 42340 bytes (12%) of dynamic memory, leaving 285340 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.1
Serial port COM3
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: ec:94:cb:4b:56:70
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x000c1fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 524.6 kbit/s)...
Hash of data verified.
Compressed 18528 bytes to 12721...
Writing at 0x00001000... (100 %)
Wrote 18528 bytes (12721 compressed) at 0x00001000 in 0.5 seconds (effective 306.0 kbit/s)...
Hash of data verified.
Compressed 725040 bytes to 464344...
Writing at 0x00010000... (3 %)
Writing at 0x0001c0f3... (6 %)
Writing at 0x00028654... (10 %)
Writing at 0x000321c1... (13 %)
Writing at 0x00037b6a... (17 %)
Writing at 0x0003d78e... (20 %)
Writing at 0x00043347... (24 %)
Writing at 0x00048a08... (27 %)
Writing at 0x0004e19e... (31 %)
Writing at 0x00053232... (34 %)
Writing at 0x000584c0... (37 %)
Writing at 0x0005d874... (41 %)
Writing at 0x00062b6f... (44 %)
Writing at 0x00067c4b... (48 %)
Writing at 0x0006d298... (51 %)
Writing at 0x00072790... (55 %)
Writing at 0x00077962... (58 %)
Writing at 0x0007ccca... (62 %)
Writing at 0x00082144... (65 %)
Writing at 0x00087724... (68 %)
Writing at 0x0008d07c... (72 %)
Writing at 0x00092e76... (75 %)
Writing at 0x00098740... (79 %)
Writing at 0x000a103d... (82 %)
Writing at 0x000a9411... (86 %)
Writing at 0x000ae47d... (89 %)
Writing at 0x000b4075... (93 %)
Writing at 0x000b98e3... (96 %)
Writing at 0x000bf04c... (100 %)
Wrote 725040 bytes (464344 compressed) at 0x00010000 in 7.9 seconds (effective 737.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 117...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (117 compressed) at 0x00008000 in 0.1 seconds (effective 393.2 kbit/s)...
Hash of data verified.
 
Leaving...
Hard resetting via RTS pin...
 
After compiling the sketch Arduino gives the following to show that compiling and uploading was successful:

I understand that the ESP32 development is maybe lagging behind the Mega and Teensy boards but I am still hopeful that I can use the board as it is fairly powerful for the price.  I've already ordered an ESP32 S2 Soala as well.

Any suggestions or advice will be appreciated as I am just going in circles now?

Thanks
Bert Kruger 


Re: 3D Printed Cases

Howard Dutton
 

On a Mega2560, ram and speed are very limiting.


Re: OSC IndiLibb driver

Gord Tulloch
 

It's my intention to adapt the INDI roll-off roof driver for OCS so I'll keep you posted as to my progress.


3D Printed Cases

Gord Tulloch
 
Edited

I didn't see this posted so here's a case for the Mega 2560/Ethernet shield combo

https://www.thingiverse.com/thing:1364105

Also a 8 relay board mounting case that I'll be using:

https://www.thingiverse.com/thing:3212197


Re: Compile error

Gord Tulloch
 

Yup have gone over the wiki pretty carefully, thanks for all that work! I actually found that the SD library brought in the File type but adding it didn't resolve the problem - some kind of conflict somewhere!

The sketch now compiles and loads so good to go thanks!


Re: Compile error

Howard Dutton
 

Please have a look at the Wiki too if you haven't done so already:

https://onstep.groups.io/g/onstep-ocs/wiki


Re: Compile error

Howard Dutton
 

On Wed, Jul 27, 2022 at 11:56 AM, Gord Tulloch wrote:
I've programmed a lot in C but not on Arduino, so although it looks like a library isn't being loaded none of the libraries I'd tried loading seem to work.
The condition for the SD library being brought in was the weather panel being enabled; that was due to how the OCS worked long ago.

It's now a Config.defaults.h (default) setting #define SD_CARD ON that brings in that library and functionality.


Re: Compile error

Howard Dutton
 

On Wed, Jul 27, 2022 at 11:56 AM, Gord Tulloch wrote:
Just starting to put together my system - I have a mega2560 and ethernet shield ready to go but am hung up on compiling the sketch in the Arduino IDE, with the following error. Any assistance would be appreciated - I've programmed a lot in C but not on Arduino, so although it looks like a library isn't being loaded none of the libraries I'd tried loading seem to work.
There was a little issue with those basic settings that was tripping it up.  Download again, should be good now.


Compile error

Gord Tulloch
 
Edited

Hi there:

Just starting to put together my system - I have a mega2560 and ethernet shield ready to go but am hung up on compiling the sketch in the Arduino IDE, with the following error. Any assistance would be appreciated - I've programmed a lot in C but not on Arduino, so although it looks like a library isn't being loaded none of the libraries I'd tried loading seem to work.

Astronomy\00 OCS\OCS-master\OCS\src\pages\HandleNotFound.cpp: In function 'void handleNotFound()':
C:\Users\gordt\Dropbox\Astronomy\00 OCS\OCS-master\OCS\src\pages\HandleNotFound.cpp:34:7: error: 'File' was not declared in this scope
       File dataFile = FS.open(www.uri().c_str(), FILE_READ);
       ^~~~
C:\Users\gordt\Dropbox\Astronomy\00 OCS\OCS-master\OCS\src\pages\HandleNotFound.cpp:34:7: note: suggested alternative: 'Wire'
       File dataFile = FS.open(www.uri().c_str(), FILE_READ);
       ^~~~
       Wire
C:\Users\gordt\Dropbox\Astronomy\00 OCS\OCS-master\OCS\src\pages\HandleNotFound.cpp:35:11: error: 'dataFile' was not declared in this scope
       if (dataFile) {
           ^~~~~~~~
C:\Users\gordt\Dropbox\Astronomy\00 OCS\OCS-master\OCS\src\pages\HandleNotFound.cpp:35:11: note: suggested alternative: 'mutable'
       if (dataFile) {
           ^~~~~~~~
           mutable
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Here's my config.h, I pretty much left everything turned off for the first load of the software:

// ---------------------------------------------------------------------------------------------------------------------------------
// Configuration for the Observatory Control System (OCS)

/*
 *          For more information on setting the OCS up see http://www.stellarjourney.com/index.php?r=site/observatory_control
 *                      and join the OCS Groups.io at https://onstep.groups.io/g/onstep-ocs
*/

// ******         _RELAY and _SENSE numbers are mapped to pins in a platform specific pinmap, see: /src/pinmaps               ******
// ******                            Additional settings are present in /src/Config.defaults.h                                ******

// ---------------------------------------------------------------------------------------------------------------------------------
// ADJUST THE FOLLOWING TO CONFIGURE YOUR CONTROLLER FEATURES ----------------------------------------------------------------------
// <-Req'd = always must set, <-Often = usually must set, Option = optional, Adjust = adjust as req'd, Infreq = infrequently changed

// PINMAP --------------------------------------------------------------------------------------------------------------------------
#define PINMAP                     LEGACY //    OFF, Choose from: LEGACY, OCS1, OCS2, OCS3, OCS4, OCS4E.                     <-Req'd
                                          //         Other boards/more info. in /src/Constants.h

// WATCHDOG SETTINGS ---------------------------------------------------------------------------------------------------------------
#define WATCHDOG                      OFF //    OFF, ON resets OCS after 8 sec. if it hangs for (nearly) any reason.          Option

// NETWORK SETTINGS ----------------------------------------------------------------------------------------------------------------
#define ASCOM_ALPACA_SERVER           OFF //    OFF, ON enables ASCOM Alpaca server on port 10000, requires W5500 Ethernet.   Option
                                          //         Note: this disables the IP command servers on ports 9998, 9999 and
                                          //         works best w/my Ethernet library from: https://github.com/hjd1964/Ethernet
#define CONNECT_CHECK_HOURS           OFF //    OFF, n. Where n=1 to 48 (hours.)  Connection check time.                      Option
#define CONNECT_IP_ADDR  {100,24,172,113} //         Default is arduino.cc. Needs ETHERNET_RESET_PIN and/or WATCHDOG to reset.
#define CONNECT_FAIL_WATCHDOG         OFF //    OFF, ON to stop all processing and trigger the watchdog reset.                Option

// TIME SETTINGS -------------------------------------------------------------------------------------------------------------------
#define TIME_LOCATION_SOURCE          NTP //    NTP, Network Time Protocol w/IP address settings in Extended.config.h or      Adjust
                                          //         DS3234 on default SPI interface and default CS pin or DS3231 on I2C.
#define TIME_IP_ADDR        {129,6,15,28} // ...6,15,28}, time-a-g.nist.gov at 129,6,15,28 or 129,6,15,29, 129,6,15,30, etc.  Option
#define TIME_ZONE                      -5 //     -5, Time Zone (US Eastern Standard Time in this case.)                      <-Req'd
#define TIME_DISPLAY                  STD //    STD, Display Standard Time, UT1 to display Universal Time.                    Adjust

// STATUS PANEL FEATURES -----------------------------------------------------------------------------------------------------------
#define STAT                          OFF //    OFF, ON to enable the OCS website status panel display.                       Option

#define STAT_UNITS                 METRIC // METRIC, For metric units, or IMPERIAL for imperial units.                        Adjust

#define STAT_MAINS_SENSE              OFF //    OFF, n. Where n=1..8 (Sense#) mains power good, OFF (power failure) is UNSAFE Option
#define STAT_MAINS_CURRENT_ANALOG     OFF //    OFF, n. Where n=1..16 (Analog#) measure/display current mains.                Option
#define STAT_MAINS_AUX_CURRENT_ANALOG OFF //    OFF, n. Where n=1..16 (Analog#) measure/display current mains (aux.)          Option

// Converts the analog measure (range 0 to 1.0) to Amps
#define STAT_MAINS_ANALOG_TO_CURRENT(x) (x*NAN)

#define STAT_DC_VOLTAGE_ANALOG        OFF //    OFF, n. Where n=1..16 (Analog#) measure/display 12VDC power supply voltage.   Option
#define STAT_DC_CURRENT_ANALOG        OFF //    OFF, n. Where n=1..16 (Analog#) measure/display 12VDC power supply current.   Option

#define STAT_BATTERY_VOLTAGE_ANALOG   OFF //    OFF, n. Where n=1..16 (Analog#) measure/display 12V roof battery voltage.     Option
#define STAT_BATTERY_CURRENT_ANALOG   OFF //    OFF, n. Where n=1..16 (Analog#) measure/display 12V roof battery current.     Option

// Converts the analog measure (range 0 to 1.0) to Volts
#define STAT_DC_ANALOG_TO_VOLTAGE(x) (x*NAN)

// Converts the analog measure (range 0 to 1.0) to Amps
#define STAT_DC_ANALOG_TO_CURRENT(x) (x*NAN)

#define STAT_PROCESSOR_RAM            OFF //    OFF, ON for display of Processor free RAM resources. Mega2560 only.           Option

// POWER PANEL ---------------------------------------------------------------------------------------------------------------------
#define POWER                         OFF //    OFF, ON to enable the OCS website power panel display.                        Option

#define POWER_DEVICE1_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE1_MEMORY          OFF //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE1_NAME ""

#define POWER_DEVICE2_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE2_MEMORY          OFF //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE2_NAME ""

#define POWER_DEVICE3_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE3_MEMORY          OFF //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE3_NAME ""

#define POWER_DEVICE4_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE4_MEMORY          OFF //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE4_NAME ""

#define POWER_DEVICE5_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) with _NAME below.                              Option
#define POWER_DEVICE5_MEMORY          OFF //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE5_NAME ""

#define POWER_DEVICE6_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) with _NAME below                               Option
#define POWER_DEVICE6_MEMORY          OFF //    OFF, ON to enable memory (across power cycles) for this relay state.          Option
#define POWER_DEVICE6_NAME ""

// LIGHTING PANEL ------------------------------------------------------------------------------------------------------------------
#define LIGHT                         OFF //    OFF, ON to enable the OCS website lighting panel display.                     Option
#define LIGHT_WRW_RELAY               OFF //    OFF, n. Where n=1..18 (Relay#) for Warm room white lights.                    Option
#define LIGHT_WRR_RELAY               OFF //    OFF, n. Where n=1..18 (Relay#) for Warm room red lights.                      Option
#define LIGHT_ORW_RELAY               OFF //    OFF, n. Where n=1..18 (Relay#) for Observing room white lights.               Option
#define LIGHT_ORR_RELAY               OFF //    OFF, n. Where n=1..18 (Relay#) for Observing room red lights.                 Option
#define LIGHT_OUTSIDE_RELAY           OFF //    OFF, n. Where n=1..18 (Relay#) for Outside flood.                             Option
#define LIGHT_SW_SENSE                OFF //    OFF, n. Where n=1..8 (Sense#) for switch to turn WRW lights on/off.           Option

// WEATHER PANEL -------------------------------------------------------------------------------------------------------------------
// Weather and Sky Conditions web page charts use "Chart.js" http://www.chartjs.org/. Specifically, version 2.5 of "Chart.min.js"
//   renamed to "Chart.js" and placed in the Micro SD card root directory (Fat32 formatted) and inserted into the W5100 Ethernet
//   adapter.  Downloaded from here https://github.com/chartjs/Chart.js/releases/tag/v2.5.0 (page bottom for download links.)
#define WEATHER                       OFF //    OFF, ON to enable the OCS website weather panel display.                      Option
#define WEATHER_CHARTS                OFF //    OFF, ON for logging and display of weather data graphic charts.               Option

#define WEATHER_TEMPERATURE           OFF //    OFF, ON for measuring outside temperature.                                    Option

#define WEATHER_PRESSURE              OFF //    OFF, ON for measuring barometric pressure.                                    Option
#define WEATHER_NOMINAL_PRESSURE     1010 //   1010, n. Where n=500..1050 (in mb) site nominal pressure for Chart.            Adjust
#define WEATHER_ALTITUDE              100 //    100, n. Where n=-86..5000 (meters) site altitude.                             Adjust

#define WEATHER_HUMIDITY              OFF //    OFF, ON for measuring outside humidity.                                       Option

#define WEATHER_WIND_SPD              OFF //    OFF, ON for measuring wind speed.                                             Option
#define WEATHER_WIND_SPD_THRESHOLD     20 //     20, n. Where n=0..100 (in kph) wind speed above this is considered UNSAFE.   Adjust

#define WEATHER_RAIN                  OFF //    OFF, ON to enable rain sensor, a "wet" condition is considered to be UNSAFE.  Option

#define WEATHER_CLOUD_CVR             OFF //    OFF, ON to enable the cloud sensor, above WEATHER_SAFE_THRESHOLD is UNSAFE.   Option
#define WEATHER_SAFE_THRESHOLD        -14 //    -14, n. Where n=-25..0 (in Deg. C)                                            Adjust
#define WEATHER_VCLR_THRESHOLD        -19 //    -19, n. Where n=-25..0 (in Deg. C)                                            Adjust
#define WEATHER_CLER_THRESHOLD        -17 //    -17, n. Where n=-25..0 (in Deg. C)                                            Adjust
#define WEATHER_HAZE_THRESHOLD        -14 //    -14, n. Where n=-25..0 (in Deg. C)                                            Adjust
#define WEATHER_OVRC_THRESHOLD        -11 //    -11, n. Where n=-25..0 (in Deg. C)                                            Adjust
#define WEATHER_CLDY_THRESHOLD         -8 //     -8, n. Where n=-25..0 (in Deg. C)                                            Adjust
#define WEATHER_VCLD_THRESHOLD         -5 //     -5, n. Where n=-25..0 (in Deg. C)                                            Adjust

#define WEATHER_SKY_QUAL              OFF //    OFF, ON for measuring sky quality (darkness in magnitudes per sq arc-sec.)    Option

// WEATHER SENSORS ----------------------
#define WEATHER_SENSOR_TPH_BME280     OFF //    OFF, 0x76 or 0x77 (I2C Address) to enable. Temperature, pressure, humidity.   Option

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

#define WEATHER_SENSOR_TP_BMP085      OFF //    OFF, 0x77 (I2C Address) to enable. Temperature, pressure. For BMP180 also.    Option

#define WEATHER_SENSOR_TH_DHT         OFF //    OFF, n. Where n=1..8 (Sense#) to enable. Temperature, humidity.               Option
// DHT device type DHT11, or DHT21, DHT22
#define WEATHER_SENSOR_TH_DHT_TYPE  DHT11

#define WEATHER_SENSOR_TH_SI7021      OFF //    OFF, 0x40 (I2C Address) to enable. Temperature, humidity.                     Option

#define WEATHER_SENSOR_T_ANALOG       OFF //    OFF, n. Where n=1..16 (Analog#) to enable.                                    Option
// Conversion factor, analog range 0 to 1.0 (x) to Deg. C; example TMP36 device 0.1V (-40°C) to 2.0V (150°C) w/3.3V MCU
#define WEATHER_SENSOR_T_ANALOG2DEGC(x) (((x*3.3)-0.1)*100.0-40.0)

#define WEATHER_SENSOR_WIND_CUP       OFF //    OFF, n. Where n=1..8 (Sense#) to enable. Wind speed, cup anemometer.          Option
// Conversion factor, pulses per minute (x) to wind speed in KPH
#define WEATHER_SENSOR_WIND_CUP2KPH(x) (x*0.087)

#define WEATHER_SENSOR_WIND_REV_P     OFF //    OFF, n. Where n=1..16 (Analog#) to enable. Wind speed.                        Option

#define WEATHER_SENSOR_RAIN_GENERIC   OFF //    OFF, n. Where n=1..16 (Analog#) to enable.                                    Option
#define WEATHER_SENSOR_RAIN_LOW      0.25 //    OFF, n. Where n=0.0 to 1.0 for lower range below which is dry.                Option
#define WEATHER_SENSOR_RAIN_HIGH     0.75 //    OFF, n. Where n=0.0 to 1.0 for lower range below which is wet.                Option

#define WEATHER_SENSOR_CLOUD_MLX90614 OFF //    OFF, 0x5A (I2C Address) to enable. Gets IR sky IR temp. for cloud detection.  Adjust

#define WEATHER_SENSOR_SKYQ_TSL2591   OFF //    OFF, 0x28 (I2C Address) to enable. Sky brightness for sky quality estimate.   Option

// THERMOSTAT PANEL ----------------------------------------------------------------------------------------------------------------
#define THERMOSTAT                    OFF //    OFF, ON to enable the OCS website thermostat panel display.                   Option
#define HEAT_RELAY                    OFF //    OFF, n. Where n=1..18 (Relay#) for indoor heat.                               Option
#define COOL_RELAY                    OFF //    OFF, n. Where n=1..18 (Relay#) for cooling/venting.                           Option
#define THERMOSTAT_HUMIDITY           OFF //    OFF, ON displays indoor humidity.                                             Option

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

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

#define THERMOSTAT_SENSOR_TP_BMP085   OFF //    OFF, 0x77 (I2C Address) to enable. Temperature, pressure. For BMP180 also.    Option

#define THERMOSTAT_SENSOR_TH_DHT      OFF //    OFF, n. Where n=1..8 (Sense#) to enable. Temperature, humidity.               Option
// DHT device type DHT11, or DHT21, DHT22
#define THERMOSTAT_SENSOR_TH_DHT_TYPE DHT11

#define THERMOSTAT_SENSOR_TH_SI7021   OFF //    OFF, 0x40 (I2C Address) to enable. Temperature, humidity.                     Option

#define THERMOSTAT_SENSOR_T_ANALOG    OFF //    OFF, n. Where n=1..16 (Analog#) to enable.                                    Option
// Conversion factor, analog (x ranges from 0 to 1.0) to Deg. C; example TMP36 0.1V (-40°C) to 2.0V (150°C) w/3.3V MCU
#define THERMOSTAT_SENSOR_T_ANALOG2DEGC(x) (((x*3.3)-0.1)*100.0-40.0)

// ROOF/SHUTTER CONTROL PANEL ------------------------------------------------------------------------------------------------------
#define ROOF                          OFF //    OFF, ON to enable the OCS website roof/dome shutter panel display.            Option
#define ROOF_USER_SAFETY_OVERRIDE     OFF //    OFF, ON displays safety override button.                                      Option

#define ROOF_AUTOCLOSE_DAWN           OFF //    OFF, ON displays option to automatically close roof at dawn.                  Option
#define ROOF_AUTOCLOSE_DAWN_DEFAULT   OFF //    OFF, ON enables AUTOCLOSE_DAWN option at startup, disabled otherwise.         Option
#define ROOF_AUTOCLOSE_SAFETY         OFF //    OFF, ON closes the roof automatically if an UNSAFE condition is detected.     Option

#define ROOF_MOTOR_OPEN_RELAY         OFF //    OFF, n. Where n=1..18 (Relay#) engages this relay to open roof.               Option
#define ROOF_MOTOR_CLOSE_RELAY        OFF //    OFF, n. Where n=1..18 (Relay#) engages this relay to close roof.              Option
#define ROOF_MOTOR_RELAY_MOMENTARY    OFF //    OFF, ON engage above momentarily (~1.5s) to start an automatic open or close. Option
#define ROOF_MOTOR_STOP_RELAY         OFF //    OFF, n. Where n=1..18 (Relay#) momentarily engages this relay to stop roof.   Option

#define ROOF_POWER_RELAY              OFF //    OFF, n. Where n=1..18 (Relay#) This controls roof motor power. For DC motors  Option
                                          //         SSR/MOSFET PWM controls speed. For garage door openers etc SW on/off only.
#define ROOF_POWER_PWM_FREQUENCY      OFF //    OFF, n. Where n=1..100 (Hz) PWM frequency for roof motor DC control.          Option
#define ROOF_POWER_PWM_POWER          OFF //    OFF, n. Where n=10..100 (%) PWM power level for roof motor DC control.        Option
#define ROOF_POWER_PWM_SOFTSTART      OFF //    OFF, ON For PWM soft start, start 0% adds 5%/sec until ROOF_POWER_PWM_POWER.  Option

#define ROOF_INTERLOCK_SENSE          OFF //    OFF, n. Where n=1..8 (Sense#) Roof safety interlock, close allowed when ON.   Option
#define ROOF_LIMIT_CLOSED_SENSE       OFF //    OFF, n. Where n=1..8 (Sense#) Roof closed switch (CLOSED when ON.)            Option
#define ROOF_LIMIT_OPENED_SENSE       OFF //    OFF, n. Where n=1..8 (Sense#) Roof open switch (OPEN when ON.)                Option

#define ROOF_TIME_AVG                 300 //    300, n. Where n=30..1200 (seconds) Average time to open or close roof.        Adjust
#define ROOF_TIME_TOL                  30 //     30, n. Where n=0..120 (seconds) Additional time before stop & error thrown.  Adjust

// DOME CONTROL PANEL --------------------------------------------------------------------------------------------------------------
#define DOME                          OFF //    OFF, ON to enable the OCS website dome panel display.                         Option

#define DOME_SHUTTER_LOCK             OFF //    OFF, ON to disable dome motion unless shutter is open.                        Option

// Usually this will be a GENERIC stepper driver or a servo SERVO_PD (PWM/Direction) or SERVO_II (PWM/PWM)
#define AXIS1_DRIVER_MODEL            OFF //    OFF, Enter driver model (above) to activate the dome Azimuth axis.            Option
#define AXIS1_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                                         Option
#define AXIS1_DRIVER_STATUS           OFF //    OFF, ON, HIGH, or LOW.  For driver status info/fault detection.               Option

// for SERVO_II and SERVO_PE driver models, PID and encoder settings:
#define AXIS1_SERVO_ENCODER        ENC_AB // ..._AB, Encoder type, ENC_AB, ENC_CW_CCW, ENC_PULSE_DIR, ENC_PULSE_ONLY.         Adjust
#define AXIS1_SERVO_P                 2.0 //    2.0, Proportional; scale of immediate response to position error.             Adjust
#define AXIS1_SERVO_I                 5.0 //    5.0, Integral; rate of increasing response to position error over time.       Adjust
#define AXIS1_SERVO_D                 1.0 //    1.0, Derivative; overshoot supression.                                        Adjust

#define AXIS1_SLEW_RATE_DESIRED       1.0 //    1.0, n, (degrees/second) Maximum speed depends on processor.                  Adjust

#define AXIS1_STEPS_PER_DEGREE       60.0 //   60.0, n. Number of steps per degree for dome.                                  Adjust
#define AXIS1_REVERSE                 OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS1_POWER_DOWN              OFF //    OFF, ON Powers off 30sec after movement stops or 10min after last<=1x guide.  Option

#define AXIS1_LIMIT_MIN              -180 //   -180, n. Where n= 0..-360 (degrees.) Minimum Azimuth.                          Adjust
#define AXIS1_LIMIT_MAX               180 //    180, n. Where n= 0.. 360 (degrees.) Maximum Azimuth.                          Adjust

#define AXIS1_SENSE_HOME              OFF //    OFF, HIGH or LOW enables & state clockwise home position, as seen from front. Option
#define AXIS1_SENSE_LIMIT_MIN         OFF //    OFF, HIGH or LOW state on limit sense switch stops movement.                  Option
#define AXIS1_SENSE_LIMIT_MAX         OFF //    OFF, HIGH or LOW state on limit sense switch stops movement.                  Option
                                          //         Digital, optionally add: |HYST(n) Where n=0..1023 stability time in ms.
                                          //         Analog capable sense inputs also allow adding:
                                          //         |THLD(n) Where n=1..1023 (ADU) for Analog threshold.
                                          //         |HYST(n) Where n=0..1023 (ADU) for +/- Hystersis range.

#define AXIS1_WRAP                    OFF //    OFF, ON Allows unlimited Azm range and ignores min/max limits.                Option

#define AXIS2_DRIVER_MODEL            OFF //    OFF, Enter driver model to activate the (optional) dome Altitude axis.        Option
#define AXIS2_DRIVER_MICROSTEPS       OFF //    OFF, n. Microstep mode when tracking.                                         Option
#define AXIS2_DRIVER_STATUS           OFF //    OFF, ON, HIGH, or LOW.  For driver status info/fault detection.               Option

// for SERVO_II and SERVO_PE driver models, PID and encoder settings:
#define AXIS2_SERVO_ENCODER        ENC_AB // ..._AB, Encoder type, ENC_AB, ENC_CW_CCW, ENC_PULSE_DIR, ENC_PULSE_ONLY.         Adjust
#define AXIS2_SERVO_P                 2.0 //    2.0, Proportional; scale of immediate response to position error.             Adjust
#define AXIS2_SERVO_I                 5.0 //    5.0, Integral; rate of increasing response to position error over time.       Adjust
#define AXIS2_SERVO_D                 1.0 //    1.0, Derivative; overshoot supression.                                        Adjust

#define AXIS2_SLEW_RATE_DESIRED       1.0 //    1.0, n, (degrees/second) Maximum speed depends on processor.                  Adjust

#define AXIS2_STEPS_PER_DEGREE       60.0 //   60.0, n. Number of steps per degree for dome.                                  Adjust
#define AXIS2_REVERSE                 OFF //    OFF, ON Reverses movement direction, or reverse wiring instead to correct.    Option
#define AXIS2_POWER_DOWN              OFF //    OFF, ON Powers off 30sec after movement stops or 10min after last<=1x guide.  Option

#define AXIS2_LIMIT_MIN                 0 //      0, n. Where n=  0..90 (degrees.) Minimum Altitude.                          Adjust
#define AXIS2_LIMIT_MAX                90 //     90, n. Where n=  0..90 (degrees.) Maximum Altitude.                          Adjust

#define AXIS2_SENSE_HOME              OFF //    OFF, HIGH or LOW enables & state clockwise home position, as seen from front. Option
#define AXIS2_SENSE_LIMIT_MIN         OFF //    OFF, HIGH or LOW state on limit sense switch stops movement.                  Option
#define AXIS2_SENSE_LIMIT_MAX         OFF //    OFF, HIGH or LOW state on limit sense switch stops movement.                  Option

#define FileVersionConfig 2
#include "Extended.config.h"


Re: Ideas please

Howard Dutton
 

Not long ago I added a pretty detailed Wiki for the OCS, hopefully it will answer your questions.

https://onstep.groups.io/g/onstep-ocs/wiki


Ideas please

Chris Whitener
 

I have the v4 design.
What are the best uses of this?
I have a rolloff shed. 
What else do others do?

What about weather and seeing conditions.
Is there a way to check seeing before any activity?


Re: OCS 4 vs 3?

Howard Dutton
 

That's what I needed and I've made note of it in the Wiki, thanks!


Re: OCS 4 vs 3?

koal01
 
Edited

yep the ACS712_V component gives the current used by all the stuff used in OCS, i need to monitor current since my first power supply are solar pannels, very useful,  i really like it.
See the screenshot below. Don't pay attention on the power supplly, it is not wired.
In my setup i added an allsky with DIY cooling system around a T7 camera + a raspberry pi 4, by night the current increases a bit,  i can easy reach 5 A, just 1A are needed during the day

 

you can see this on http://koal01.com, where my OCS is published, it is not my real installation, i added a menu to my Allsky, i tried to do something integrated ...

In terms of specificity i also tried with your help to add a second hot-wire sensor to improve accuracy on the wind sensor, orienting the first one North-south and the second one East-West.
You added a bit of code so that OCS gives the highest value between the sensors, sorry i still havn't found the time to install this, it is my todo list.

To finish I'm not on a roof opening system, mine is a shelter moving on wheels, the automation would be to find a way of opening the two front doors and make the shelter move on its wheels...a future project. It's a short description of my specific use.

Good luck for the wiki


Re: OCS 4 vs 3?

Howard Dutton
 

On Mon, Apr 25, 2022 at 12:47 PM, koal01 wrote:
Sorry i didn't see your quesion until now
Here are my sensors :
 Temperature  -> SFE_BMP180
 Barometric Pressure1012 mb -> SFE_BMP180
 Relative Humidity -> Adafruit_Si7021
 Wind Speed -> Modern Devices wind sensor 
 Rain sensorWarn -> classic sensor
 Sky Quality -> Adafruit_TSL2591
 Sky Conditions -> MLX90614
... for some reason I thought you had AC mains current monitoring.


Re: OCS Wiki

koal01
 

Waouh i  wish i had this nice wiki at the beginning struggling with OCS 2 ('im still on this version) and harassing you with tons of questions.
Very good idea to introduce it with OCS4 for the growing community.
Bravo and thank you Howard !


Re: OCS 4 vs 3?

Howard Dutton
 

On Mon, Apr 25, 2022 at 12:47 PM, koal01 wrote:
The bmp 180 combined with the Si071 are a very cheap choice  for temperature, humidity and pressure
In the version 3 i had problem to make the bmp180 work, that's why i turned to the 2.3 i version waiting for a great jump to OCS4 with a Teensy 4.1
I recall that was an issue, not sure why perhaps I should switch to the SFE library.

Anyway there's a LOT more info. in the Wiki here about the OCS now, should answer a lot of questions about what the capabilities are, and what you can do and can not do.


Re: OCS 4 vs 3?

koal01
 
Edited

Sorry i didn't see your quesion until now
Here are my sensors :
 Temperature  -> SFE_BMP180
 Barometric Pressure1012 mb -> SFE_BMP180
 Relative Humidity -> Adafruit_Si7021
 Wind Speed -> Modern Devices wind sensor 
 Rain sensorWarn -> classic sensor
 Sky Quality -> Adafruit_TSL2591
 Sky Conditions -> MLX90614
The bmp 180 combined with the Si071 are a very cheap choice  for temperature, humidity and pressure
In the version 3 i had problem to make the bmp180 work, that's why i turned to the 2.3 i version waiting for a great jump to OCS4 with a Teensy 4.1


Re: OCS 4 vs 3?

Howard Dutton
 

Thanks Fernando, good to know what is in use.


Re: OCS 4 vs 3?

Fernando Nino Sr
 

BME280
DHT11
Water Sensor Rainwater Module Rain Detection Module 3.3V-5V
Infrared Thermometer - MLX90614
Sky Quality Meter TLS237


Re: OCS 4 vs 3?

Howard Dutton
 

On Thu, Apr 14, 2022 at 01:22 PM, koal01 wrote:
The wiki is a very good idea 
And I've started on that now.

Do you have the info. on the current sensors you used?  I'd like to add info to the Wiki about them.

1 - 20 of 537