-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blynk support #1230
base: dev
Are you sure you want to change the base?
blynk support #1230
Conversation
…ver, configuration thriugh gui and receiving writes from blynk server
Couple of notes:
|
BlynkStream.h is part of the Blynk client library. Blynk client library can be downloaded by pio, current version is 0.5.4 I didn't add any files except blynk.ino so far I know. Should I remove all the gz files, package-lock.json ? But I changed platformio.ini because of the new device ....so that can be built with pio. Will reset defaults. In the loop will be tried to connect to blynk server with a timeout of 3 seconds. On timeout the connect function returns to loop. This means every unsuccessful try will block loop for 3 seconds, I tried this and it didn't block the device in a bad way. |
I checked the original repository, all gz and lock and so on are already included . |
Yes, they are included, but as you can see — merging is not possible :) They will be generated anyways, no need to add them here. Also, would it make sense to recommend disabling mqtt / http-api / webui html when on blynk? It pretty much replaces all of them, besides actual configuration. |
ok, what exactly do you want that I do ? Should I go back with all gz files and leave the other ones ? Why are html and platformio.ini not mergable ? regarding disabling mqtt/http-api/webui, I can't decide, maybe there are people using techniques in parallel. Also, mybe I'am wrong, but is it possible to use espurna without webui ? |
…alues can be smaller than 0
It's not that I want it, it is what git wants. Basically, the text patch cannot apply. It uses nearby lines and since they are not exact match between branches - it bails out and requires manual edit. Either here on github or using some local git tool - try to rebase on current 'dev'. It'll show what files are affected and format difference inline, like this (index.html):
Fortunately, required changes are clear enough: remove git markers, keep Same with ini file. And as you can imagine, comparing binary files line-by-line is problematic. Thus it is better to keep them outside of prs |
Also, see: https://travis-ci.org/xoseperez/espurna/jobs/436669250#L534 I did try this out and it got some problems:
Capturing used protocol and doing some searching on how it is implemented, maybe port to AsyncTCP like thingspeak/influx support should be done instead? |
Hello Max,
I will answer between lines:
Am Di., 9. Okt. 2018 um 15:23 Uhr schrieb Max Prokhorov <
[email protected]>:
Also, see: https://travis-ci.org/xoseperez/espurna/jobs/436669250#L534
It does not show up in github checks panel here for some reason.
Sorry for that. I corrected all misformatted lines now.
I did try this out and it got some problems:
- if blynk server is unavailable / key is invalid / server does not
respond with what client expects - serial loop is locked up periodically.
And it does not seem the timeout blynk-client uses is increasing, so it is
happening every 3 sec (via Blynk.connect(3000))
I think this is not a problem because IF someone enables Blynk then he
want that it works, and will recognize hopefully soon that there is
something wrong with the credentials, there will be also a hint in debug
messages as long Blynk is enabled and connection can not be established. If
Blynk is not enabled loop just returns. I tested behaviour by setting wrong
connection settings, and it didn't influence my device in a bad way.
Maybe the timeout should be configurable or should there be a timeout for
trying to connect ?
- setting vpin to 0 and configuring button on the dashboard for it
throws exception 28 when longpressing.
I don't kow what you mean with Dashboard ...do you mean the Blynk App ? I
tested using button as "push" button and it worked as expected, also with
long pressing, no exception neither on espurna nor in Blynk app
- how exactly relay value is shown? debug output mentioned configuring
relay but i cannot find relevant element in the dashboard
Sorry, maybe I'am stupid again, but once more I have to ask what do you
mean with dashboard ? The Blynk-App-GUI or status page in WebUI of espurna
? I mean the relay value is shown if you use a button in Blynk app, the
color and the lable changes if value of relay changes ...
Capturing used protocol and doing some searching on how it is implemented,
maybe port to AsyncTCP like thingspeak/influx support should be done
instead?
https://github.com/blynkkk/blynkkk.github.io/blob/master/BlynkProtocol.md
https://github.com/blynkkk/blynk-library/blob/master/tests/pseudo-library.py
influx does not seem to use Async, it includes ESPAsync but do not use it.
Thinkspeak could be configured to use it, but default is sync. But I think
you're right there is a potential blocking character in the protocol and I
will try to implement AsyncTCP and make it configurable like it is in
Thinkspeak.
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1230 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARFCEPbWYj86BzvC3lDOXFdfhTKwTQhCks5ujKNpgaJpZM4W6RD8>
.
--
********************************************
*voip-guru.de <http://voip-guru.de>*
Thomas Häger
Wiesbadener Str. 4
12161 Berlin
Tel.: +49 30 55570656
Mobile: +49 176 24250798
mailto:t <[email protected]>[email protected]
********************************************
|
merge my dev branch to original
…isabled for default
Yep, phone app. I'll cite the blynk.cc :)
I only now got around to testing this again and VPin worked fine as switch, real gpio as pushbutton. No reset this time, probably because i did not assign vpin manually (or some other user error) About the timeout... It would be nice to have exponential backoff when connection is unsuccessful. Blynk lib does not do it itself, so I guess it can be done manually checking .connect() result and waiting a bit before calling it again (increasing time each failed attempt but not indefinitely). Even if you are doing async approach. (and btw, besides blynk.connect timeout, there is also 5sec timeout on WifiClient itself linked to both DNS and connection.) Regardless, it does not break things horribly but makes serial/telnet interaction real slow and leds blinking is disrupted too. Networking itself still works, Wificlient makes sure of that by yielding once in a while. |
is there something I have to do more than requested changes ? |
Sorry for delay. I am fixing some things with this and will share it with you to review. |
Blynk cleanup
@thaeger71 Thx! Note about 128 pins limit origin - https://community.blynk.cc/t/using-127-virtual-pins-in-sketch/30491/11. For general use they have bulk of special functions per pin like BlynkWidgetRead64, BlynkWidgetWrite120 used from definitions like BLYNK_WRITE(V64) etc. and there are only 128 of them. As a finishing touch I wanted to add SecureClient version (testing it right now), with pinned self-signed cert support. blynk-cloud only supports self-signed as |
@xoseperez this on par with domoticz / thingspeak - sync relays, send sensor data, - but can also be modified to support any input / output as vpins can hold anything (up to 128 bytes in size) api for web is slightly different from thingspeak though, as it uses empty strings instead of zeroes. thus added methods to check settings value length secure client variant requires heavy modifications to default config because in my case i see +123kb increase in flash size. things like web/mqtt/tngspk etc. should be disabled for it to be reasonable in size. edit: and if this is mergeable i'd really suggest squashing to avoid adding 30 commits 🌵 |
// const char _blynk_cert[] PROGMEM = R"CERT( | ||
// ... | ||
// )CERT"; | ||
#ifndef BLYNK_USE_CUSTOM_CERT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did add this mixing two different names and did not really think about placement. Given some other modules can also have overridable certs, maybe do either
config/override/blynk_certitificate.h
<-> with default config/blynk_certificate.h
or
static/override/blynk_certificate.h
<-> with default static/blynk_certificate.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, BLYNK_USE_CUSTOM_CERT
-> BLYNK_SECURE_CERT_OVERRIDE
?
// use default settings from Blynk itself to set proper port | ||
if (host.equals(F(BLYNK_DEFAULT_DOMAIN))) { | ||
if (BLYNK_SECURE_CLIENT) { | ||
port = BLYNK_DEFAULT_PORT_SSL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future they plan to support 443 instead of 8441, so better to override it here based on the library.
please check for commit to dev branch.
Fyi, I disabled Thingspeak because of the firmware size, so that's still possible to make OTA update.
Maybe it would better to disable Alexa by default.