Connection lost after wifi access point reboot

I tried one by one but not solved. and a question: Can I add timer.setInterval to another void expect void setup ?

tried but nothing !

1 Like

yes you can

1 Like

As Alexis saidā€¦ try first with only the sendUptime interval, if it works, try to comment out that and uncomment the PIRval, etcā€¦ maybe there is something that stops the exec of the program. As my last link I posted should work with your script. You only need to set the interval for the first function, all the other should be called with setTimeoutā€¦
Did you measure the execution time of your sendUptime?

he said that donā€™t work anymore
so I donā€™t understand

I checked the datasheet for the BMP180 and it takes 8 ~ 176ms to return the measurement, depending on accuracyā€¦

can you write an example for me ? thanks

what happened if you delete all timers ?
if it works
try only first timer with 10000L
you donā€™t need to get value every seconds
10 seconds is good enough

1 Like

When I delete all timers expect sendUptime there is no problem and connection restored after rebooting wifi router. But when I add function to sendUptime void or adding any timer the connection to server lost after rebooting wifi router

I donā€™t understand
But when I add function to sendUptime void
this function works or not?

1 Like

Try this:
-comment out all timers except sendUptime in setup. Than modify that function to include sthe setTimeout:
void sendUptime() { float temperature = sensor.getCelsiusHundredths(); Blynk.virtualWrite(5, (float)temperature/100); float humidity = sensor.getHumidityPercent(); Blynk.virtualWrite(6, humidity); // virtual pin uint16_t lux = lightMeter.readLightLevel(); Blynk.virtualWrite(4, lux); float bp = bmp.readPressure(); Blynk.virtualWrite(9,(float)bp/100); int callFunction2 = timer.setTimeout(1000, PIRval);//TWO not ONE }

2 Likes

Not worked.

Thanks. I will test tomorrow and tell the result

so you have a problem with that sensor

1 Like

Canā€™t be helped.

BMP180 sensor ?

OK the problem solved by setting the sendUptime timer to 3000L ! but which sensor need 3000ms to measuring the data ? :thinking:

we were right!
3 seconds is very high.
anyway, that works.

2 Likes

yeah thanks. now working on 2000L without any problem.

anyway, you donā€™t need to check so many times
Donā€™t you?
I check my sensors 2 times hour.

2 Likes