Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Chris Dalby
@moose4621

In addition, I have two versions of Python installed.

chris@chris-Inspiron-5593:~$ python -V
Python 2.7.18
chris@chris-Inspiron-5593:~$ python3 -V
Python 3.8.10

Apparently it is most unwise to uninstall the distro's default Python 2.7.x.

d-a-v
@d-a-v:matrix.org
[m]
This issue is coming from esptool. You can get your sketch's binary file (from /tmp/arduino_build_nnnn) and try to flash it with esptool:
esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --trace write_flash 0x0 sketch.bin
Chris Dalby
@moose4621
Thanks for the suggestion @d-a-v:matrix.org .
Unfortunately
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
Seems esptool or Python is the issue.
Earle F. Philhower, III
@earlephilhower:matrix.org
[m]
Check your kernel version. There was a regression in a late model Linux kernel in a USB-to-serial driver that made it incompatible with the way ESPtool uses it.
Fixed in linux mainline, no idea if it's fixed in Ubuntu kernels yet
Chris Dalby
@moose4621
@earlephilhower:matrix.org Well spotted. I will check that out. Sounds like my problem.
Chris Dalby
@moose4621
@earlephilhower:matrix.org That helped a lot. Thank you. Seems 5.4.0-89 and 5.4.0-88 are both affected. The only other kernel I have loaded is 5.3.0-050300-generic which cured the fault.
So deciding if I go further an load other kernels looking for the point of failure or just sit on 5.3.0 and wait for an update.
Chris Dalby
@moose4621
5.15.0-051500-generic kernel now installed. All good except....
I cannot see the OTA ports in the ide now.
Jeroen88
@Jeroen88
@earlephilhower:matrix.org I have ported the BearSSL library to the ESP32 and I am currently working on a generic Client that takes another Client as parameter in it's constructor and adds TLS to it. probeMaxFragmentLength() is already working, dynamically creating the IO buffers, as is setting certificates as TAs. Also I think I can get setInsecure() and fingerprints going. However, allowSelfSignedCerts() will be difficult. But what is the real reason for this method? It is almost the same as setInsecure() apart from checking a self signed cert. But if someone wants to spoof the server, adding a self signed cert is very easy. What is the added value of checking self signed certificates?
Earle F. Philhower, III
@earlephilhower:matrix.org
[m]
@Jeroen88: That's a good question. This method was added to support axTLS backwards compatibility. I would not add it to a new port. There really is no added security with it.
Jeroen88
@Jeroen88
Thnx @earlephilhower:matrix.org !
Clemens Kirchgatterer
@everslick
bearssl on esp32 sounds very cool! I'm looking forward giving it a try.
Shelby Merrick
@forkineye
@d-a-v:matrix.org I noticed LWIP 2.1.3 was released recently - https://lists.nongnu.org/archive/html/lwip-users/2021-11/msg00001.html. Are you all planning to pull it into the core?
d-a-v
@d-a-v:matrix.org
[m]
Yes
Paulo Cabral Sanz
@paulocsanz
Hi, I'm on master and am getting a Software WDT Reset on this line https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L626, would there be anything on my side that could cause this? or it's probably a bug?
0x4021f788 in __esp_delay at /home/no/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/core_esp8266_main.cpp:152
0x4021f7e1 in esp_try_delay(unsigned int, unsigned int, unsigned int) at /home/no/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/core_esp8266_main.cpp:171
0x40214cac in esp_delay<ESP8266WiFiGenericClass::hostByName(char const*, IPAddress&, uint32_t)::<lambda()> > at /home/no/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/coredecls.h:66
 (inlined by) ESP8266WiFiGenericClass::hostByName(char const*, IPAddress&, unsigned int) at /home/no/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp:628
1 reply
Hasenradball
@hasenradball
Hi together,
Is it necessary on the ESP8266 to set the pinMode(A0, INPUT), when using the analogRead(A0) function?
2 replies
Hasenradball
@hasenradball
Does anybody know if I can also use Google test in PIO with the ESP8266 core, or doe i have to use the Unit test with ist provieded by PIO?
1 reply
Hasenradball
@hasenradball
Hi guys, is there an wax to query the actual rf_mode?
WAKE_RF_DEFAULT, WAKE_RFCAL, WAKE_NO_RFCAL, WAKE_RF_DISABLED. (GPIO16 needs to be tied to RST to wake from deepSleep.) 
The chip can sleep for at most ESP.deepSleepMax() microseconds.
If you implement deep sleep with WAKE_RF_DISABLED and require WiFi functionality on wake up, 
you will need to implement an additional WAKE_RF_DEFAULT before WiFi functionality is available.
Hasenradball
@hasenradball
My question corresponds to this in the documentation:
grafik.png
If I can set the RF_MODE is there a possibility to check it after boot?
Jonathan Dumaresq
@dumarjo
anyone here know if a esp8266 can connect to a wpa3 router ? I know that the wpa3 is not supported in the current arduino core, but I wonder if it should connect in wpa2 as a drawback ?
the only router wpa3 that I have don't seem to work like this.
Hasenradball
@hasenradball
Hello Can anyone give me an small hint howTo:
  • include the src files of MariaDB c connector into my PIO ESP8266 Prj?
    I think mariaDB is compiled with cmake is this a problem?
Miguel Nogueira
@MiguelNog91_twitter
hello to all a little question I can not upload on the ESP 8266 card its given that, serial.serialutil.SerialException: could not open port 'COM4': FileNotFoundError(2, 'Le fichier sp�cifi� est introuvable.', None, 2) following a search on the internet that is good for the 'COM4 port that is not installed but I do not know how to do the installation of the install you can help me thank you.
Paulo Cabral Sanz
@paulocsanz

Hi, could someone help me understand this crash please?

Exception (29):
epc1=0x402117af epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000010 depc=0x00000000

StoreProhibited: A store referenced a page mapped with an attribute that does not permit stores
  epc1=0x402117af in Stream::sendGeneric(Print*, int, int, unsigned int) at ??:?

We log memory usage immediately before:
[TRACE] TRACER: Free Stack 2372, Free DRAM 31368, Biggest DRAM Block 27632, Free IRAM 20328, Connection 1

It happens when I call HttpClient::getString()

Paulo Cabral Sanz
@paulocsanz
I'm on the latest master commit because 3.2.0 doesn't compile (ceill is defined twice)
[HTTP-Client][begin] host: iop-monitor-server.tk port: 4001 url: /v1/user/login
[HTTP-Client][end] tcp is closed
[String] Reallocating large String(143 -> 155 bytes) 'Content-Ty ... K: '
[String] Reallocating large String(155 -> 175 bytes) 'Content-Ty ... C: '
[String] Reallocating large String(175 -> 219 bytes) 'Content-Ty ... NG: '
[String] Reallocating large String(219 -> 236 bytes) 'Content-Ty ... .tk:4001'
[HTTP-Client][sendRequest] type: 'POST' redirCount: 0
[HTTP-Client] connect: HTTPClient::begin was not called or returned error
[HTTP-Client][returnError] error(-1): connection failed
[DEBUG] _client.get() is nullptr
Fatal exception 29(StoreProhibitedCause):
epc1=0x4021bcb2, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000010, depc=0x00000000
It seems HttpClient::begin returns true, right after the TCP connection is closed, and then getString crashes, is there a way to catch the problem that I'm missing, or is it a bug?
Paulo Cabral Sanz
@paulocsanz
Ok it seems I can detect if connection failed, nevermind. But it still is a weird crash. Would a PR to detect that and avoid the crash be something of interest?
3 replies
Paulo Cabral Sanz
@paulocsanz
Whenever I'm using -O0 I'm consistently getting a WDT reset inside ESP8266WiFiGenericClass::hostByName from WiFiClientSecureCtx::connect("iop-monitor-server.tk", 4001)
[INFO] NETWORK: Free Stack 724, Free DRAM 36672, Biggest DRAM Block 35784, Free IRAM 36672, Connection 1
[hostByName] request IP for: iop-monitor-server.tk

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Soft WDT reset

>>>stack>>>

ctx: sys
sp: 3ffff0d0 end: 3fffffb0 offset: 01a0
...

0x4022126c in __esp_delay at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/core_esp8266_main.cpp:152
0x402212c5 in esp_try_delay(unsigned int, unsigned int, unsigned int) at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/core_esp8266_main.cpp:171
0x40214288 in esp_delay<ESP8266WiFiGenericClass::hostByName(char const*, IPAddress&, uint32_t)::<lambda()> > at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/coredecls.h:66
 (inlined by) ESP8266WiFiGenericClass::hostByName(char const*, IPAddress&, unsigned int) at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp:626
0x40204f76 in iop::logMemory(iop::Log const&) at src/core/log.cpp:253
0x40101354 in check_poison_block at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/umm_malloc/umm_poison.c:96
0x40214308 in ESP8266WiFiGenericClass::hostByName(char const*, IPAddress&) at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp:598
0x40217df0 in BearSSL::WiFiClientSecureCtx::connect(char const*, unsigned short) at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp:222
0x401010d0 in put_poison at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/umm_malloc/umm_poison.c:37
0x40224ff8 in std::_Function_base::~_Function_base() at ??:?
0x4029a130 in system_get_sdk_version at ??:?
0x402095ed in driver::HTTPClient::begin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at src/driver/client.cpp:161
0x40100b30 in heap_pvPortMalloc at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/heap.cpp:278
0x40220034 in String::init() at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/WString.h:283
 (inlined by) String::String() at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/WString.h:55
 (inlined by) operator+(String&&, String&&) at /home/no/.platformio/packages/framework-arduinoespressif8266@src-9e6d7244c46d325024685829a1341b58/cores/esp8266/WString.cpp:453
0x4022dfbf in std::__cxx11::basic_string<char, std::char_traits<char>
Does that make any sense?
Max Prokhorov
@mcspr:matrix.org
[m]
have you traced esp_delay args? does hostByName lock (see static var it uses for callback) never gets reset, somehow?
Paulo Cabral Sanz
@paulocsanz

Hi Max Prokhorov, you mean something like this?

template <typename T>
inline void esp_delay(const uint32_t timeout_ms, T&& blocked, const uint32_t intvl_ms) {
    const auto start_ms = millis();
    while (!esp_try_delay(start_ms, timeout_ms, intvl_ms) && blocked()) {
        std::cout << timeout_ms << " " << start_ms << " " << intvl_ms << " " << blocked() << "\n";
    }
}

bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
    uint32_t expired = millis() - start_ms;
    std::cout << expired << std::endl;
    if (expired >= timeout_ms) {
        return true;
    }
    esp_delay(std::min((timeout_ms - expired), intvl_ms));
    return false;
}

Logs:


10000 5330 1 1
2729
... // Dozens more that are very similar
10000 5330 1 1
2731
10000 5330 1 1
2733
10000 5330 1 1
2735
10000 5330 1 1
2736
10000 5330 1 1
2738
10000 5330 1 1
27
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Soft WDT reset
It doesn't seem to explain much tho, it seems to always call esp_delay, which should yield, right?
Paulo Cabral Sanz
@paulocsanz
Isn't reset cause 2 a fatal exception? Is the decoder confused and it's not about the WDT?
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v000dd7e0
~ld
Max Prokhorov
@mcspr:matrix.org
[m]
could also be something unrelated corrupting memory so there is swdt? hostByName works-for-me at least standalone, esp_delay callback returning true as well
Paulo Cabral Sanz
@paulocsanz
It's certainly possible, albeit wouldn't it be harder in -O0 than in -O2? I will investigate this possibility tho
Max Prokhorov
@mcspr:matrix.org
[m]
not necessarily, but might be an easier answer. corrupting something, forgeting to initialize stuff... also notice esp8266/Arduino#8393 update that fixes compiler bug with -Os
Max Prokhorov
@mcspr:matrix.org
[m]
having noticed some c-specific flags in platform.txt and lwip builds... why is .c set to have -fno-inline-functions?
d-a-v
@d-a-v:matrix.org
[m]

why is .c set to have -fno-inline-functions?

I think it is historical and probably meant to save space back then.

We could remove it but the effect will be little since all .c files were converted to .cpp files quite a time ago.
Max Prokhorov
@mcspr:matrix.org
[m]
true. I though that might do something when including local llhttp's .c files for parsing. zero difference between this option on or off
lwip & bearssl might need testing though
Earle F. Philhower, III
@earlephilhower:matrix.org
[m]
LWIP and BearSSL are built outside of the Arduino platform.txt so don't have this flag set anyway.
d-a-v
@d-a-v:matrix.org
[m]
gcc options for lwIP are legacy from lwip1.4 and this option is still there
Earle F. Philhower, III
@earlephilhower:matrix.org
[m]
D'oh! Well, not in BearSSL. In any case, changes to platform.txt will not affect them.