ESP_IOT v2.5
IOT ESP Coding
|
Go to the source code of this file.
Macros | |
#define | REFACTOR_MSG |
Functions | |
else | if (strcasecmp(setCmdString,"buzz")==0) |
TODO: duplicate and depreciate these and replace with set:buzz,val:on. More... | |
else | if (strcasecmp(setCmdString,"bleclient")==0) |
else | if (strcasecmp(setCmdString,"bleserver")==0) |
else | if (strcasecmp(setCmdString,"tilt")==0) |
else | if (strcasecmp(setCmdString,"zoomSm")==0) |
else | if (guestCmd) |
{'guest':'guest password'} More... | |
else | if (semanticMarkerCmd) |
else | if (setCmd &&valCmd) |
5.12.22 More... | |
else | if (sendCmd) |
5.24.22 send:<request> .. Note these are for cmd without an argument.. More... | |
if (a1 &&strlen(a1)>0) | |
end process commands.. More... | |
SerialTemp | println (a1) |
SerialTemp | println (_ssidString) |
if (a2 &&strlen(a2)>0) | |
if (a3) | |
if (a4) | |
if (a5) | |
if (a6) | |
if (a7 &&strlen(a7)>0) | |
if (a8) | |
if (a9) | |
if (a10) | |
if (a11 &&strlen(a11)>0) | |
if (!isEmptyString(_ssidString)) | |
setup the WIFI if the ssid string (at least) is specified More... | |
callCallbackMain (CALLBACKS_MQTT, MQTT_CALLBACK_SOLID_LIGHT,(char *)"solidLight") | |
call the callback specified from the caller (eg. NimBLE_PetTutor_Server .. or others) More... | |
if (!saveJSONPreferences) | |
don't save the preferences, since it didn't have enough information.. More... | |
updatePreferencesInEPROM () | |
NOTE: this writes over entire values, since it's a string vs an JSON object. More... | |
main_credentialsUpdated () | |
new 4.8.22 .. trying to kick out of AP mode if the credentials are good.. More... | |
startDelay_WIFI_MQTTState () | |
init the delay, this uses the array of delays so we can change easier.. More... | |
void | restartWIFI_MQTTState () |
restart the WIFI and then MQTT connection More... | |
Variables | |
return | true |
this return is important!!! More... | |
else | _ssidString = NULL |
else | _ssidPasswordString = NULL |
_globalMQTTAttempts = 0 | |
reset the MQTT attempts More... | |
boolean | saveJSONPreferences = true |
else | |
_WIFI_MQTTState = preSetupWIFI | |
putting here .. time might have gone too fast.. More... | |
#define REFACTOR_MSG |
Definition at line 1 of file REFAcTOR.c.
callCallbackMain | ( | CALLBACKS_MQTT | , |
MQTT_CALLBACK_SOLID_LIGHT | , | ||
(char *)"solidLight" | |||
) |
call the callback specified from the caller (eg. NimBLE_PetTutor_Server .. or others)
if | ( | ! | isEmptyString_ssidString | ) |
setup the WIFI if the ssid string (at least) is specified
new: go out and let the process work... set the state, then the 'loop' will call setupWIF(...)
Definition at line 527 of file REFAcTOR.c.
if | ( | ! | saveJSONPreferences | ) |
don't save the preferences, since it didn't have enough information..
Definition at line 549 of file REFAcTOR.c.
if | ( | a1 && | strlena1, |
0 | |||
) |
end process commands..
TRY without 1.30.22 (RAMS win) and it works.. if can talk BLE, then reboot.. 2.2.22
{ "ssid" : "SunnyWhiteriver", "ssidPassword" : "sunny2021", "mqtt_topic": "usersP/bark/test", "mqtt_user" : "test", "deviceName" : "HowieFeeder", "mqtt_password" : "password..", "mqtt_guestPassword" : "password", "uuid" : "scott", "mqtt_port" : "1883", "mqtt_server" : "idogwatch.com", "mqtt_status" : "Success", "location": "whatever to reply with, GPS, state, city, etc.." }
todo pass the guest password too ! Store wifi config. ␖å␖␖å␖¨wifi␖é␖␖ç␖®␖ä␖¡␖æ␖¯
Definition at line 397 of file REFAcTOR.c.
if | ( | a10 | ) |
if | ( | a11 && | strlena11, |
0 | |||
) |
if | ( | a2 && | strlena2, |
0 | |||
) |
if | ( | a3 | ) |
if | ( | a4 | ) |
if | ( | a5 | ) |
if | ( | a6 | ) |
if | ( | a7 && | strlena7, |
0 | |||
) |
if | ( | a8 | ) |
if | ( | a9 | ) |
else if | ( | guestCmd | ) |
{'guest':'guest password'}
Definition at line 129 of file REFAcTOR.c.
else if | ( | semanticMarkerCmd | ) |
use the name/cat/uuid ..
Definition at line 135 of file REFAcTOR.c.
else if | ( | sendCmd | ) |
5.24.22 send:<request> .. Note these are for cmd without an argument..
NOTE: This will be calling ourself
request a TEMP be sent.
request a STATUS be sent.
request a CAPTURE be sent.
request a VOLUME be sent.
Definition at line 326 of file REFAcTOR.c.
else if | ( | setCmd && | valCmd | ) |
5.12.22
options: hightemp, feedcount, timeout
try 5.12.22 {'set':'item'},{'val':'value'} eg. set:hightemp, val:80) TODO: confirm valid integer values...
set the high temp value..
set the stepperangle.
set the timeout from no click to poweroff
called to set a preference (which will be an identifier and a string, which can be converted to a number or boolean)
add stepper type
called to set a preference (which will be an identifier and a string, which can be converted to a number or boolean)
add stepper type
set the location
rename device
since renaming, lets set a STATUS out.. request a STATUS be sent.
paireddev the paired device
saves the pair device name TODO: the feed device should use the pair as well.. (DONE..)
set the screen color 0..n
sets the gen3only flag
sets the gen3only flag
for now just reboot which will use this perference
sets the gen3only flag
sets the bleusepaireddevicename flag
sets the gen3only flag
sets the bleusedevicename flag
for now just reboot which will use this perference and re-create the service name..
send message to ourself to process the current mode..
send message to ourself to process the current mode..
store the JSON version of these credentials..
Definition at line 146 of file REFAcTOR.c.
else if | ( | strcasecmp(setCmdString,"bleclient") | = =0 | ) |
for now just reboot which will use this perference
for now just reboot which will use this perference
Definition at line 20 of file REFAcTOR.c.
else if | ( | strcasecmp(setCmdString,"bleserver") | = =0 | ) |
for now just reboot which will use this perference
for now just reboot which will use this perference
Definition at line 44 of file REFAcTOR.c.
else if | ( | strcasecmp(setCmdString,"buzz") | = =0 | ) |
TODO: duplicate and depreciate these and replace with set:buzz,val:on.
Definition at line 4 of file REFAcTOR.c.
else if | ( | strcasecmp(setCmdString,"tilt") | = =0 | ) |
else if | ( | strcasecmp(setCmdString,"zoomSm") | = =0 | ) |
zoom == the NON semantic marker version.. so min menu is true
zoom only if in the max menu set..
zoom only if in the max menu set..
send message to ourself to process the current mode..
Definition at line 83 of file REFAcTOR.c.
main_credentialsUpdated | ( | ) |
new 4.8.22 .. trying to kick out of AP mode if the credentials are good..
new 4.8.22 .. trying to kick out of AP mode if the credentials are good..
April 8, 2022 set that the credentials are set. Called from the MQTT after processJSONMessage() found things were good..
Definition at line 392 of file MainModule.cpp.
SerialTemp println | ( | _ssidString | ) |
SerialTemp println | ( | a1 | ) |
void restartWIFI_MQTTState | ( | ) |
restart the WIFI and then MQTT connection
Definition at line 570 of file REFAcTOR.c.
startDelay_WIFI_MQTTState | ( | ) |
init the delay, this uses the array of delays so we can change easier..
Definition at line 561 of file MQTTNetworking.cpp.
updatePreferencesInEPROM | ( | ) |
NOTE: this writes over entire values, since it's a string vs an JSON object.
just update the EPROM, and send that to the WIFI_AP module as well
basically if only the ssid/pass are sent, that is all that's written to EPROM even if the other information is available.. So recreate the JSON instead.. seems c++ you cannot re-use output as it just appends to it.. unreal
JSON
open the preferences
save in EPROM
Close the Preferences
sets the MQTT user/password. It's up to the code to decide who needs to know (currently saves in the WIFI_APModule
NEW: 2.21.22 TRY: reading back..
check ... _fullMessage Close the Preferences
Definition at line 583 of file REFAcTOR.c.
_globalMQTTAttempts = 0 |
reset the MQTT attempts
Definition at line 523 of file REFAcTOR.c.
else _ssidPasswordString = NULL |
Definition at line 417 of file REFAcTOR.c.
else _ssidString = NULL |
Definition at line 403 of file REFAcTOR.c.
_WIFI_MQTTState = preSetupWIFI |
putting here .. time might have gone too fast..
Definition at line 562 of file REFAcTOR.c.
else |
Definition at line 538 of file REFAcTOR.c.
saveJSONPreferences = true |
Definition at line 525 of file REFAcTOR.c.
return true |
this return is important!!!
Definition at line 364 of file REFAcTOR.c.