33 SerialError.printf(
"UNDEFINED: stepperModule_processClientCmd: %c\n", cmd);
62 ESP_ERROR_CHECK(nvs_flash_erase());
71#ifdef TRY_NEW_SERIAL_WAIT
74 Serial.println(
"ESP_IOT Startup");
88 SerialInfo.println(
"******************");
89 SerialMin.println(VERSION);
92 SerialDebug.print(
"Compiled ");
93 SerialDebug.print(__DATE__);
94 SerialDebug.print(
" @ ");
95 SerialDebug.println(__TIME__);
110 SerialInfo.println(
"******************");
115#ifdef USE_SPIFF_MODULE
128#ifdef USE_BUTTON_MODULE
135#ifdef USE_AUDIO_MODULE
139#ifdef USE_STEPPER_MODULE
143#ifdef FEED_ON_STARTUP
148 SerialDebug.println(
"stopMotor ..");
160 SerialDebug.println(
"Starting PetTutor_Server");
161 SerialDebug.printf(
"M5STACK VERSION = %s\n", M5STACK_VERSION);
191 boolean useBLEServer =
true;
216 SerialDebug.printf(
"done setupBLEServerNetworking: %s:%s\n", serverServiceName,
getDeviceNameMQTT());
257 SerialDebug.print(
"From WIFI -> JSON = ");
258 SerialDebug.println(jsonOutputString);
267 SerialDebug.println(
"calling .. processJSONMessage");
288 SerialDebug.print(
"DeviceName: ");
289 SerialDebug.println(deviceName);
295#ifdef USE_REST_MESSAGING
296 setupSecureRESTCall();
301#ifdef USE_CAMERA_MODULE_x
302 setup_CameraModule();
310#ifdef USE_PLATFORM_IO
320#ifdef USE_REST_MESSAGING
337#ifdef USE_AUDIO_MODULE
343#ifdef USE_CAMERA_MODULE_x
356 SerialDebug.println(
"doneWIFI_APModuleCredentials, and now calling finishSetup()");
372#ifdef USE_STEPPER_MODULE
398 boolean useBLEServer =
true;
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 ..
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
8.16.25 MQTT
#define MQTT_CALLBACK_SOLID_LIGHT
#define MQTT_CALLBACK_TILT_MOTION_DETECTED
#define CALLBACKS_MQTT
8.16.25 MQTT
boolean registerPinUse_mainModule(long pin, String pinName, String moduleName, boolean isI2C)
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 stopMotor_mainModule()
added 9.29.22 to support wildcards #196
void feedMessageCallback(char *message)
void setup_Sensors_mainModule()
1.22.24 setup of buttons
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'.
char * getServerServiceName_mainModule()
void loop_Sensors_mainModule()
1.22.24 add setup and loop at main so it can call appropriate plugs
void blinkMessageCallback(char *message)
callback for blinking led
void main_printModuleConfiguration()
void singleClickTouched(char *whichButton)
#define CALLBACKS_BUTTON_MODULE
void espBegin_mainModule(int num)
#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_JSON(char *attribute, char *value)
4.4.24 output a line in JSON format adding timestamp as well
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
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()
void mainLoop()
main loop() of the Arduino runtime
boolean _finishSetupCalledAlready
#define LED
defines.h defines the #ifdef USE_MODULE statements, as they are included elsewhere....
void stepperModule_ProcessClientCmd(char cmd)
void finishSetup()
called to finsh the setup.. this is because the MQTT and WIFI aren't run if in AP mode....