@@ -232,6 +232,14 @@ void startWebServer()
232232 const AsyncWebParameter * p = request -> getParam ("miscConfigInfo" , true);
233233 prefs .begin ("miscConfigInfo" , false, nvsPartition );
234234 boolean success = prefs .putBytes ("miscConfigInfo" , p -> value ().c_str (), p -> value ().length () + 1 );
235+ // print length then string then bytes in ascii
236+ Serial .println (p -> value ().length () + 1 );
237+ Serial .println (p -> value ());
238+ for (size_t i = 0 ; i < p -> value ().length () + 1 ; i ++ ) {
239+ Serial .print ((uint8_t )p -> value ().c_str ()[i ], DEC );
240+ Serial .print (" " );
241+ }
242+ Serial .println ();
235243 prefs .end ();
236244 if (success ) {
237245 request -> send (200 , "text/plain" , "OK" );
@@ -245,10 +253,18 @@ void startWebServer()
245253
246254 server .on ("/loadMiscConfigInfo.json" , HTTP_GET , [](AsyncWebServerRequest * request ) {
247255 prefs .begin ("miscConfigInfo" , true, nvsPartition );
256+ Serial .println ("Loading miscConfigInfo:" );
248257 if (prefs .isKey ("miscConfigInfo" )) {
249258 size_t len = prefs .getBytesLength ("miscConfigInfo" ); // Preferences library allows long byte arrays but limits strings
250259 char buf [len ];
251260 request -> send (200 , "application/json" , buf );
261+ Serial .println (len );
262+ Serial .println (buf );
263+ for (size_t i = 0 ; i < len ; i ++ ) {
264+ Serial .print ((uint8_t )buf [i ], DEC );
265+ Serial .print (" " );
266+ }
267+ Serial .println ();
252268 } else {
253269 request -> send (200 , "application/json" , "{}" );
254270 }
0 commit comments