pvvx
Активный участник сообщества
Ну он пока работает немного лучше NodeMCU, а вставлять новые фичи и особенно исправлять ошибки NodeMCU можно вечноПочитал вас и понял что проект еще не готов...
А так вполне интересно получается. Будем подождать.
Ну он пока работает немного лучше NodeMCU, а вставлять новые фичи и особенно исправлять ошибки NodeMCU можно вечноПочитал вас и понял что проект еще не готов...
А так вполне интересно получается. Будем подождать.
Какой смысл переводить Arduino RFID Library for MFRC522 на Lua, если есть Arduino IDE для ESP8266?Еще было бы интересно портировать MFRC522 библиотеку...
https://yadi.sk/d/Bmvxvkiqa8yGv типа этой
Делал на ней электронные замки всякие, карты метро читал и писал
Больше 41576 только 64000> =node.heap()
41576
Sending data to thingspeak.com
......reboot........
EspLua.ru 1.3.0 build 20150809 powered by Lua 5.1.4
Heap=25880
А что это за игра такая?
Привет Pvvx!А что это за игра такая?
> dofile("script6.lc")
> Temp:-0.0999.0999 C
Пока нет. Надо переделывать драйвера LUA<->TCP под новые версии SDK. Иначе то, что в NodeMCU с TCP всегда приводит к потере памяти и падениям...Знаю у них все плохо но,
просто перенести этот работающий проект с Nodemcu на Вашу прошивку не получается...
NodeMCU 0.9.6 build 20150704 powered by Lua 5.1.4
> dofile("script6.lua")
> Temp:-0.0999.0999 C
Sending data to thingspeak.com
25536
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
24056
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
23288
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
22832
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
21992
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
21384
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
20592
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
19952
Temp:-0.0999.0999 C
Sending data to thingspeak.com
17384
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
16776
Closing connection
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
17800
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
17208
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
16624
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
16040
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
15456
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
14872
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
13264
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
12680
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
12096
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
11488
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
10904
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
10120
Temp:-0.0999.0999 C
Sending data to thingspeak.com
8072
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
7448
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
6864
Closing connection
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
7912
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
7320
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
6712
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
6128
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
5544
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
4960
Closing connection
Temp:-0.0999.0999 C
Sending data to thingspeak.com
4376
PANIC: unprotected error in call to Lua API (not enough memory)
c_ЗПRSцвFjцвFjГvкЁ
NodeMCU 0.9.6 build 20150704 powered by Lua 5.1.4
>
lasttemp = 22
function getTemp()
lasttemp = lasttemp + 1
print("Temp: "..lasttemp.." C")
end
--- Send
function sendData()
getTemp()
-- conection to thingspeak.com
print("Sending new data to thingspeak.com")
print(node.heap())
conn=net.createConnection(net.TCP, 0)
conn:on("receive", function(conn, payload) print(payload) end)
-- conn:connect(80,'thingspeak.com')
conn:connect(80,'192.168.1.2')
conn:on("connection",function(conn) conn:send("GET /update?key=YOURKEY&field1="..lasttemp.." HTTP/1.1\r\n"
.."Host: api.thingspeak.com\r\n"
.."Accept: */*\r\n"
.."User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1)\r\n"
.."\r\n") end)
conn:on("sent",function(conn) print("Closing connection") conn:close() end)
conn:on("disconnection", function(conn) print("Got disconnection...") end)
end
-- send data every X ms to thing speak
while(1) do
tmr.delay(500000)
ip = wifi.sta.getip()
if ip=="0.0.0.0" or ip==nil then
print("No connect to AP...")
else
sendData()
end
end
EspLua.ru 1.3.0 build 20150809 powered by Lua 5.1.4
> dofile("script7.lua")
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
Temp: 23 C
Sending new data to thingspeak.com
35584
Closing connection
Got disconnection...
Temp: 24 C
Sending new data to thingspeak.com
34736
Closing connection
Got disconnection...
Temp: 25 C
Sending new data to thingspeak.com
34544
Closing connection
Got disconnection...
Temp: 26 C
Sending new data to thingspeak.com
34360
Closing connection
Got disconnection...
Temp: 27 C
Sending new data to thingspeak.com
34168
Closing connection
Got disconnection...
Temp: 28 C
Sending new data to thingspeak.com
33984
Closing connection
Got disconnection...
Temp: 29 C
Sending new data to thingspeak.com
33976
Closing connection
Got disconnection...
Temp: 30 C
Sending new data to thingspeak.com
33984
Closing connection
Got disconnection...
Temp: 31 C
Sending new data to thingspeak.com
33976
Closing connection
Got disconnection...
Temp: 32 C
Sending new data to thingspeak.com
33984
Closing connection
Got disconnection...
....
EspLua.ru 1.3.0 build 20150813 powered by Lua 5.1.4
> dofile("script7.lua")
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
No connect to AP...
Temp: 23 C
Sending new data to thingspeak.com
35512
Temp: 24 C
Sending new data to thingspeak.com
32888
Closing connection
Got disconnection...
Temp: 25 C
Sending new data to thingspeak.com
32384
Closing connection
Got disconnection...
Temp: 26 C
Sending new data to thingspeak.com
32152
Closing connection
Got disconnection...
Closing connection
Got disconnection...
Temp: 27 C
Sending new data to thingspeak.com
33664
Temp: 28 C
Sending new data to thingspeak.com
31752
Closing connection
Got disconnection...
Closing connection
Got disconnection...
Temp: 29 C
Sending new data to thingspeak.com
33696
..................
Temp: 101 C
Sending new data to thingspeak.com
33744
..................
Это кривые модули с найденной на помойке китацами flash и не поддерживают QIO.и не знаю почему, но новые модули не поддерживают только Ваш софт принципиально.
Посмотреть вложение 720Посмотреть вложение 723
Плата борда не причем на ней все старые модули работают проверил - изменения только в модуле NEW.
Да ничего не будет. Я просто прикалываюсь и всё сделано именно чтобы кто угодно взял, что найдет нужным, и исправил у себя.@pvvx, они будут требовать вашей экстрадиции?
Предложите им платить вам за следующие найденные баги, которые у них ещё обнаружатся))
print('Load WIFI_SWITCH');
out=4; --GPIO2 CH=4 dimmer
gpio.mode(out, gpio.OUTPUT);
gpio.write(out, gpio.LOW);
dofile("wifi.lua");
-- wifi init
cfg_wifi_ssid,cfg_wifi_key = "CCCP","wifi681818"
wifi.setmode(wifi.STATION)
wifi.sta.config(cfg_wifi_ssid,cfg_wifi_key)
wifi.sta.autoconnect(1)
-- tmr connect establish
tmr_count = 0
tmr.alarm(0, 1000, 1, function()
if(wifi.sta.getip() == nil)then
-- wifi connect try
print("Conn to AP (ssid="..cfg_wifi_ssid.."/key="..cfg_wifi_key..") try:"..tmr_count)
tmr_count = tmr_count+1
if(tmr_count > 60)then
-- set ESP to alarm wifi AP mode
wifi.sta.disconnect();
wifi.setmode(wifi.SOFTAP)
--wifi.setmode(wifi.STATIONAP)
wifi.ap.config({ssid="ERROR",pwd="147852369"})
-- print wifi status
print("WiFi AP (ssid=ERROR/key=147852369)")
print('IP:',wifi.ap.getip())
print('Mode=AP')
print('MAC:',wifi.ap.getmac())
tmr.stop(0)
end
else
--print wifi status
print('IP: ',wifi.sta.getip())
print('Mode=Client')
print('MAC:',wifi.sta.getmac())
dofile("switch.lua")
tmr.stop(0)
end
end)
swState='off'
print('start http serv')
srv=net.createServer(net.TCP, 30)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload)
print(node.heap())
if string.find(payload,"?mode=on") then
swState='on'
gpio.write(out, gpio.HIGH);
conn:send('HTTP/1.1 200 OK\r\n\r\n')
conn:send('on')
elseif string.find(payload,"?mode=off") then
swState='off'
gpio.write(out, gpio.LOW);
conn:send('HTTP/1.1 200 OK\r\n\r\n')
conn:send('off')
elseif string.find(payload,"state") then
conn:send('HTTP/1.1 200 OK\n\n')
conn:send(swState)
else
conn:send('HTTP/1.1 200 OK\r\n\r\n')
conn:send('//error//')
end
end)
conn:on("sent",function(conn)
conn:close()
end)
end)
Да, код net Server и методы работы с ним из NodeMCU с ним ещё не изменены на правильные. Причина в том, что основной подход там вообще не верен, а если делать по другому, то совместимости не будет.Решил попробовать прошить EspLua... та же проблема.
Причем, как я заметил, когда esp8266 зависает, вся сеть wifi рухнет...
В вашем модуле может быть flash без QIO режима, только DIO (обычно это платы с модулями от NodeMCU). Т.е. Lua будет работать ещё в два раза медленнее и на такие модули старая прошивка не была рассчитана.2pvvx
Дважды загрузил прошивку EspLua.ru 1.3.0.20150809 на ESP12 (flash 1 MB).
Постоянно моргает синий светодиод и в консоли сыпятся ошибки "Fatal exception (28):"
Это проблемы прошивки или железа? Спасибо
Прошить что туда с включенной опцией QIO или считать ID flash и попробовать по ней определить тип и чья flash. Самое простое открыть модуль и посмотреть разводку и маркировку Flash.можно ли как-то программно проверить, поддерживает ли модуль QIO режим?