падение esp8266 при попытке генерации qrcode в html

rsalikhov
Offline
Зарегистрирован: 16.08.2022

Добрый день.

Библиотека #include "qrcode.h"

Часть генерации кода:

 

 
 
 
 
 
 
Ошибка в консоли:
 
12:13:09.565 -> AP IP address: 192.168.4.1
12:13:09.565 -> HTTP server started
12:13:09.610 -> A8:48:FA:FF:25:A3
12:13:09.610 -> LOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOW
12:13:33.583 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
12:13:33.629 -> 
12:13:33.629 -> Exception (3):
12:13:33.629 -> epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40240d31 depc=0x00000000
12:13:33.765 -> 
12:13:33.765 -> >>>stack>>>
12:13:33.765 -> 
12:13:33.765 -> ctx: cont
12:13:33.765 -> sp: 3ffffce0 end: 3fffffc0 offset: 0190
12:13:33.811 -> 3ffffe70:  3ffee6c4 00000000 3ffee6a0 000002e6  
12:13:33.858 -> 3ffffe80:  40240d31 3ffee7a0 3ffffecc 40206f93  
12:13:33.904 -> 3ffffe90:  40240d31 3ffee7a0 3ffffecc 40207601  
12:13:33.995 -> 3ffffea0:  00000000 69746365 00000000 3ffee978  
12:13:33.995 -> 3ffffeb0:  3fffdad0 00000001 3fff00c4 402037e0  
12:13:34.087 -> 3ffffec0:  3ffee6e8 3ffefd20 00000000 3fff07d4  
12:13:34.133 -> 3ffffed0:  000002ef 80000000 3ffee800 3ffee978  
12:13:34.179 -> 3ffffee0:  3fffdad0 3ffee6e8 3fff00c4 40209daa  
12:13:34.225 -> 3ffffef0:  00000000 00000000 00000000 401000e9  
12:13:34.272 -> 3fffff00:  00000000 00000000 3ffee6a0 40201bc9  
12:13:34.364 -> 3fffff10:  00000000 3ffee6e8 3ffee6a0 40203704  
12:13:34.364 -> 3fffff20:  00000000 00000000 00000000 69746365  
12:13:34.458 -> 3fffff30:  00000000 0011001f 401002bd 00000000  
12:13:34.503 -> 3fffff40:  0000656c 00000000 00000000 00000001  
12:13:34.548 -> 3fffff50:  00000000 00000000 3ffee6a0 3ffee978  
12:13:34.594 -> 3fffff60:  3fffdad0 3ffee6c4 3ffee6a0 40203b5a  
12:13:34.640 -> 3fffff70:  4020a6ec 00000000 00001388 4020565c  
12:13:34.686 -> 3fffff80:  00000000 00000000 3fff057c 00000000  
12:13:34.732 -> 3fffff90:  3fffdad0 00000000 3ffee800 40203c5c  
12:13:34.822 -> 3fffffa0:  3fffdad0 00000000 3ffee964 402080e4  
12:13:34.868 -> 3fffffb0:  feefeffe feefeffe 3ffe85e0 40100d05  
12:13:34.913 -> <<<stack<<<
12:13:34.913 -> 
12:13:34.913 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
 
Что делаю не так?
 
 
rsalikhov
Offline
Зарегистрирован: 16.08.2022

Падение происходит в момент отображения html страницы при подключении AP IP address: 192.168.4.1

rsalikhov
Offline
Зарегистрирован: 16.08.2022

точнее 

11:53:30.972 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
11:53:31.046 -> ⸮⸮<span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><br/><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><br/><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/>ApMode: Reading EEPROM AP MODE
11:53:56.046 -> Read address: 0
11:53:56.046 -> 1
11:53:56.835 -> AP IP address: 192.168.4.1
11:53:56.835 -> HTTP server started
11:53:56.835 -> A8:48:FA:FF:25:A3
11:53:56.882 -> LOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOW<span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><br/><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><br/><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><br/><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='black'></span><br/><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='black'></span><span class='white'></span><span class='white'></span><span class='black'></span><span class='white'></span><span class='black'></span><br/>ApMode: Reading EEPROM AP MODE
12:11:00.643 -> Read address: 0
12:11:00.643 -> 1
12:11:01.436 -> AP IP address: 192.168.4.1
12:11:01.436 -> HTTP server started
12:11:01.481 -> A8:48:FA:FF:25:A3
12:11:01.481 -> LOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOWLOW
12:11:44.460 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
12:11:44.505 -> 
12:11:44.505 -> Exception (3):
12:11:44.505 -> epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40241f39 depc=0x00000000
12:11:44.596 -> 
12:11:44.596 -> >>>stack>>>
12:11:44.596 -> 
12:11:44.596 -> ctx: cont
12:11:44.642 -> sp: 3ffffce0 end: 3fffffc0 offset: 0190
12:11:44.688 -> 3ffffe70:  3ffee954 00000000 3ffee930 000002e6  
12:11:44.735 -> 3ffffe80:  40241f39 3ffeea30 3ffffecc 402081a3  
12:11:44.781 -> 3ffffe90:  40241f39 3ffeea30 3ffffecc 40208811  
12:11:44.827 -> 3ffffea0:  00000000 69746365 00000000 3ffeec08  
12:11:44.873 -> 3ffffeb0:  3fffdad0 00000001 3fff6094 402049fc  
12:11:44.965 -> 3ffffec0:  3ffee978 3fff5f38 00000000 00000000  
12:11:44.965 -> 3ffffed0:  00000000 00000000 dd1de0af 3ffeec08  
12:11:45.057 -> 3ffffee0:  3fffdad0 3ffee978 3fff6094 4020afb6  
12:11:45.102 -> 3ffffef0:  00000000 00000000 00000000 401000e9  
12:11:45.149 -> 3fffff00:  00000000 00000000 3ffee930 40202df5  
12:11:45.195 -> 3fffff10:  00000000 3ffee978 3ffee930 40204920  
12:11:45.241 -> 3fffff20:  00000000 00000000 00000000 69746365  
12:11:45.334 -> 3fffff30:  00000000 0011001f 401002bd 00000000  
12:11:45.334 -> 3fffff40:  00025530 00000000 00000000 00000001  
12:11:45.425 -> 3fffff50:  00000000 00000000 3ffee930 3ffeec08  
12:11:45.470 -> 3fffff60:  3fffdad0 3ffee954 3ffee930 40204d76  
12:11:45.517 -> 3fffff70:  4020b8f8 00000000 00001388 40206870  
12:11:45.563 -> 3fffff80:  00000000 00000000 3fff5d94 00000000  
12:11:45.609 -> 3fffff90:  3fffdad0 00000000 3ffeea90 40204e78  
12:11:45.701 -> 3fffffa0:  3fffdad0 00000000 3ffeebf4 402092f4  
12:11:45.701 -> 3fffffb0:  feefeffe feefeffe 3ffe85e0 40100d05  
12:11:45.793 -> <<<stack<<<
12:11:45.793 -> 
12:11:45.793 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
ЕвгенийП
ЕвгенийП аватар
Offline
Зарегистрирован: 25.05.2015

1. https://arduino.ru/forum/obshchii/vstavka-programmnogo-koda-v-temukommentarii - это обязательно, если Ваша цель говорить по существу, а не брызгать слюной, что никто не помогает.

2. Код нужен полностью по огрызку никто Вам ничего разумного не скажет. Как можно короче, но полный код. У Вас тут даже нет описания переменных - о чём говорить можно?

rsalikhov
Offline
Зарегистрирован: 16.08.2022
#include <EEPROM.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include "qrcode.h"

#define EEPROM_SIZE 512

#ifndef APSSID
#define APSSID "WD"
#define APPSK  "12345678"
#endif

/* Set these to your desired credentials. */
const char *ssid = APSSID;
const char *password = APPSK;

String qrCodeHtml = "";
const char index_html_start[] PROGMEM = R"rawliteral(
<!DOCTYPE HTML><html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    html {
     font-family: Arial;
     display: inline-block;
     margin: 0px auto;
     text-align: center;
    }
    .white {
      height: 10px;
      width: 10px;
      display: inline-block;
    }
    .black {
      height: 20px;
      width: 10px;
      background: black;
      display: inline-block;
    }
  </style>
</head>
<body>
  <h2>Water device</h2>
  <form action="/action" method="POST">
  <p>
    Wifi SSID
  </p>
  <input type="text" name="ssid">
  <p>
   Wifi Password
  </p>
  <input type="password" name="password">
  <input type="submit" name="action" value="Save and restart">
  </form>
  <br/>
  <div>
  )rawliteral";

const char index_html_end[] PROGMEM = R"rawliteral(
</div>
</body>
</html>)rawliteral";

ESP8266WebServer server(80);

/* Just a little test message.  Go to http://192.168.4.1 in a web browser
   connected to this access point to see it.
*/
void handleRoot() {
  
  server.send(200, "text/html", index_html_start + qrCodeHtml + index_html_end );
}

void handleAction() {                       
  if( ! server.hasArg("ssid") || ! server.hasArg("password") 
      || server.arg("ssid") == NULL || server.arg("password") == NULL) { 
    server.send(400, "text/plain", "Enter SSID and Password");  
    return;
  }

  String ssid = server.arg("ssid");
  String password = server.arg("password");

  int address = 0;
  String ap_mode = "2";
  EEPROM.write(address, ap_mode[0]);
  Serial.println("writing ap_mode to eeprom:");
  Serial.println(ap_mode);
  Serial.print("Wrote address: ");
  Serial.println(address);
  
  // save ssid
  int charSSIDLength = 10;
  Serial.println("writing ssid to eeprom:");
  for (int i = 0; i < charSSIDLength; i++)
    {
      address = address + 1;
      EEPROM.write(address, ssid[i]);
      Serial.print("Wrote address: ");
      Serial.println(address);
      Serial.print("Wrote: ");
      Serial.println(ssid[i]);
    }
  
  // save password
  int charPasswordLength = 10;
  Serial.println("writing password to eeprom:");
  for (int j = 0; j < charPasswordLength; j++)
    {
      address = address + 1;
      EEPROM.write(address, password[j]);
      Serial.print("Wrote address: ");
      Serial.println(address);
      Serial.print("Wrote: ");
      Serial.println(password[j]);
    }

  EEPROM.commit();

  
  
  
  server.send(200, "text/html", "Rebooting...");
  ESP.restart();
}

void setup() {

  QRCode qrcode;

     uint8_t qrcodeData[qrcode_getBufferSize(3)];
     qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD");

     for (uint8_t y = 0; y < qrcode.size; y++) { 
        // Each horizontal module
        for (uint8_t x = 0; x < qrcode.size; x++) {
            qrCodeHtml += qrcode_getModule(&qrcode, x, y) ? "<span class='black'></span>": "<span class='white'></span>";
           // delay(100);
        }
        qrCodeHtml +="<br/>";
    }

  // put your setup code here, to run once:
  pinMode(13, INPUT);
  pinMode(LED_BUILTIN, OUTPUT); 
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  Serial.begin(9600);
  EEPROM.begin(EEPROM_SIZE);
  int address = 0;
  
  String ap_mode = "";
  Serial.print(qrCodeHtml);
  Serial.print("ApMode: ");
  Serial.println("Reading EEPROM AP MODE");
  Serial.print("Read address: ");
  Serial.println(0);
  ap_mode += char(EEPROM.read(0));
  Serial.println(ap_mode);
  
  if (ap_mode == "2") {
    Serial.print("SSID: ");
    Serial.println("Reading EEPROM ssid");
    String readed_sid="";
    for (int i = 0; i < 10; i++)
      {
          Serial.print("Read address: ");
        Serial.println(i+1);
        readed_sid += char(EEPROM.read(i + 1));
        Serial.print("Read: ");
        Serial.println(char(EEPROM.read(i + 1)));
        if(readed_sid[i]=='\0') break;
      }
    Serial.println(readed_sid.length());
    Serial.println(readed_sid);
  
    Serial.print("Password: ");
    Serial.println("Reading EEPROM password");
    String readed_password="";
    for (int j = 1; j < 10; j++)
      {
        Serial.print("Read address: ");
        Serial.println(j+10);
        readed_password += char(EEPROM.read(9 + j + 1));
        Serial.print("Read: ");
        Serial.println(char(EEPROM.read(9+ j + 1)));
        if(char(EEPROM.read(9+ j + 1))=='\0') break;
      }
    Serial.println(readed_password.length());
    Serial.println(readed_password);
  
    // 
      WiFi.mode(WIFI_STA);
      WiFi.begin(readed_sid, readed_password);
//WiFi.begin("RS", "12345678");
      int attempts = 0;
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        attempts++;
        Serial.print(".");
        Serial.print(WiFi.status());
        if (attempts > 20) {
          
            int address = 0;
            String ap_mode = "1";
            EEPROM.write(address, ap_mode[0]);
            Serial.println("writing ap_mode to eeprom:");
            Serial.println(ap_mode);
            Serial.print("Wrote address: ");
            Serial.println(address);
            EEPROM.commit();
            ESP.restart();
          }
      }
      Serial.println("");
      Serial.print("Connected! IP address: ");
      Serial.println(WiFi.localIP());
  
  } else {
    // cold start
    // init AP

    
    
      //WiFi.mode(WIFI_AP);

      WiFi.softAP(ssid, password);

      IPAddress myIP = WiFi.softAPIP();
      Serial.print("AP IP address: ");
      Serial.println(myIP);

            
    
      server.on("/", handleRoot);
      server.on("/action", HTTP_POST, handleAction);
      server.begin();
      Serial.println("HTTP server started");
  
  }

  //mac print
  Serial.println(WiFi.macAddress());
}

void loop() {
  // put your main code here, to run repeatedly:
  
  if (digitalRead(13) == HIGH) {
    digitalWrite(LED_BUILTIN, HIGH);
    Serial.write("HIGH");
  } else {
    digitalWrite(LED_BUILTIN, LOW);
    Serial.write("LOW");
  }
  server.handleClient();
  delay(1000);
}

Прошу прощения, я на старте изучения)

rkit
Offline
Зарегистрирован: 23.11.2016

У тебя память бесконечная, что ли, для такой "генерации"?

rsalikhov
Offline
Зарегистрирован: 16.08.2022

А как лучше сделать?

b707
Offline
Зарегистрирован: 26.05.2017

скорее всего валится по фрагментации/недостатку памяти.

Судя по всему автор кода генерит qrcode в виде сотен строчек типа

</span><span class='white'></span><span class='white'></span><span class='black'></span><span class='black'>

которые все потом тупо добавляются в одну несчастную переменную типа String

 

Это не Гайвер писал? за такое надо ойца отрывать

b707
Offline
Зарегистрирован: 26.05.2017

rsalikhov пишет:

А как лучше сделать?

например в виде картинки

rsalikhov
Offline
Зарегистрирован: 16.08.2022

Ну я на старте изучения))) про шарундулы согласен. Буду благодарен за живой пример как надо реализовать)

rsalikhov
Offline
Зарегистрирован: 16.08.2022

Идея была динамичные данные преобразовать в qr. Например серийный номер или MAC чипа. Не совсем понимаю как это превратить в картинку и после выдать в html

b707
Offline
Зарегистрирован: 26.05.2017

Вы прикидывали, какой длины получается вся строчка? Каков размер генерируемого Вами qrcode - Х х У ?

rsalikhov
Offline
Зарегистрирован: 16.08.2022

b707 пишет:

Вы прикидывали, какой длины получается вся строчка? Каков размер генерируемого Вами qrcode - Х х У ?

нет

b707
Offline
Зарегистрирован: 26.05.2017

ну что. отвечаю сам...

В вашем скетче создается Ку-Ар-код размером 29х29 квадратиков. Каждый квадратик у вас кодируется строчкой порядка 25-30 символов. Итого один Ку-Ар-код в ХТМЛ занимает порядка 25к, что многовато, с учетом того что на ЕСП8266 при запуске вебсервера остается дай бог 30к памяти

Это не считая того, как вы кромсаете память сотнями создаваемых и убиваемых экземпляров String

Для начала посмотрите функцию String.reserve, а если не поможет - избавляйтесь от String вовсе. Но даже этого может не хватить - тогда придется создавать Ку-Ар-код как точечный рисунок

sadman41
Offline
Зарегистрирован: 19.10.2016

Втупую - так.

 for (uint8_t x = 0; x < qrcode.size; x++) {
     // client - WiFi Client или как там его....
     client.print(qrcode_getModule(&qrcode, x, y) ? "<span class='black'></span>": "<span class='white'></span>");
     // delay(100);
 }

 

wdrakula
wdrakula аватар
Offline
Зарегистрирован: 15.03.2016

Какие в жёппу <спаны>??? Это ж картинка - ну вывести её как картинку. Поставить библиотеку готовую для графики ...или вообще скинуть прям бинарником этот массив на браузер и там нарисовать красивое кошерным ДжаваСкриптом.

Какому ушлёпку пришла в голову идея рисовать КуЭр код спанами?? Вместо КАЖДОЙ точки вотака ерня: <span class='black'></span> ???

rkit
Offline
Зарегистрирован: 23.11.2016

rsalikhov пишет:

А как лучше сделать?

Лучше генерировать qr на клиенте.

b707
Offline
Зарегистрирован: 26.05.2017

rkit пишет:

Лучше генерировать qr на клиенте.

а пересылать в каком виде?

rkit
Offline
Зарегистрирован: 23.11.2016

b707 пишет:

rkit пишет:

Лучше генерировать qr на клиенте.

а пересылать в каком виде?

qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD");

догадайся