Hi,
When I run the HelloServer or the AdvancedWebServer examples the wio terminal just stops executing after 1 - 3 minutes. I can still ping the ip address given to the device but the webserver stops responding and any code I put in loop does not execute.
Enabling debug in rpc_unified_log.h the stall/crash always ends on this log output:
I’m running Arduino ide V1.8.13
The Seeed Arduino WiFi library is version 1.0.2
I updated the RTL8720 to firmware version v2.1.0
…BTW I tried V2.0.4 but that didn’t work at all for me, but I didn’t spend much time looking into that.
Is this just the current state of the library and firmware?
Am I alone in this observation?
Any advice would be great - I’d really like to get the webserver functionality working reliably.
The issue seems to be the delay inside the serial port transmission section of the code. I have increased the delay and updated the Seeed_Arduino_rpcUnified library. You can check the commit below.
I have also tested with the AdvancedWebServer example and it seems to be stable for over an hour.
Awesome Lakshantha! After updating rpcUnified I’ve been running for over an hour too.
I’ll leave it running longer but it looks resolved to me.
Many thanks,
Steve
Hi @lakshan,
I’ve run a few extended tests on this and observe it still fails after 3 to 10 hours.
The last few lines of lwip logging produces this output; note the strange gap in timestamps like it stopped and recovered. I guess there is some underlying stability issue here.
Hi @stevedb,
Could you try changing the delay value here Seeed_Arduino_rpcUnified > src > erpc > erpc_arduino_uart_transport.cpp (line 299) on your end and test it? The delay seems to be the issue. When the delay is too high, it seems to be slow, and when the delay is too low, it seems to be unstable.
Hi @lakshan,
I haven’t managed to look into this in detail but thought I would offer a brief update.
I thought I would try and insert a delay for every transmit that hit the uart tx buffer when it was not empty rather than in the underlysingsend function that transmits in bulk.
I’ve has some success with a 100us delay as per below; this change is in addition to removing all delays in underlyingsend.
I’ve only run it for about 48 hours but I have seen no crashes with this change yet.
size_t EUart::write(const uint8_t data)
{
if (sercom->isDataRegisterEmptyUART() && txBuffer.available() == 0)
{
sercom->writeDataUART(data);
}
else
{
delayMicroseconds(100); // slow things down if the buffer is not available
// spin lock until a spot opens up in the buffer
while (txBuffer.isFull()) ...
Hi @RoSchmi,
I only recently moved my wio terminal from the usb of my laptop to a plugged in power source. It was failing on opening or closing my laptop lid which was messing with my observations - another thing to investigate!
In short I ran it for about 10 days without issue. I don’t have a client connected to it all the time, but I don’t think that made a difference to the mode of failure.
I moved the delay to the first line of EUart::write by the way.
Interestingly after those 10 days my wio terminal seems to not work at all! The screen is blank even after a reset (I had some debug printed on there) and it doesn’t connect to the wifi anymore - I haven’t looked into this yet.
Steve
I have a similar problem on my Wio Terminal. Tried a couple of very different programs and both stall after a few minutes. Looking at this thread I have checked all the versions of libraries and they are all the latest (Seeed_Arduino_rpcUnified, seeed-ambd-firmware is 2.1.3).
I have a simple program to list all the Wifi signals in range which just loops around every 5 seconds and lists them. After a minute or two it stops responding.