Variables and Commands - opensolarproject/OSPController GitHub Wiki
Home | 1:Parts | 2:Hardware | 3:Software | 4:Data | 5:Wiring | About |
---|
The controller has a bunch of commands and preferences you can set. Here's some detail on what each does:
Preferences
WiFi & Database settings
wifiap
- what wifi name to connect towifipass
- what password to usemqttServ
- what MQTT server IP/address to connect to (supports setting the :port)mqttUser
- username for MQTTmqttPass
- password for MQTTmqttFeed
- feed prefix for MQTT
Hardware setup
inPin
- which GPIO pin to measure solar voltage from (after a voltage divider!) Make sure it's ADC1! (pins with ADC0 through 7 in this diagram)psu
- which type power supply unit to use. Set "DROK" or "DPS" (does support fancier syntax for custom setups, ask Tim in the discord)vadjust
- use this to fine tune theinvolt
measurement (like if you used a different voltage divider)currentcap
- cap your maximum current output to your batteries. For example if you've got batteries that are only safe up to 4.5A you could set it to 4.5 and it would never increase above itlvProtect
- triggers a GPIO pin low or high if your battery gets too low. Set toPIN[i]:LOW-THRESHOLD:RECOVERY-THRESHOLD
(ex: 22i:36.0:37.0 is pin 22, inverted, low cutoff of 36.0, recovery 37.0)
Tuning
pgain
- Proportional Gain: changes how a change in solar panel voltage affects the output current to the batteries. Use this to tune to get better solar following performanceramplimit
- limits how fast the output changes to the current are allowed to happenoffthreshold
- can ignore. Is auto-set and in-development
Update rates
pubperiod
- change the time (in ms) between database publishes (only publishes changed values depending on the periods below..)printperiod
- change the time (in ms) between printing system state to the serial portadjustperiod
- change the time (in ms) between adjustments to the PSU. Adjustments will already happen faster if collapse is imminentmeasperiod
- change the time (in ms) between input voltage measurement. Much faster.autosweep
- change the time (in seconds) between sweeps (see sweep action)
Power things (not just actions but definitely not prefs)
outputEN
- enable power output. must be set toon
to enable output, anything else to disable. Empty value returns current stateoutvolt
- set output voltage limit on the PSU. Empty value returns current stateoutcurr
- set output current limit on the PSU. Empty value returns current stateoutpower
- just returns the measured output powercurrFilt
- returns filtered output powerstate
- allows you to override the current state variable or just get itinvolt
- reads the current input panel voltagewh
- reads the current Wh stored since last reset. May be set as well. On bootup it restores from mqttcollapses
- returns the number of collapses in the last 5 minutessetpoint
- The usually auto calculated goal setpoint for the input solar voltage to reach.
Actions
sweep
- trigger a sweep process to calculate thesetpoint
connect
- connects the wifi and mqtt database if not already donedisconnect
- disconnects mqtt and wifirestart
- reboots the ESP32 microcontrollerclear
- clears all prefsdebug
- enables debug output. setdebug=off
to disableversion
- returns the firmware versionupdate
- run an OTA update from an HTTP linkuptime
- returns the time since last boot