I have just started with Shelly with a Shelly Plus i4DC. I am calling web-hooks from Shelly script because I want to have toggle-on/toggle-off on single clicks with buttons. Doing that, I realized that depending on whether using SSL and certificate verification, web-hook calling via HTTP.GET is quite slow. And the delay happens in the SSL hand-shake which is why the actions triggered by the web-hook get delayed by seconds. This is not cool when the buttons are supposed to turn on lights (as quickly as possible in order not to make users in a public space believe, the button/light is broken).
I am observing for SSL with certificate validation 3.8 seconds, for SSL without certificate validation 1.6 seconds and without SSL 0.4 seconds (which would be good enough but I don't want to give up on SSL yet).
Those calls, done from my Linux machine with curl take 0.5 seconds with SSL and 0.3 seconds without SSL.
Is this known? Can I do something about it? Can it be improved in the firmware?
This is my Shelly script to test the delays:
function ping_ssl_ca() {
print('SSL with CA check');
time0 = Date.now()
Shelly.call('HTTP.GET', {
url: 'https://echo.free.beeceptor.com/'
},
function(result) {
print('Result received at', Date.now()-time0, 'ms');
ping_ssl_noca();
});
print('Call done at', Date.now()-time0, 'ms');
}
function ping_ssl_noca() {
print();
print('SSL without CA check');
time0 = Date.now()
Shelly.call('HTTP.GET', {
url: 'https://echo.free.beeceptor.com/',
ssl_ca: '*'
},
function(result) {
print('Result received at', Date.now()-time0, 'ms');
ping_nossl();
});
print('Call done at', Date.now()-time0, 'ms');
}
function ping_nossl() {
print();
print('No SSL');
time0 = Date.now()
Shelly.call('HTTP.GET', {
url: 'http://echo.free.beeceptor.com/'
},
function(result) {
print('Result received at', Date.now()-time0, 'ms');
});
print('Call done at', Date.now()-time0, 'ms');
}
ping_ssl_ca();
Alles anzeigen
PS. I had submitted this post already yesterday - today the post and my account were gone. The forum was also offline this morning. Was there an outage and my sign-up and post were lost?