Skip to content

Commit

Permalink
add PID@drough-in option, and kettle thermomass option
Browse files Browse the repository at this point in the history
  • Loading branch information
Vito Tai committed Feb 27, 2017
1 parent eeeca0c commit db34930
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 19 deletions.
35 changes: 26 additions & 9 deletions BrewManiacEx/BrewManiac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,12 @@ void displayResolution(int value)
{
uiSettingDisplayNumber((float)value,0);
}
void displayOnOff(int value)
{
if (value==0) uiSettingDisplayText(STR(Off));
else uiSettingDisplayText(STR(On));
}

//**************************************************************
//* PID PWM setting screen
//**************************************************************
Expand All @@ -1870,7 +1876,9 @@ byte _pidSettingAux;
#define PID_SETTING_PWM 6
#define PID_SETTING_Calibration 7
#define PID_SETTING_PIDStart 8
#define PID_SETTING_Resolution 9
#define PID_SETTING_PIDDoughIn 9

#define PID_SETTING_Resolution 10


void settingPidEditSetting(void)
Expand Down Expand Up @@ -1911,7 +1919,9 @@ void settingPidEditSetting(void)
editItem(STR(Start_PID_In),value,35,10,&displayTempDivide10);
}
#if EnableSensorResolution == true
else if(_currentPidSetting== PID_SETTING_Resolution){
else if(_currentPidSetting== PID_SETTING_PIDDoughIn){
editItem(STR(PID_Dough_In),value,1,0,&displayOnOff);
}else if(_currentPidSetting== PID_SETTING_Resolution){
value=ResolutionDecode(gSensorResolution) + 9;
// Serial.printf("res:%d,%d\n",value,gSensorResolution);
editItem(STR(SensorResolution),value,12,9,&displayResolution);
Expand Down Expand Up @@ -2028,11 +2038,6 @@ void displayInsideOutside(int value)
else uiSettingDisplayText(STR(Outside));
}

void displayOnOff(int value)
{
if (value==0) uiSettingDisplayText(STR(Off));
else uiSettingDisplayText(STR(On));
}

void displayYesNo(int value)
{
Expand Down Expand Up @@ -3637,6 +3642,7 @@ void autoModeEnterMashing(void)
_askingSkipMashingStage = false;
_mashingStep = 0; // 0 is mash in , real mashing starts from 1, this number will be increased in
// autoModeNextMashingStep() later.
heatOn(true);

#if MANUAL_PUMP_MASH == true
gManualPump=false;
Expand Down Expand Up @@ -4619,7 +4625,13 @@ void autoModeEventHandler(byte event)
if(btnIsStartPressed)
{
buzzMute();

if(readSetting(PS_PID_DoughIn)){
// change temperature to first rest
gSettingTemperature = TempFromStorage(readSettingWord(PS_StageTemperatureAddr(1)));
uiDisplaySettingTemperature(gSettingTemperature);
}else{
heatOff(); // turn off heat. during "dough-in"
}
// goto next stage, Mashing or ask MaltADD
if(readSetting(PS_SkipAddMalt))
{
Expand Down Expand Up @@ -5236,7 +5248,12 @@ void uiPrintInitialScreen(void)
uiClearScreen();
uiTitle(STR(welcome));

uiShowTextAtRow_P(2,STR(Initialization),CenterAligned,1);
uiShowTextAtRow_P(1,STR(Initialization),CenterAligned,1);
}

void brewmaniac_ApPrompt(void)
{
uiShowTextAtRow_P(1,STR(SetupNetwork),CenterAligned,1);
uiButtonLabel(ButtonLabel(AccessPoint_Yes));
}

Expand Down
2 changes: 2 additions & 0 deletions BrewManiacEx/BrewManiacEx.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#endif

extern void brewmaniac_setup();
extern void brewmaniac_ApPrompt(void);
extern void brewmaniac_loop();
extern bool readSkipNetCfgButton(void);
extern void startBrewManiac(void);
Expand Down Expand Up @@ -817,6 +818,7 @@ void setup(void){

//3. Start WiFi
WiFiSetup.setBreakCallback(&readSkipNetCfgButton);
WiFiSetup.setAPCallback(&brewmaniac_ApPrompt);
WiFiSetup.begin(_gHostname);

DebugOut("Connected! IP address: ");
Expand Down
2 changes: 1 addition & 1 deletion BrewManiacEx/BrewManiacWeb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static const char* SettingMap[]={
"s_cal",
//#define PS_Hysteresi 8 // Hysteresi
"s_pidstart",
NULL, // 9
"s_piddoughin", // 9
//#define PS_TempUnit 10 // Scale Temp
"s_unit",
//#define PS_SensorType 11 // Sensor Type
Expand Down
8 changes: 7 additions & 1 deletion BrewManiacEx/WiFiSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ void WiFiSetupClass::enterApMode(void)
}
static bool _apEntered=false;
static bool (*_cbBreak)(void);
static void (*_cbAPMode)(void);

void WiFiSetupClass::setBreakCallback( bool (*func)(void) ){ _cbBreak=func; }
void WiFiSetupClass::setAPCallback( void (*func)(void) ){_cbAPMode=func; }

void WiFiSetupClass::startWiFiManager(bool portal)
{
WiFiManager wifiManager;
Expand All @@ -54,7 +57,10 @@ void WiFiSetupClass::startWiFiManager(bool portal)
wifiManager.setTimeout(_apTimeout);
//set custom ip for portal
//and goes into a blocking loop awaiting configuration
wifiManager.setAPCallback([](WiFiManager*){ _apEntered=true;});
wifiManager.setAPCallback([](WiFiManager*){
_apEntered=true;
if(_cbAPMode) _cbAPMode();
});

if(_cbBreak!=NULL){
wifiManager.setBreakCallback([](WiFiManager*)->bool{
Expand Down
1 change: 1 addition & 0 deletions BrewManiacEx/WiFiSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class WiFiSetupClass
void setAutoReconnect(bool reconnect){ _autoReconnect=reconnect; }

void setBreakCallback( bool (*func)(void) );
void setAPCallback( void (*func)(void) );

private:
unsigned int _maxReconnect;
Expand Down
2 changes: 1 addition & 1 deletion BrewManiacEx/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
/* Don't touch them if you don't know what they are. */
/**************************************************************************************/

#define BME8266_VERSION "0.2"
#define BME8266_VERSION "0.2.1"

#define FIRMWARE_UPDATE_URL "http://brew.vito.tw/bmeupdate.php?info"
#define JS_UPDATE_URL "http://brew.vito.tw/bmejsupdate.php?v="
Expand Down
2 changes: 1 addition & 1 deletion BrewManiacEx/data/bm.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion BrewManiacEx/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@
<tr><td>Heat/PWM in Boil </td><td><span id="s_pwm">-</span> %</td></tr>
<tr><td class="TCAL_T">Sensor Calibration </td><td><span id="s_cal" class="TCAL_V">-</span><span class="tmp_unit">°C</span></td></tr>
<tr><td>PID Start</td><td><span id="s_pidstart">-</span> <span class="tmp_unit">°C</span></td></tr>
<tr><td>PID when Doughing-In</td><td><span id="s_piddoughin">-</span></td></tr>
<tr><td colspan="2" class="setting-category">Unit Parameters</td></tr>
<tr><td>Temperature Unit</td><td><span id="s_unit" class="tmp_unit">°C</span></td></tr>
<tr><td>Disable Delay Start</td><td><span id="s_nodelay">-</span></td></tr>
Expand Down Expand Up @@ -443,17 +444,27 @@
<input type="radio" name="genunit" id="unit_us" value="u">
<label for="unit_us">US</label>
</td></tr>

<tr><td>Gravity/Plato</td>
<td colspan="3">
<input type="radio" name="sugarunit" id="su_gravity" value="g">
<label for="su_gravity">Gravity</label>
<input type="radio" name="sugarunit" id="su_plato" value="p">
<label for="su_plato">°Plato</label>
</td></tr>

<tr><td rowspan="4">Mash In Temperature</td>
<td>
<input type="radio" name="mashin_temp" id="mi_1stRest" value="1">
<label for="mi_1stRest">As First Rest</label>
</td>
<td colspan="2"></td></tr>
<tr><td rowspan="2"><input type="radio" name="mashin_temp" id="mi_cal" value="c">
<tr><td rowspan="3"><input type="radio" name="mashin_temp" id="mi_cal" value="c">
<label for="mi_cal">Calculated</label></td>
<td><label for="grain-temp">Grain Temperature</label></td><td><input type="text" id="grain-temp" size="4"></input><span class="tmp_unit">°C</span></td>
</tr>
<tr><td><label for="equip-adj" >Equipment Adjust</label></td><td><input type="text" id="equip-adj" size="4"></input><span class="tmp_unit">°C</span></td></tr>
<tr><td><label for="kettle-mass" >Kettle equiv. mass</label></td><td><input type="text" id="kettle-mass" size="4"></input><span id="kettlemass_unit">L</span></td></tr>
<tr><td>
<input type="radio" name="mashin_temp" id="mi_fixed" value="s">
<label for="mi_fixed">Specified</label>
Expand Down
2 changes: 1 addition & 1 deletion BrewManiacEx/data/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2
0.2.1
4 changes: 2 additions & 2 deletions BrewManiacEx/ps.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define PS_BoilHeat 6 // Boil Heat %
#define PS_Offset 7 // Offset
#define PS_PID_Start 8 // star PID
// 9 [ SPACE ]
#define PS_PID_DoughIn 9 // PID DoughIn

// UNIT MENU
#define PS_TempUnit 10 // Scale Temp
Expand Down Expand Up @@ -131,7 +131,7 @@ const unsigned char DEFAULT_EEPROM[] PROGMEM={
0, // 9 [ SPACE ]
0, //#define PS_TempUnit 10 // Scale Temp
0, //#define NoDelay Start 11 //
100, //#define PS_BoilTemp 12 //Temp Boil °C
99, //#define PS_BoilTemp 12 //Temp Boil °C
0, // 13 Temp Boil °F
15, //#define PS_PumpCycle 14 // Time Pump Cycle
0, //#define PS_PumpRest 15 // Time Pump Rest
Expand Down
5 changes: 3 additions & 2 deletions BrewManiacEx/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ StringConst(min,"min");

StringConst( welcome,"BrewManiacEx 0.2""\xE0");

StringConst( Initialization,"Setup Network..");
StringConst( Initialization,"Connecting..");
StringConst( SetupNetwork,"Setup Network");

#if NoDelayStart == false
StringConst(To_be_started_in,"To be started in");
Expand Down Expand Up @@ -166,7 +167,7 @@ StringConst( Calibration, "Calibration");

//StringConst( Hysteresi, "Hysteresi");
StringConst( Start_PID_In, "Start PID In");

StringConst( PID_Dough_In, "PID DoughIn");

StringConst( Unit_Parameters, "Unit Parameters");
StringConst( Set_Degree, "Set Degrees");
Expand Down
Binary file added bin/BrewManiacEx.021.bin
Binary file not shown.
Binary file added bin/BrewManiacEx.multisensor.021.bin
Binary file not shown.

0 comments on commit db34930

Please sign in to comment.