19void stepperModule_ProcessClientCmd(
char cmd)
21 SerialError.printf(
"UNDEFINED: stepperModule_processClientCmd: %c\n", cmd);
44 ESP_ERROR_CHECK(nvs_flash_erase());
59 SerialInfo.println(
"******************");
60 SerialMin.println(VERSION);
63 SerialDebug.print(
"Compiled ");
64 SerialDebug.print(__DATE__);
65 SerialDebug.print(
" @ ");
66 SerialDebug.println(__TIME__);
83 SerialInfo.println(
"******************");
85#ifdef USE_SPIFF_MODULE
92#ifdef USE_CAMERA_MODULE
96#ifdef USE_BUTTON_MODULE
106#ifdef USE_AUDIO_MODULE
110#ifdef USE_STEPPER_MODULE
120 SerialInfo.println(
"Starting PetTutor_Server");
121 SerialDebug.printf(
"M5STACK VERSION = %s\n", M5STACK_VERSION);
124#ifdef USE_MQTT_NETWORKING
145#ifdef USE_WIFI_AP_MODULE
152#ifdef USE_BLE_SERVER_NETWORKING
161#ifdef USE_MQTT_NETWORKING
171 SerialDebug.println(
"done setupBLEServerNetworking");
182#ifdef USE_BLE_CLIENT_NETWORKING
187#ifdef USE_WIFI_AP_MODULE
216#ifdef USE_WIFI_AP_MODULE
225 SerialDebug.print(
"From WIFI -> JSON = ");
226 SerialDebug.println(jsonOutputString);
229#ifdef USE_MQTT_NETWORKING
232#ifdef USE_WIFI_AP_MODULE
235 SerialDebug.println(
"calling .. processJSONMessage");
256 SerialDebug.print(
"DeviceName: ");
257 SerialDebug.println(deviceName);
262#ifdef USE_WIFI_AP_MODULE
287#ifdef USE_AUDIO_MODULE
291 #ifdef USE_CAMERA_MODULE
296#ifdef USE_WIFI_AP_MODULE
306 SerialDebug.println(
"doneWIFI_APModuleCredentials, and now calling finishSetup()");
320#ifdef USE_BUTTON_MODULE
325#ifdef USE_STEPPER_MODULE
334#ifdef USE_BLE_CLIENT_NETWORKING
340#ifdef USE_WIFI_AP_MODULE
349#ifdef USE_MQTT_NETWORKING
354#ifdef USE_BLE_SERVER_NETWORKING
369#ifdef USE_WIFI_AP_MODULE
373#ifdef USE_WIFI_AP_MODULE
void loop_AudioModule()
called for the loop() of this plugin
void loop_BLEClientNetworking()
the loop()
void setup_BLEClientNetworking(char *serviceName, char *serviceUUID, char *characteristicUUID)
the setup() and loop() passing the serviceName to look for..
void loop_BLEServerNetworking()
the 'loop' for this module BLEServerNetworking.
void setup_BLEServerNetworking(char *serviceName, char *deviceName, char *serviceUUID, char *characteristicUUID)
the 'setup' for this module BLEServerNetworking. Here the service name is added (and potentially more...
#define BLE_SERVER_CALLBACK_STATUS_MESSAGE
used to send a string message back (which might be sent to MQTT for example)
#define BLE_SERVER_CALLBACK_ONWRITE
void loop_displayModule()
called for the loop() of this plugin
void setup_displayModule()
for types: String, boolean ..
boolean _finishSetupCalledAlready
defines.h defines the #ifdef USE_MODULE statements, as they are included elsewhere....
void finishSetup()
called to finsh the setup.. this is because the MQTT and WIFI aren't run if in AP mode....
void loop()
main loop() of the Arduino runtime
void setup_MQTTNetworking()
setup the MQTT part of networking
void loop_MQTTNetworking()
called for the loop() of this plugin
boolean processJSONMessageMQTT(char *ascii, char *topic)
process the JSON message (looking for FEED, etc). Note: topic can be nil, or if not,...
char * getDeviceNameMQTT()
called for things like the advertisement
#define MQTT_CLEAN_SSID_EPROM
#define MQTT_CALLBACK_BLINK
#define MQTT_CALLBACK_FEED
#define MQTT_CALLBACK_SOLID_LIGHT
#define MQTT_CALLBACK_TILT_MOTION_DETECTED
void cleanSSID_EPROM_MessageCallback(char *message)
clean the SSID eprom (MQTT_CLEAN_SSID_EPROM)
void loop_mainModule()
called for the loop() of this plugin
void registerCallbackMain(int callbacksModuleId, int callbackType, void(*callback)(char *))
register the callback based on the callbackType. use the callbacksModuleId for which one....
#define CALLBACKS_BLE_SERVER
void onStatusMessageBLEServerCallback(char *message)
The callback for "status messages" of the bluetooth.
void solidLightOnOff(boolean onOff)
callback for SOLID blinking led
void setup_mainModule()
called from the setup()
boolean stopAllProcesses_mainModule()
if stopped
void initAsyncCallFlags()
initialize the async call flags (with and without parameters)
void solidLightMessageCallback(char *message)
callback for SOLID blinking led
void feedMessageCallback(char *message)
void invokeAsyncCommands()
checks if any async commands are in 'dispatch' mode, and if so, invokes them, and sets their flag to ...
void onWriteBLEServerCallback(char *message)
The callback for "onWrite" of the bluetooth "onWrite'.
void blinkMessageCallback(char *message)
callback for blinking led
void main_printModuleConfiguration()
void singleClickTouched(char *whichButton)
#define CALLBACKS_BUTTON_MODULE
#define PT_CHARACTERISTIC_UUID
boolean getPreferenceBoolean_mainModule(int preferenceID)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
#define PREFERENCE_MAIN_BLE_SERVER_VALUE
void println_SPIFFModule(char *string)
print a string to spiff (a new line is added)
void setup_SPIFFModule()
the setup for this module
void loop_StepperModule()
the main loop fro the StepperModule. This used be called FeederStateMachine()
void setup_StepperModule()
called on setup()
void setup_UIModule()
UIModule
void loop_UIModule()
the main loop()
String WIFI_APModule_JsonOutputString()
retrieves the JSON string
void loop_WIFI_APModule()
main loop
void setup_WIFI_APModule()
sets the config in the EPPROM called wifi-config. NOTE: the _done isn't valid until after this code....
void WIFI_APModule_ResetCredentials()
resets the credentials
boolean doneWIFI_APModule_Credentials()
called to see if the WIFIModule has finished bootstrapping..
void preSetup_WIFI_APModule()