martin-ger / esp_mqtt

MQTT Broker/Bridge on the ESP8266
MIT License
293 stars 68 forks source link

2 new problems #58

Open msillano opened 4 years ago

msillano commented 4 years ago

Hi Martin

a) Working a new timer project I had a problem: after a change (I don't know which one :( ) all the timers and interrupts, which previously worked perfectly, all stopped working at the same time. My code is very long (3950) and I make strong efforts to keep it in the required size. But the problem is not the total size. (I can send you the full code not working if that can help).

b) So I start to make some tests: maybe the cause is the size of code after "on timer.."? Cutting it looks working (not sure). Making tests to cut it, I fond a second problem, easily replicable, see the next code (the idea is to use "publish local .." as a function call)

on init
do
subscribe local /#
settimer 2 3000

on topic local /tb
do
%next line as no effect
println "in local timer 2"
%This line works, timer 2 restarts
settimer 2 3000

on timer 2
do
println "on timer 2 "
publish local /tb b

The message "in local timer 2" do not appear on the terminal (Putty, telnet) but the next line works, because the timer restarts: "on timer 2 " appears every 3 seconds.

Tested using:

Any idea? Best regards m.s. p.s. ADDED Using serial debug I get (correct):

local timer 2
on timer 2
local timer 2

Using telnet debug I get (bad)

on timer 2
on timer 2
on timer 2

best regards

p.p.s. about (a) problem: After many tests days, I found that the following line creates problems at runtime:

publish local $cmd on
% must be replaced with
publish local $cmd go
publish local $cmd "on"

best rergards m.s.