<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I need help with a webserver project...]]></title><description><![CDATA[<p dir="auto">Hi you all!<br />
I'm trying to setup my first project based on M5Stack but I dont' understand how to do it...<br />
I have an Arduino board sending one GET request per minute to a LAN address with some data passed as parameters and I would like to display those data on my M5.<br />
The string is something like this:<br />
http:\192.168.1.221?r=1&amp;da=20181101&amp;ti=1830&amp;v1=12345&amp;v2=12345&amp;v3=12345&amp;v4=12345<br />
and what I want to do is to decode data (da), time (ti) and v1, v2, v3, v4 as my data to display.<br />
So every time I got a new request I update the display with my new data.<br />
Could some of you help me doing this?<br />
I was thinking to start from an example but the one in Arduino IDE - M5Stack\Advanced\WiFiSetting is too difficult for me to understand...</p>
]]></description><link>https://community.m5stack.com/topic/391/i-need-help-with-a-webserver-project</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 04:20:23 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/391.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Nov 2018 17:54:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I need help with a webserver project... on Wed, 07 Nov 2018 19:35:04 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your help, I'll try to follow your directions in the following days.</p>
]]></description><link>https://community.m5stack.com/post/1946</link><guid isPermaLink="true">https://community.m5stack.com/post/1946</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Wed, 07 Nov 2018 19:35:04 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Tue, 06 Nov 2018 15:12:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/798">@crazyhorse80</a> 在 <a href="/post/1924">I need help with a webserver project...</a> 中说：</p>
<blockquote>
<p dir="auto">It's only a part of what I want to achieve and here I'll try to explain what my project should do when it'll be complete:</p>
<ul>
<li>every minute my M5Stack will receive from another Arduino board an HTTP GET request with data and it stores them in global variables and eventually does some operation with them;</li>
<li>it should have a multi-page view to show data received and stored in variables (one displays data in numeric form, another will display them in graphs, another one will only change screen background color and make some noise based on data received, and maybe some more);</li>
<li>it also should have access to the menus to change wi-fi and screen preferences and some more options related to my program (sound volume, default page to display on startup and so on).<br />
I'd also like to have some more widgets:</li>
<li>one will have to show me if data received is older than one minute (it means I've lost connection with the Arduino board);<br />
another one will have to show the current energy billing band based on what time and day of week it is.</li>
</ul>
<p dir="auto">The problem with M5ez, and ESP32 in general, is that I've no clue of where to put my code: do I have to do all in loop() function? Or should I register various functions with ez.addEvent()? Or should I do it some other way? I'm a bit confused... Can you show me a proof of concept application using M5ez (even if not related to my needs, so I could understand how it works)?</p>
</blockquote>
<p dir="auto">Zooming out and looking at your propject:</p>
<ul>
<li>
<p dir="auto">Have you considered using mqtt ? I'm no expert, but it seems built for jobs that involve getting values from A to B, figuring out if the sending side is still there, etc etc. All sorts of Arduino libraries for sending and receiving end.</p>
</li>
<li>
<p dir="auto">How to switch between functionality that runs concurrently is always an issue, and there are often more ways to accomplish the same thing. So don't worry too much if it seems hard now. It gets easier to wrap one's head around the program flow with experience, and it sucks in the beginning.</p>
</li>
</ul>
<p dir="auto">Specifically for this project:</p>
<ul>
<li>
<p dir="auto">To make widgets, after reading the user manual it's probably best to study the clock-related code in M5ez.cpp to see how it does its widget things.</p>
</li>
<li>
<p dir="auto">All web handling is done by the webserver code which you have placed in M5ez's main loop with <code>ez.addEvent</code>. The difference between placing code there and placing it in your sketch's <code>loop()</code> function is that <code>loop()</code> is not called when M5ez is waiting for input (like in menus, msgBox, etc etc).</p>
</li>
<li>
<p dir="auto">There is a way to add your own items to the M5ez settings menu. It's in the manual, but again: also look at how it's done inside M5ez.cpp, for example with the clock code.</p>
</li>
</ul>
<p dir="auto"> </p>
<p dir="auto">Good luck!</p>
]]></description><link>https://community.m5stack.com/post/1938</link><guid isPermaLink="true">https://community.m5stack.com/post/1938</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Tue, 06 Nov 2018 15:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Mon, 05 Nov 2018 16:58:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a> Here's what my full code looks like at the moment:</p>
<pre><code>#include &lt;M5Stack.h&gt;
#include &lt;ezTime.h&gt;
#include &lt;M5ez.h&gt;

#include &lt;WiFi.h&gt;
#include &lt;WiFiClient.h&gt;
#include &lt;WebServer.h&gt;
#include &lt;ESPmDNS.h&gt;

#include "images.h"

#define MAIN_DECLARED

WebServer rDserver(1980);

byte   remYear = 0;           // Current PVControl server Year
byte   remMonth = 0;          // Current PVControl server Month
byte   remDay = 0;            // Current PVControl server Day
byte   remHour = 0;           // Current PVControl server Hour
byte   remMinute = 0;         // Current PVControl server Minute
float  GenE = 0;              // Last Generated Energy
float  UseE = 0;              // Last Consumed Energy
float  TtGE = 0;              // Last to the Grid Energy
float  FtGE = 0;              // Last from the Grid Energy
int    GenP = 0;              // Last Generated Power
int    UseP = 0;              // Last Consumed Power
int    NetP = 0;              // Last Net Power

void setup() {
  #include &lt;themes/default.h&gt;
  #include &lt;themes/dark.h&gt;
  ezt::setDebug(NONE);
  ez.begin();
  if (ez.wifi.indexForSSID("xxx") == -1) {
    ez.wifi.add("xxx", "xxx");
    ez.wifi.writeFlash();
  }

  MDNS.begin("remdisplay1");

  rDserver.on("/", handleRoot);
  rDserver.onNotFound(handleNotFound);
  rDserver.begin();
  
  dacWrite(25,0); // Speaker mute

  ez.addEvent(serveClients, 3000);

  ezMenu mainmenu("remDisplay");
  //  mainmenu.txtSmall();
  mainmenu.addItem("PVControl", remDisplay);
  mainmenu.addItem("Settings", mainmenu_image);
  //  mainmenu.addItem("Updates via https", mainmenu_ota);
  mainmenu.upOnFirst("last|up");
  mainmenu.downOnLast("first|down");
  mainmenu.run();
}

void loop() {
  
}

uint16_t serveClients() {
  rDserver.handleClient();
  return 50;
}

void handleRoot() {
  for (uint8_t i = 0; i &lt; rDserver.headers(); i++) { //debug only
    Serial.print(" ");
    Serial.print(rDserver.headerName(i));
    Serial.print(": ");
    Serial.println(rDserver.header(i));
  }
  for (uint8_t i = 0; i &lt; rDserver.args(); i++) { //debug only
    Serial.print(" ");
    Serial.print(rDserver.argName(i));
    Serial.print(": ");
    Serial.println(rDserver.arg(i));
  }

  if(rDserver.args() == 7) {
      if((rDserver.argName(0) != "r") || (rDserver.argName(1) != "da")
        || (rDserver.argName(2) != "ti") || (rDserver.argName(3) != "v1")
          || (rDserver.argName(4) != "v2") || (rDserver.argName(5) != "v3")
            || (rDserver.argName(6) != "v4")) {
        rDserver.send(400, "text/plain", " Bad Request");
        return;
      }
      else {
        rDserver.send(200, "text/plain", " OK");

        remYear = atoi(rDserver.arg(1).substring(0,3).c_str());
        remMonth = atoi(rDserver.arg(1).substring(4,5).c_str());
        remDay = atoi(rDserver.arg(1).substring(6,7).c_str());
        remHour = atoi(rDserver.arg(2).substring(0,1).c_str());
        remMinute = atoi(rDserver.arg(2).substring(2,3).c_str());
        GenE = atoi(rDserver.arg(3).c_str());
        GenP = atoi(rDserver.arg(4).c_str());
        UseE = atoi(rDserver.arg(5).c_str());
        UseP = atoi(rDserver.arg(6).c_str());
        NetP = GenP - UseP;    // Last Net Power
        remDisplay();
      }
  }
  else {
    rDserver.send(400, "text/plain", " Bad Request");
    return;
  }
}

void handleNotFound() {
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += rDserver.uri();
  message += "\nMethod: ";
  message += (rDserver.method() == HTTP_GET) ? "GET" : "POST";
  message += "\nArguments: ";
  message += rDserver.args();
  message += "\n";
  for (uint8_t i = 0; i &lt; rDserver.args(); i++) {
    message += " " + rDserver.argName(i) + ": " + rDserver.arg(i) + "\n";
  }
  rDserver.send(404, "text/plain", message);
}

void mainmenu_image() {
  ezMenu images;
  images.imgBackground(TFT_BLACK);
  images.imgFromTop(40);
  images.imgCaptionColor(TFT_WHITE);
  images.addItem(sysinfo_jpg, "System Information", sysInfo);
  images.addItem(wifi_jpg, "Built-in wifi &amp; other settings", ez.settings.menu);
  images.addItem(wifi_jpg, "WiFi Settings", ez.wifi.menu);
  images.addItem(about_jpg, "About remDisplay", about);
  images.addItem(sleep_jpg, "Power Off", powerOff);
  images.addItem(return_jpg, "Back");
  images.run();
}

void powerOff() {
  m5.powerOFF();
}

void about() {
  ez.msgBox("About remDisplay", "");
}

String exit_buttonrD = "Exit";

void remDisplay() {
  remDisplayPage1();
  while (true) {
    String btn = ez.buttons.poll();
    if (btn == "up") remDisplayPage1();
    if (btn == "down") remDisplayPage2();
    if (btn == "Exit") break;
  }
}

void remDisplayPage1() {
  const byte tab = 120;
  ez.screen.clear();
  ez.header.show("PVControl  (1/2)");
  ez.buttons.show("#" + exit_buttonrD + "#down");
  ez.canvas.font(&amp;FreeSans9pt7b);
  ez.canvas.lmargin(10);
  ez.canvas.println("");
  ez.canvas.print("Produzione:");
  ez.canvas.x(tab);ez.canvas.print(GenP); ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.print(GenE / 1000); ez.canvas.println(" kWh");
  ez.canvas.print("Consumo:");
  ez.canvas.x(tab); ez.canvas.print(UseP); ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.print(UseE / 1000); ez.canvas.println(" kWh");
  ez.canvas.print("Immissione:");
  ez.canvas.x(tab);
  if(NetP &gt; 0)
    ez.canvas.print(NetP);
  else
    ez.canvas.print("0");
  ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.println(" kWh");
  ez.canvas.print("Prelievo:");
  ez.canvas.x(tab);
  if(NetP &lt; 0)
    ez.canvas.print(abs(NetP));
  else
    ez.canvas.print("0");
  ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.println(" kWh");
}

void remDisplayPage2() {
  const byte tab = 140;
  ez.screen.clear();
  ez.header.show("PVControl  (2/2)");
  ez.buttons.show("up#" + exit_buttonrD + "#");
  ez.canvas.font(&amp;FreeSans9pt7b);
  ez.canvas.lmargin(10);
  ez.canvas.println("");
  ez.canvas.print("Free RAM:");  ez.canvas.x(tab);  ez.canvas.println(String((long)ESP.getFreeHeap()) + " bytes");
  ez.canvas.print("Min. free seen:");  ez.canvas.x(tab); ez.canvas.println(String((long)esp_get_minimum_free_heap_size()) + " bytes");
}
</code></pre>
<p dir="auto">It's only a part of what I want to achieve and here I'll try to explain what my project should do when it'll be complete:<br />
every minute my M5Stack will receive from another Arduino board an HTTP GET request with data and it stores them in global variables and eventually does some operation with them;<br />
it should have a multi-page view to show data received and stored in variables (one displays data in numeric form, another will display them in graphs, another one will only change screen background color and make some noise based on data received, and maybe some more);<br />
it also should have access to the menus to change wi-fi and screen preferences and some more options related to my program (sound volume, default page to display on startup and so on).<br />
I'd also like to have some more widgets:<br />
one will have to show me if data received is older than one minute (it means I've lost connection with the Arduino board);<br />
another one will have to show the current energy billing band based on what time and day of week it is.<br />
The problem with M5ez, and ESP32 in general, is that I've no clue of where to put my code: do I have to do all in loop() function? Or should I register various functions with ez.addEvent()? Or should I do it some other way? I'm a bit confused... Can you show me a proof of concept application using M5ez (even if not related to my needs, so I could understand how it works)?</p>
]]></description><link>https://community.m5stack.com/post/1924</link><guid isPermaLink="true">https://community.m5stack.com/post/1924</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Mon, 05 Nov 2018 16:58:47 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 20:35:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/798">@crazyhorse80</a> Maybe show the whole code you're running now?</p>
]]></description><link>https://community.m5stack.com/post/1919</link><guid isPermaLink="true">https://community.m5stack.com/post/1919</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sun, 04 Nov 2018 20:35:17 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 20:33:34 GMT]]></title><description><![CDATA[<p dir="auto">I need the clock... :( I have that same error every 5 / 7 minutes, it restarts and works for a few minutes again and so on...<br />
Maybe I can do some test without the clock to see if it is the cause of the problem...</p>
]]></description><link>https://community.m5stack.com/post/1918</link><guid isPermaLink="true">https://community.m5stack.com/post/1918</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sun, 04 Nov 2018 20:33:34 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 20:26:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/798">@crazyhorse80</a> Looks like it somehow crashed while M5ez was printing the on-screen clock, but no clue why. Try turning off the on-screen clock... Shouldn't do this no matter what though.</p>
]]></description><link>https://community.m5stack.com/post/1917</link><guid isPermaLink="true">https://community.m5stack.com/post/1917</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sun, 04 Nov 2018 20:26:38 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 12:55:49 GMT]]></title><description><![CDATA[<p dir="auto">Could you please help me with this backtrace I got few moments ago?</p>
<pre><code>PC: 0x400853e3: esp_log_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/log/log.c line 214
EXCVADDR: 0x00000000

Decoding stack results
0x400853e3: esp_log_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/log/log.c line 214
0x400f54d2: __assert_func at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/bootloader_support/src/bootloader_init.c line 537
0x4008de99: vTaskEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/portmux_impl.inc.h line 106
0x4008fd4b: multi_heap_internal_lock at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/multi_heap.c line 372
0x400903d3: multi_heap_malloc at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/multi_heap_poisoning.c line 190
0x400856b5: heap_caps_malloc at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/heap_caps.c line 110
0x400857b9: heap_caps_realloc at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/heap_caps.c line 275
0x4008586e: heap_caps_realloc_default at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/heap_caps.c line 162
0x40087799: _realloc_r at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/newlib/syscalls.c line 47
0x400ead7a: String::changeBuffer(unsigned int) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\cores\esp32\WString.cpp line 170
0x400eadc8: String::reserve(unsigned int) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\cores\esp32\WString.cpp line 158
0x400eade9: String::copy(char const*, unsigned int) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\cores\esp32\WString.cpp line 195
0x400eae23: String::String(char const*) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\cores\esp32\WString.cpp line 39
0x400d8dfa: Timezone::dateTime(long, ezLocalOrUTC_t, String) at C:\Arduino-1.8.7\portable\sketchbook\libraries\ezTime\src\ezTime.cpp line 1164
0x400d9622: Timezone::dateTime(long, String) at C:\Arduino-1.8.7\portable\sketchbook\libraries\ezTime\src\ezTime.cpp line 1154
0x400d9801: Timezone::dateTime(String) at C:\Arduino-1.8.7\portable\sketchbook\libraries\ezTime\src\ezTime.cpp line 1150
0x400e1eb3: ezClock::draw(unsigned short, unsigned short) at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 973
0x400de59d: ezHeader::show(String) at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 184
0x400d2307: remDisplayPage1() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 164
0x400d26ba: remDisplay() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 152
0x400d2c13: handleRoot() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 103
0x4017b6c1: std::_Function_handler ::_M_invoke(std::_Any_data const&amp;) at c:\arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0/functional line 1871
0x400d5ee2: std::function ::operator()() const at c:\arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400e9bdd: FunctionRequestHandler::handle(WebServer&amp;, HTTPMethod, String) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\detail/RequestHandlersImpl.h line 42
0x400e9c2a: WebServer::_handleRequest() at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 617
0x400e9d86: WebServer::handleClient() at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 320
0x400d3a44: serveClients() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 64
0x400dbb68: M5ez::yield() at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 1736
0x400dbbb4: ezButtons::poll() at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 612
0x400d26c2: remDisplay() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 154
0x400d2c13: handleRoot() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 103
0x4017b6c1: std::_Function_handler ::_M_invoke(std::_Any_data const&amp;) at c:\arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0/functional line 1871
0x400d5ee2: std::function ::operator()() const at c:\arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400e9bdd: FunctionRequestHandler::handle(WebServer&amp;, HTTPMethod, String) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\detail/RequestHandlersImpl.h line 42
0x400e9c2a: WebServer::_handleRequest() at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 617
0x400e9d86: WebServer::handleClient() at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 320
0x400d3a44: serveClients() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 64
0x400dbb68: M5ez::yield() at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 1736
0x400dbbb4: ezButtons::poll() at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 612
0x400d26c2: remDisplay() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 154
0x400d2c13: handleRoot() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 103
0x4017b6c1: std::_Function_handler ::_M_invoke(std::_Any_data const&amp;) at c:\arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0/functional line 1871
0x400d5ee2: std::function ::operator()() const at c:\arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\tools\xtensa-esp32-elf\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400e9bdd: FunctionRequestHandler::handle(WebServer&amp;, HTTPMethod, String) at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\detail/RequestHandlersImpl.h line 42
0x400e9c2a: WebServer::_handleRequest() at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 617
0x400e9d86: WebServer::handleClient() at C:\Arduino-1.8.7\portable\sketchbook\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 320
0x400d3a44: serveClients() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 64
0x400dbb68: M5ez::yield() at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 1736
0x400dbbb4: ezButtons::poll() at C:\Arduino-1.8.7\portable\sketchbook\libraries\M5ez\src\M5ez.cpp line 612
0x400d26c2: remDisplay() at Z:\_PVControl\M5remDisplay/M5remDisplay.ino line 154
</code></pre>
]]></description><link>https://community.m5stack.com/post/1907</link><guid isPermaLink="true">https://community.m5stack.com/post/1907</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sun, 04 Nov 2018 12:55:49 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 12:53:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/798">@crazyhorse80</a> :)</p>
]]></description><link>https://community.m5stack.com/post/1906</link><guid isPermaLink="true">https://community.m5stack.com/post/1906</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sun, 04 Nov 2018 12:53:57 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 12:50:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a> I found where the error was! I was streaming my GET request string to the client with multiple prints and while it is OK for connecting to a web site I send data to and to my MySQL database, it was not OK for the M5Stack.<br />
I set up a buffer string, printed all my data in it and then use it to send data to my client object and now it work flawless! I got my stream of data sent every minute!</p>
]]></description><link>https://community.m5stack.com/post/1905</link><guid isPermaLink="true">https://community.m5stack.com/post/1905</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sun, 04 Nov 2018 12:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 10:04:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a> I've just tried what you said but with no luck at all (it seems to be worst than before)... It must be something related to M5Stack, 'cause if I set another Arduino with the IP of M5Stack it gets a request every minute and it works as intended to. I'l try to setup a program without M5ez and see if it works that way, maybe there's something wrong with interactions between it and the webserver part...<br />
Thank you for all your help!</p>
]]></description><link>https://community.m5stack.com/post/1898</link><guid isPermaLink="true">https://community.m5stack.com/post/1898</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sun, 04 Nov 2018 10:04:33 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sun, 04 Nov 2018 09:25:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/798">@crazyhorse80</a> I don't see anything that's obviously wrong with it. In <code>serveClients()</code> I would set the return value at 50 instead of 500.Usually there will be nothing to do so it will return quickly. But if there is something to do, half a second is a bit of a long time which adds to other possible timeouts elsewhere and maybe screws things up. That and turning off the errors would be my only two pieces of advice, really. If that doesn't help I don't know...</p>
]]></description><link>https://community.m5stack.com/post/1897</link><guid isPermaLink="true">https://community.m5stack.com/post/1897</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sun, 04 Nov 2018 09:25:33 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 22:19:58 GMT]]></title><description><![CDATA[<p dir="auto">This is the code (it's my first try, be kind! :D):</p>
<pre><code>#include &lt;M5Stack.h&gt;
#include &lt;ezTime.h&gt;
#include &lt;M5ez.h&gt;

#include &lt;WiFi.h&gt;
#include &lt;WiFiClient.h&gt;
#include &lt;WebServer.h&gt;
#include &lt;ESPmDNS.h&gt;

#include "images.h"

#define MAIN_DECLARED

WebServer rDserver(1980);

byte   remYear = 0;           // Current PVControl server Year
byte   remMonth = 0;          // Current PVControl server Month
byte   remDay = 0;            // Current PVControl server Day
byte   remHour = 0;           // Current PVControl server Hour
byte   remMinute = 0;         // Current PVControl server Minute
float  GenE = 0;              // Last Generated Energy
float  UseE = 0;              // Last Consumed Energy
float  TtGE = 0;              // Last to the Grid Energy
float  FtGE = 0;              // Last from the Grid Energy
int    GenP = 0;              // Last Generated Power
int    UseP = 0;              // Last Consumed Power
int    NetP = 0;              // Last Net Power

void setup() {
  #include &lt;themes/default.h&gt;
  #include &lt;themes/dark.h&gt;
  ezt::setDebug(INFO);
  ez.begin();
  if (ez.wifi.indexForSSID("xxx") == -1) {
    ez.wifi.add("xxx", "xxx");
    ez.wifi.writeFlash();
  }

  MDNS.begin("remdisplay1");

  rDserver.on("/", handleRoot);
  rDserver.onNotFound(handleNotFound);
  rDserver.begin();
  
  dacWrite(25,0); // Speaker mute

  ez.addEvent(serveClients, 3000);

  ezMenu mainmenu("remDisplay");
  //  mainmenu.txtSmall();
  mainmenu.addItem("PVControl", remDisplay);
  mainmenu.addItem("Settings", mainmenu_image);
  //  mainmenu.addItem("Updates via https", mainmenu_ota);
  mainmenu.upOnFirst("last|up");
  mainmenu.downOnLast("first|down");
  mainmenu.run();
}

void loop() {
  
}

uint16_t serveClients() {
  rDserver.handleClient();
  return 500;
}

void handleRoot() {
  rDserver.send(200, "text/plain", " OK");

  for (uint8_t i = 0; i &lt; rDserver.headers(); i++) {
    Serial.print(" ");
    Serial.print(rDserver.headerName(i));
    Serial.print(": ");
    Serial.println(rDserver.header(i));
  }
  for (uint8_t i = 0; i &lt; rDserver.args(); i++) {
    Serial.print(" ");
    Serial.print(rDserver.argName(i));
    Serial.print(": ");
    Serial.println(rDserver.arg(i));
  }

  if(rDserver.args() == 7) {
      if((rDserver.argName(0) != "r") || (rDserver.argName(1) != "da")
        || (rDserver.argName(2) != "ti") || (rDserver.argName(3) != "v1")
          || (rDserver.argName(4) != "v2") || (rDserver.argName(5) != "v3")
            || (rDserver.argName(6) != "v4")) {
        return;
      }
      else {
        remYear = atoi(rDserver.arg(1).substring(0,3).c_str());
        remMonth = atoi(rDserver.arg(1).substring(4,5).c_str());
        remDay = atoi(rDserver.arg(1).substring(6,7).c_str());
        remHour = atoi(rDserver.arg(2).substring(0,1).c_str());
        remMinute = atoi(rDserver.arg(2).substring(2,3).c_str());
        GenE = atoi(rDserver.arg(3).c_str());
        GenP = atoi(rDserver.arg(4).c_str());
        UseE = atoi(rDserver.arg(5).c_str());
        UseP = atoi(rDserver.arg(6).c_str());
        NetP = GenP - UseP;    // Last Net Power
        remDisplay();
      }
  }
}

void handleNotFound() {
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += rDserver.uri();
  message += "\nMethod: ";
  message += (rDserver.method() == HTTP_GET) ? "GET" : "POST";
  message += "\nArguments: ";
  message += rDserver.args();
  message += "\n";
  for (uint8_t i = 0; i &lt; rDserver.args(); i++) {
    message += " " + rDserver.argName(i) + ": " + rDserver.arg(i) + "\n";
  }
  rDserver.send(404, "text/plain", message);
}

void mainmenu_image() {
  ezMenu images;
  images.imgBackground(TFT_BLACK);
  images.imgFromTop(40);
  images.imgCaptionColor(TFT_WHITE);
  images.addItem(sysinfo_jpg, "System Information", sysInfo);
  images.addItem(wifi_jpg, "Built-in wifi &amp; other settings", ez.settings.menu);
  images.addItem(wifi_jpg, "WiFi Settings", ez.wifi.menu);
  images.addItem(about_jpg, "About remDisplay", about);
  images.addItem(sleep_jpg, "Power Off", powerOff);
  images.addItem(return_jpg, "Back");
  images.run();
}

void powerOff() {
  m5.powerOFF();
}

void about() {
}

String exit_buttonrD = "Exit";

void remDisplay() {
  remDisplayPage1();
  while (true) {
    String btn = ez.buttons.poll();
    if (btn == "up") remDisplayPage1();
    if (btn == "down") remDisplayPage2();
    if (btn == "Exit") break;
  }
}

void remDisplayPage1() {
  const byte tab = 120;
  ez.screen.clear();
  ez.header.show("PVControl  (1/2)");
  ez.buttons.show("#" + exit_buttonrD + "#down");
  ez.canvas.font(&amp;FreeSans9pt7b);
  ez.canvas.lmargin(10);
  ez.canvas.println("");
  ez.canvas.print("Produzione:");
  ez.canvas.x(tab);ez.canvas.print(GenP); ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.print(GenE / 1000); ez.canvas.println(" kWh");
  ez.canvas.print("Consumo:");
  ez.canvas.x(tab); ez.canvas.print(UseP); ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.print(UseE / 1000); ez.canvas.println(" kWh");
  ez.canvas.print("Immissione:");
  ez.canvas.x(tab);
  if(NetP &gt; 0)
    ez.canvas.print(NetP);
  else
    ez.canvas.print("0");
  ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.println(" kWh");
  ez.canvas.print("Prelievo:");
  ez.canvas.x(tab);
  if(NetP &lt; 0)
    ez.canvas.print(abs(NetP));
  else
    ez.canvas.print("0");
  ez.canvas.println(" W");
  ez.canvas.x(tab); ez.canvas.println(" kWh");
}

void remDisplayPage2() {
  const byte tab = 140;
  ez.screen.clear();
  ez.header.show("PVControl  (2/2)");
  ez.buttons.show("up#" + exit_buttonrD + "#");
  ez.canvas.font(&amp;FreeSans9pt7b);
  ez.canvas.lmargin(10);
  ez.canvas.println("");
  ez.canvas.print("Free RAM:");  ez.canvas.x(tab);  ez.canvas.println(String((long)ESP.getFreeHeap()) + " bytes");
  ez.canvas.print("Min. free seen:");  ez.canvas.x(tab); ez.canvas.println(String((long)esp_get_minimum_free_heap_size()) + " bytes");
}
</code></pre>
]]></description><link>https://community.m5stack.com/post/1895</link><guid isPermaLink="true">https://community.m5stack.com/post/1895</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sat, 03 Nov 2018 22:19:58 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 22:24:03 GMT]]></title><description><![CDATA[<p dir="auto">The only thing I did related to a timer, is using the ez.addevent to call the handleclient function  as you suggested in the other thread (actually I enclosed it in a function that returns the interval as you said to do). My program does not a lot other than running m5ez and the simple web server to collect data from the Arduino to display on m5stack... I don't know if I can post the entire code but I can try to...</p>
<p dir="auto">The timeout errors happen after few minutes from startup, but the connection seems to be good 'cause I can see the widget with 2 or 3 bars all the time.<br />
As for what the Arduino does, it sends a request to M5Stack every minute and it tries to send for 5 times if it didn't receive 200 OK response from server. It does that and the error I get on Arduino's side is "no connection", instead on M5Stack I can see nothing arriving (from serial monitor). Every now and then I receive some data but it's not a constant flow.<br />
Tomorrow I'll do some more tries without core debug...</p>
]]></description><link>https://community.m5stack.com/post/1894</link><guid isPermaLink="true">https://community.m5stack.com/post/1894</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sat, 03 Nov 2018 22:24:03 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 21:07:10 GMT]]></title><description><![CDATA[<p dir="auto">OK, I'm afraid I don't know your code well enough to be of much help, but here's some things I do know or think I know:</p>
<p dir="auto"> </p>
<p dir="auto">Most errors look harmless (or at least unconnected to your isssue) to me.</p>
<p dir="auto"> </p>
<pre><code>11:23:11.850 -&gt; [E][Preferences.cpp:437] getString(): nvs_get_str len fail: SSID2 NOT_FOUND
11:23:11.850 -&gt; [E][Preferences.cpp:437] getString(): nvs_get_str len fail: key2 NOT_FOUND
11:23:11.850 -&gt; [E][Preferences.cpp:306] getUChar(): nvs_get_u8 fail: faces_on NOT_FOUND
</code></pre>
<p dir="auto">Totally expected behaviour and in no way connected to your problem: M5ez is looking for stuff in NVS when it starts up, some it finds, some it doesn't.</p>
<p dir="auto"> </p>
<pre><code>Querying pool.ntp.org ... [E][WiFiUdp.cpp:170] beginPacket(): could not get host from dns: 11
21:00:32.992 -&gt; ERROR: Timeout
</code></pre>
<p dir="auto">If this was sometime after startup, it might point to the M5Stack having intermittent network connectivity.</p>
<p dir="auto"> </p>
<p dir="auto">I wonder what the other Arduino's view of the world is: does it think it can deliver the message when you don't get it displayed on the M5Stack?</p>
<p dir="auto"> </p>
<p dir="auto">As for the stack trace: it's a pity it doesn't go back into your code, that would have been more helpful. As it is if I had to wildly guess: does your code do anything that involves a timer? The problem seems to start by <code>time_alarm_isr</code> (the interrupt service routine) being called and then sometime later something being (possibly) unable to acquire a lock on some resource, possibly while writing a log entry. But I don't know the ESP core well myself either... I would recommend setting Core Debug Level to "None", it would not surprise me if that stops these crashes. (And who knows: maybe the core and your program fighting over the serial buffer was the whole problem to begin with...)</p>
]]></description><link>https://community.m5stack.com/post/1893</link><guid isPermaLink="true">https://community.m5stack.com/post/1893</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sat, 03 Nov 2018 21:07:10 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 18:14:10 GMT]]></title><description><![CDATA[<p dir="auto">Here it is (totally nonsense for me, remember I'm a noob with ESP):</p>
<pre><code>Decoding stack results
0x400907fc: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 155
0x400909d1: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 170
0x40081df9: lock_acquire_generic at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/newlib/locks.c line 141
0x40081f25: _lock_acquire_recursive at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/newlib/locks.c line 169
0x40118972: _vfprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 860
0x4011bbc5: vprintf at ../../../.././newlib/libc/stdio/vprintf.c line 39
0x400855ca: esp_log_write at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/log/log.c line 215
0x400f6872: __assert_func at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/bootloader_support/src/bootloader_init.c line 537
0x4008def9: vTaskEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/portmux_impl.inc.h line 105
0x4008d355: xQueueGiveFromISR at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/queue.c line 1323
0x40083bc8: timer_alarm_handler at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/esp_timer.c line 318
0x40083e15: timer_alarm_isr at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/esp_timer_esp32.c line 274
0x40107757: esp_vApplicationIdleHook at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/freertos_hooks.c line 64
</code></pre>
<p dir="auto">I think I'm not understanding how ESP32 works and so it's a lot of pain to write some code for me... I can work with Arduinos which use procedural code, but I'm guessing ESP32 is a totally different thing. Could it be that it has a small operating system that runs in parallel of my own code and I have to write only event driven functions? I need an ESP for dummy book for sure, do you know something easy to start from?</p>
]]></description><link>https://community.m5stack.com/post/1892</link><guid isPermaLink="true">https://community.m5stack.com/post/1892</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sat, 03 Nov 2018 18:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 12:35:43 GMT]]></title><description><![CDATA[<p dir="auto">Ah, a backtrace. You can copy paste that whole boot thing into the "<a href="https://github.com/me-no-dev/EspExceptionDecoder" target="_blank" rel="noopener noreferrer nofollow ugc">ESP Exception Decoder</a>" which you first have to install into the IDE. (Can't do it for you, it needs the compiled binary to work.) This will tell you what chain of routines (both in your own code and in the ESP core) were executing before it crashed. I'll look at your code later...</p>
]]></description><link>https://community.m5stack.com/post/1890</link><guid isPermaLink="true">https://community.m5stack.com/post/1890</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sat, 03 Nov 2018 12:35:43 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 10:59:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a> Thank you again... I was asking myself how to do that as I've seen it in other threads...</p>
<p dir="auto">In addition to the above, I've seen one more error when I let the program run for a while: the ntp query fails and sometimes the M5Stack reset itself.</p>
<pre><code>Querying pool.ntp.org ... [E][WiFiUdp.cpp:52] begin(): could not create socket: 23
11:45:53.755 -&gt; [E][WiFiUdp.cpp:151] beginPacket(): could not create socket: 23
11:45:53.755 -&gt; [E][WiFiUdp.cpp:183] endPacket(): could not send data: 9
11:45:53.755 -&gt; [E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
11:45:53.755 -&gt; [E][WiFiUdp.cpp:219] parsePacket(): could not receive data: 9
[...]
11:45:55.205 -&gt; ERROR: Timeout
</code></pre>
<pre><code>abort() was called at PC 0x40081df9 on core 0
11:23:10.935 -&gt; 
11:23:10.935 -&gt; Backtrace: 0x400907fc:0x3ffbdcd0 0x400909d1:0x3ffbdcf0 0x40081df9:0x3ffbdd10 0x40081f25:0x3ffbdd40 0x40118972:0x3ffbdd60 0x4011bbc5:0x3ffbe070 0x400855ca:0x3ffbe0a0 0x400f6872:0x3ffbe0f0 0x4008def9:0x3ffbe120 0x4008d355:0x3ffbe150 0x40083bc8:0x3ffbe170 0x40083e15:0x3ffbe1a0 0x400822e9:0x3ffbe1c0 0x40107757:0x00000000
11:23:10.935 -&gt; 
11:23:10.935 -&gt; Rebooting...
ets Jun  8 2016 00:22:57
11:23:10.969 -&gt; 
11:23:10.969 -&gt; rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
11:23:10.969 -&gt; configsip: 0, SPIWP:0xee
11:23:10.969 -&gt; clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:23:10.969 -&gt; mode:DIO, clock div:1
11:23:10.969 -&gt; load:0x3fff0018,len:4
11:23:10.969 -&gt; load:0x3fff001c,len:1496
11:23:10.969 -&gt; load:0x40078000,len:8596
11:23:10.969 -&gt; load:0x40080400,len:6980
11:23:10.969 -&gt; entry 0x400806f4
M5Stack initializing...[W][sd_diskio.cpp:149] sdCommand(): token error [59] 0x5
11:23:11.715 -&gt; [W][sd_diskio.cpp:149] sdCommand(): token error [8] 0x5
11:23:11.715 -&gt; OK
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
11:23:11.850 -&gt; [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
11:23:11.850 -&gt; [E][Preferences.cpp:437] getString(): nvs_get_str len fail: SSID2 NOT_FOUND
11:23:11.850 -&gt; [E][Preferences.cpp:437] getString(): nvs_get_str len fail: key2 NOT_FOUND
11:23:11.850 -&gt; [E][Preferences.cpp:306] getUChar(): nvs_get_u8 fail: faces_on NOT_FOUND
Querying pool.ntp.org ... ERROR: No network
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 1 - SCAN_DONE
Querying pool.ntp.org ... ERROR: No network
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 7 - STA_GOT_IP
11:23:16.675 -&gt; [D][WiFiGeneric.cpp:386] _eventCallback(): STA IP: 192.168.1.221, MASK: 255.255.255.0, GW: 192.168.1.1
Querying pool.ntp.org ... success (round trip 197 ms)
11:23:21.500 -&gt; Received time: Saturday, 03-Nov-18 10:23:21.771 UTC
Timezone lookup for: Europe/Rome ... ERROR: Timeout
[E][WiFiClient.cpp:427] flush(): 11
11:27:06.709 -&gt; [E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
11:27:06.709 -&gt;  Authorization: 
11:27:06.709 -&gt;  r: 1
11:27:06.709 -&gt;  da: 20181103
11:27:06.709 -&gt;  ti: 1127
11:27:06.709 -&gt;  v1: 2535.00
11:27:06.709 -&gt;  v2: 867.00
11:27:06.709 -&gt;  v3: 5565.00
11:27:06.709 -&gt;  v4: 3302.00
</code></pre>
]]></description><link>https://community.m5stack.com/post/1889</link><guid isPermaLink="true">https://community.m5stack.com/post/1889</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sat, 03 Nov 2018 10:59:31 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 10:18:50 GMT]]></title><description><![CDATA[<p dir="auto">If you edit the messages with logs or code in them, and put three backticks (~ without the shift on US keyboards) on an otherwise empty line before and after the code and possibly fix the tabs then I will take a look at it.</p>
]]></description><link>https://community.m5stack.com/post/1888</link><guid isPermaLink="true">https://community.m5stack.com/post/1888</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Sat, 03 Nov 2018 10:18:50 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Fri, 02 Nov 2018 21:14:08 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your reply, but I don't need to just turn off error displaying... I think there's actually some error, 'cause I cannot show an update every minute as I would like to... I cannot tell where the error is but I know there's something wrong...</p>
]]></description><link>https://community.m5stack.com/post/1887</link><guid isPermaLink="true">https://community.m5stack.com/post/1887</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Fri, 02 Nov 2018 21:14:08 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Fri, 02 Nov 2018 21:10:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/798">@crazyhorse80</a> Those error codes are from the ESP32 core, you can turn them off in the Arduino IDE by setting Tools/Core Debug Level to none. And if you find <code>setDebug (INFO)</code> and change it to <code>setDebug(NONE)</code> ezTime will no longer report about time events either.</p>
]]></description><link>https://community.m5stack.com/post/1886</link><guid isPermaLink="true">https://community.m5stack.com/post/1886</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Fri, 02 Nov 2018 21:10:43 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 10:52:42 GMT]]></title><description><![CDATA[<p dir="auto">I let it run for a while and I found it works, sometimes... But I can see some error on serial monitor and I'm not sure what they refer to. I can also see that I'm not getting a request every minute as it is supposed to be, but I get one at a random time. Here's what I can see on serial monitor:</p>
<pre><code>
20:50:16.156 -&gt; 
20:50:16.156 -&gt; rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
20:50:16.156 -&gt; configsip: 0, SPIWP:0xee
20:50:16.156 -&gt; clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
20:50:16.156 -&gt; mode:DIO, clock div:1
20:50:16.156 -&gt; load:0x3fff0018,len:4
20:50:16.156 -&gt; load:0x3fff001c,len:1496
20:50:16.156 -&gt; load:0x40078000,len:8596
20:50:16.156 -&gt; load:0x40080400,len:6980
20:50:16.156 -&gt; entry 0x400806f4
M5Stack initializing...OK
[E][Preferences.cpp:437] getString(): nvs_get_str len fail: SSID2 NOT_FOUND
20:50:17.033 -&gt; [E][Preferences.cpp:437] getString(): nvs_get_str len fail: key2 NOT_FOUND
20:50:17.033 -&gt; [E][Preferences.cpp:306] getUChar(): nvs_get_u8 fail: faces_on NOT_FOUND
Querying pool.ntp.org ... ERROR: No network
Querying pool.ntp.org ... ERROR: No network
Querying pool.ntp.org ... success (round trip 171 ms)
20:50:26.641 -&gt; Received time: Friday, 02-Nov-18 19:50:27.169 UTC
Timezone lookup for: Europe/Rome ... ERROR: Timeout
234092
[E][WiFiClient.cpp:427] flush(): 11
20:51:03.615 -&gt; [E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
20:51:03.615 -&gt; /
20:51:03.615 -&gt;  r: 1
20:51:03.615 -&gt;  da: 20181102
20:51:03.615 -&gt;  ti: 2051
20:51:03.615 -&gt;  v1: 0.00
20:51:03.615 -&gt;  v2: 0.00
20:51:03.615 -&gt;  v3: 1635.00
20:51:03.615 -&gt;  v4: 1545.00
231800
[E][WiFiClient.cpp:427] flush(): 11
20:56:03.746 -&gt; [E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
20:56:03.746 -&gt; /
20:56:03.746 -&gt;  r: 1
20:56:03.746 -&gt;  da: 20181102
20:56:03.746 -&gt;  ti: 2056
20:56:03.746 -&gt;  v1: 0.00
20:56:03.746 -&gt;  v2: 0.00
20:56:03.746 -&gt;  v3: 1761.00
20:56:03.746 -&gt;  v4: 1525.00
231496
[E][WiFiClient.cpp:427] flush(): 11
20:58:03.383 -&gt; [E][WiFiClient.cpp:236] setSocketOption(): 1006 : 9
20:58:03.383 -&gt; /
20:58:03.383 -&gt;  r: 1
20:58:03.383 -&gt;  da: 20181102
20:58:03.383 -&gt;  ti: 2058
20:58:03.383 -&gt;  v1: 0.00
20:58:03.383 -&gt;  v2: 0.00
20:58:03.383 -&gt;  v3: 1812.00
20:58:03.383 -&gt;  v4: 1525.00
Querying pool.ntp.org ... [E][WiFiUdp.cpp:170] beginPacket(): could not get host from dns: 11
21:00:32.992 -&gt; ERROR: Timeout
Querying pool.ntp.org ... success (round trip 175 ms)
21:00:37.695 -&gt; Received time: Friday, 02-Nov-18 20:00:38.172 UTC (internal clock was 5 ms slow)
</code></pre>
]]></description><link>https://community.m5stack.com/post/1885</link><guid isPermaLink="true">https://community.m5stack.com/post/1885</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sat, 03 Nov 2018 10:52:42 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Sat, 03 Nov 2018 10:51:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a><br />
I tried to use that one but I'm not successful with it... If I send my request manually through my web browser I got my data, but if I try to read from my Arduino board I can see nothing at all.<br />
The strange thing is that I set up two Arduino (one send requests and the other one display data from request) boards and they work.<br />
The code for the sender Arduino that I'm using is this:</p>
<pre><code>[...]
        // Try to send for 5 times
        for(byte r = 1; r &lt;= 5; r++)
          {
          remDisplayRetry = r;
          int res = remDisplay.connect(Display_IP, DISPLAY_PORT);
          if(res == 1) // connection successfull
            {
            remDisplay &lt;&lt; F("GET /");
            #if defined(USE_DEBUG)
              Serial &lt;&lt; F("GET /");
            #endif
            sprintf(webData, "?r=1&amp;da=%04d%02d%02d", year(),month(),day());
            remDisplay &lt;&lt; webData;
            #if defined(USE_DEBUG)
              Serial &lt;&lt; webData;
            #endif
            sprintf(webData, "&amp;ti=%02d%02d", hour(),minute());
            remDisplay &lt;&lt; webData;
            #if defined(USE_DEBUG)
              Serial &lt;&lt; webData;
            #endif
            for(byte i = 0; i &lt; 4; i++)
              {
              if(b[i])  // only send data if present
                {
                remDisplay &lt;&lt; "&amp;v" &lt;&lt; i+1 &lt;&lt; "=" &lt;&lt; v[i];
                #if defined(USE_DEBUG)
                  Serial &lt;&lt; "&amp;v" &lt;&lt; i+1 &lt;&lt; "=" &lt;&lt; v[i];
                #endif
                }
              }
            remDisplay &lt;&lt; F(" HTTP/1.1") &lt;&lt; endl;                      //TEST
            remDisplay &lt;&lt; F("Host: PVControl") &lt;&lt; endl &lt;&lt; endl;        //TEST
            remDisplay &lt;&lt; endl &lt;&lt; endl;                                  //TEST
            #if defined(USE_DEBUG)
              Serial &lt;&lt; endl &lt;&lt; endl;                                  //TEST
            #endif
            // give remDisplay some time to process the request
            delay(500);

            // skip the first part of the reply, which is "HTTP/1.1 "
            remDisplay.readBytes(webData, 9);
            // read the response code. 200 means ok. 0 means that there is no response yet
            byte lastResponse = remDisplay.parseInt();
            if(lastResponse == 0)
            {
              sprintf(remDisplayResponse,"Response timeout\0");
              remDisplayResponseTime = now();
            }
            else if(lastResponse != 200)
            { 
              sprintf(remDisplayResponse, "%03d",lastResponse);
              size_t numchars = remDisplay.readBytes(remDisplayResponse + 3, 75); 
              remDisplayResponse[numchars + 3] = '\0'; // terminate the string
              remDisplayResponseTime = now();
            }
            else if(lastResponse == 200)
            { 
              remDisplay.stop();
              break; // No need to retry remDisplay connection
            }

            }
          else // cannot connect
            {
            sprintf(remDisplayResponse,"No connection");
            remDisplayResponseTime = now();
            remDisplayRetry_Err = remDisplayRetry;
            }
          }
        }
[...]
</code></pre>
<p dir="auto">Do you see something wrong here?</p>
<p dir="auto">The code I use on my M5Stack is this:</p>
<pre><code>[...]
WebServer rDserver(1980);
void setup() {
  rDserver.on("/", handleRoot);
  rDserver.onNotFound(handleNotFound);
  rDserver.begin();
}

void handleRoot() {
  rDserver.send(200, "text/plain", " OK");

  Serial.println(rDserver.uri());
  for (uint8_t i = 0; i &lt; rDserver.args(); i++) {
    Serial.print(" ");
    Serial.print(rDserver.argName(i));
    Serial.print(": ");
    Serial.println(rDserver.arg(i));
  }

  if(rDserver.args() == 7) {
      if((rDserver.argName(0) != "r") || (rDserver.argName(1) != "da")
        || (rDserver.argName(2) != "ti") || (rDserver.argName(3) != "v1")
          || (rDserver.argName(4) != "v2") || (rDserver.argName(5) != "v3")
            || (rDserver.argName(6) != "v4")) {
        return;
      }
      else {
        remYear = atoi(rDserver.arg(1).substring(0,3).c_str());
        remMonth = atoi(rDserver.arg(1).substring(4,5).c_str());
        remDay = atoi(rDserver.arg(1).substring(6,7).c_str());
        remHour = atoi(rDserver.arg(2).substring(0,1).c_str());
        remMinute = atoi(rDserver.arg(2).substring(2,3).c_str());
        GenE = atoi(rDserver.arg(3).c_str()) / 1000;
        GenP = atoi(rDserver.arg(4).c_str());
        UseE = atoi(rDserver.arg(5).c_str()) / 1000;
        UseP = atoi(rDserver.arg(6).c_str());
        NetP = GenP - UseP;    // Last Net Power
      }
  }
}
[...]
</code></pre>
]]></description><link>https://community.m5stack.com/post/1884</link><guid isPermaLink="true">https://community.m5stack.com/post/1884</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Sat, 03 Nov 2018 10:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Thu, 01 Nov 2018 19:03:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/457">@rop</a> Thank you, I'll try starting from that one, than. :)</p>
]]></description><link>https://community.m5stack.com/post/1876</link><guid isPermaLink="true">https://community.m5stack.com/post/1876</guid><dc:creator><![CDATA[CrazyHorse80]]></dc:creator><pubDate>Thu, 01 Nov 2018 19:03:11 GMT</pubDate></item><item><title><![CDATA[Reply to I need help with a webserver project... on Thu, 01 Nov 2018 18:49:27 GMT]]></title><description><![CDATA[<p dir="auto">How about starting from the example that is at File / Examples / WebServer / HelloServer (Where WebServer is under the "Examples for M5Stack(-Fire)" heading). That is pretty simple, and then work your way up from there?</p>
]]></description><link>https://community.m5stack.com/post/1875</link><guid isPermaLink="true">https://community.m5stack.com/post/1875</guid><dc:creator><![CDATA[Rop]]></dc:creator><pubDate>Thu, 01 Nov 2018 18:49:27 GMT</pubDate></item></channel></rss>