arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.03k stars 4.78k forks source link

Guru Mediation on using ufsserve inside autoexe.be #21465

Closed btsimonh closed 4 months ago

btsimonh commented 4 months ago

PROBLEM DESCRIPTION

Guru Mediation Error

This occurs repeatably under these circumstances:

build with

define UFILESYS_STATIC_SERVING

(my user_config_override.h contains:

#define USE_WEBCAM_V2
#define USE_WEBCAM_MOTION
#define UFILESYS_STATIC_SERVING
#define ENABLE_RTSPSERVER
#define USE_SPI
#define USE_SDCARD

)

in autoexec.be:

tasmota.cmd('ufsserve /sd/timelapse,/timelapse')

or

def startServing()
  tasmota.cmd('ufsserve /sd/timeline,/timeline')
end
tasmota.set_timer(2000, startServing)

But, it does not occur if:

The command ufsserve /sd/timelapse,/timelapse in the normal console.

The command tasmota.cmd('ufsserve /sd/timeline,/timeline') is issued in the berry console by hand.

Backtrace: 0x400f1430:0x3ffb1bb0 0x400d6214:0x3ffb1bd0 0x400f6534:0x3ffb1c00 0x400fe637:0x3ffb1e60 0x400da114:0x3ffb1e80

map:

                0x00000000400f1164                Xdrv38(unsigned long)
                0x00000000400f158c 
(what does ping have to do with it?)
                0x00000000400d6188                DecodeCommand(char const*, void (* const*)(), unsigned char const*)
                0x00000000400d6248                ResponseCmndAll(unsigned long, unsigned long)
                0x00000000400f64f8                Xdrv50(unsigned long)
                0x00000000400f680c                gp_digital_write
                0x00000000400fe628                XdrvCall(unsigned long)
                0x00000000400fe6b8                XlgtCall(unsigned long)

So maybe something odd in DecodeCommand under certain circumstances?

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:
00:00:01.928 BRY: Successfully loaded 'autoexec.be'
00:00:02.192 WIF: Checking connection...
00:00:02.192 WIF: Attempting connection...
00:00:02.437 WIF: Connecting to AP1 MYSSID Channel 6 BSSId AC:B6:87:C7:0E:B8 in mode HT20 as tasmota-37F4C4-5316...
00:00:03.465 WIF: IPv4 192.168.1.191, mask 255.255.255.0, gateway 192.168.1.254
00:00:04.067 SRC: Berry
00:00:04.068 CMD: Grp 0, Cmd 'UFSSERVE', Idx 1, Len 22, Pld -99, Data '/sd/timeline,/timeline'
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400f1433  PS      : 0x00060930  A0      : 0x800d6217  A1      : 0x3ffb1ba0  
A2      : 0x3ffdfaf8  A3      : 0x3ffc666c  A4      : 0x3ffb1f6e  A5      : 0x3ffc41d0  
A6      : 0x3ffb1f1b  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x3ffb1b60  
A10     : 0x3ffdfaf8  A11     : 0x3ffc3cec  A12     : 0x3ffb1f61  A13     : 0x3ffb1f6e  
A14     : 0x00000000  A15     : 0x3ffdfb14  SAR     : 0x00000019  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x000000c8  LBEG    : 0x400851d1  LEND    : 0x400851d9  LCOUNT  : 0x00000026  

Backtrace: 0x400f1430:0x3ffb1ba0 0x400d6214:0x3ffb1bc0 0x400f6534:0x3ffb1bf0 0x400fe637:0x3ffb1e50 0x400da114:0x3ffb1e70 0x400da200:0x3ffb1f60 0x400f79ec:0x3ffb1fc0 0x4010f96e:0x3ffb1fe0 0x4010d8b7:0x3ffb2090 0x40103410:0x3ffb20b0 0x40104d27:0x3ffb20d0 0x40104dfa:0x3ffb2150 0x400fa6e6:0x3ffb2190 0x400fc694:0x3ffb21c0 0x400fe637:0x3ffb21e0 0x400de004:0x3ffb2200 0x400da4e6:0x3ffb2220 0x4012a7ea:0x3ffb2290

ELF file SHA256: a45166e59e7ea0bb

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee

TO REPRODUCE

Steps to reproduce the behavior:

use tasmota.cmd('ufsserve /sd/timelapse,/timelapse') from within autoexec.be

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

it should not crash.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

btsimonh commented 4 months ago

ok, so Webserver is null... it seems to be created only when wifi comes up. I will make a simple PR to fail the command if the server is not there, and modify my use to be triggered by wifi coming up.