tzapu / node-red-contrib-blynk

Blynk app integration with Node Red
MIT License
17 stars 5 forks source link

Doesn't recover from server down #16

Open scargill opened 8 years ago

scargill commented 8 years ago

It SEEMS that the only way this recovers from the Blynk server being temporarily down - is to restart node-red... any chance of working on that?

scargill commented 8 years ago

The blynk guys came back with this..

Using the WRITE node – and feeding 200 or 0 to the slider, I see it move right and left… but if I STOP the app and change the state with node-red – the change does NOT reflect in the APP when I start it.

I am using a Nexus 10 Android tablet – Android 5.1.1 and a phone with an older version 4.2 Android – the result is the same

I downloaded new server 0.12.4 .jar, admin 0.12.0.jar and the latest version of the App yesterday.

With the above tablets and using values 0 and 200 for the slider, they work perfectly until I stop the app – make a change then start the App – the App DOES NOT update…

Pete.

http://mandrillapp.com/track/click/30526449/community.blynk.cc?p=eyJzIjoiN0xDTnluRjlvMmx5VUZWanAxNTNOMWEwNmRRIiwidiI6MSwicCI6IntcInVcIjozMDUyNjQ0OSxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvY29tbXVuaXR5LmJseW5rLmNjXFxcL3VzZXJzXFxcL3NjYXJnaWxsXCIsXCJpZFwiOlwiMjE5ZDViZTUwODVhNGE3MDhmOTg4ZDllNDMxMDViNjJcIixcInVybF9pZHNcIjpbXCI4NjNlYmEwMDM3NGEzYWM2YWY1ODk0NmUxMDg0NzI0YTM2NTlkYTc3XCJdfSJ9 @scargill

Hello. You need to use Blynk.virtualWrite on button press if you need sate syncing. For instance, let's assume you have button on V1 pin. And on your hardware you have interrupt function for physical button. So when you click physical button you need also call

Blynk.virtualWrite(V1, valueToSetOnApp);

This works for sliders also.

To respond, http://mandrillapp.com/track/click/30526449/community.blynk.cc?p=eyJzIjoianlqZFllQVZ4cl9pZTNOaTgtNThuVm1ORl9NIiwidiI6MSwicCI6IntcInVcIjozMDUyNjQ0OSxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvY29tbXVuaXR5LmJseW5rLmNjXFxcL3RcXFwvd2ViLXNvY2tldHMtdXBkYXRlLW9uLXN0YXJ0aW5nLXRoZS1hcHBcXFwvMzkxNFxcXC8yXCIsXCJpZFwiOlwiMjE5ZDViZTUwODVhNGE3MDhmOTg4ZDllNDMxMDViNjJcIixcInVybF9pZHNcIjpbXCI4YjNlMTNhMTVlZGNiOWMwNTUxMzdhYjk4MGI5MmU0YzQwZTBhMDFmXCJdfSJ9 visit the topic in your

From: tzapu [mailto:notifications@github.com] Sent: 27 January 2016 11:17 To: tzapu/node-red-contrib-blynk Cc: Peter Scargill Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

@scargill https://github.com/scargill spoke about your issue to the node red guys, and they said it should work. tested it myself like this https://www.dropbox.com/s/tjd69glbs2hse2o/Screenshot%202016-01-27%2012.15.19.png?dl=0 and i can report it does work, the slider changes even when app in background or completly killed

i tested on ios...

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-175528294 . https://github.com/notifications/beacon/ABzUg_BvKKib8Rh7SpfFOFMJ_YCXXAKUks5peJCKgaJpZM4Gm_QF.gif

scargill commented 8 years ago

This is what I just sent off to the BLYNK people… I can replicate this reliably.

I should clarify…

If I KILL Blynk – ie stop the application running - make a change in Node-Red – and restart Blynk – then all is well – any changes made while Blynk was not running are reflected in the controls.

If on the other hand I just STOP Blynk (with the control top right of screen) – then make a change – and then start, NO changes are reflected in the APP. My guess then is that this HAS to be an issue with the APP because obviously the server is storing the data.

So – if I use the rectangle top right of the App to stop it running… make a change elsewhere, ie. Fire a value at the slider from Node-Red – then START the app again using the right-arrow top right of screen – then no updates are shown.

Can you replicate this. I’m using Android.

Pete.

From: tzapu [mailto:notifications@github.com] Sent: 27 January 2016 11:17 To: tzapu/node-red-contrib-blynk Cc: Peter Scargill Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

@scargill https://github.com/scargill spoke about your issue to the node red guys, and they said it should work. tested it myself like this https://www.dropbox.com/s/tjd69glbs2hse2o/Screenshot%202016-01-27%2012.15.19.png?dl=0 and i can report it does work, the slider changes even when app in background or completly killed

i tested on ios...

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-175528294 . https://github.com/notifications/beacon/ABzUg_BvKKib8Rh7SpfFOFMJ_YCXXAKUks5peJCKgaJpZM4Gm_QF.gif

tzapu commented 8 years ago

cool,

maybe it s an android thing, works perfectly for me on ios it seems

alex

scargill commented 8 years ago

Would it be possible to have a NAME for the connection – and would it also be possible for them to be global – I noted when switching tabs that I had to create a new connection for each tab… whereas for example an MQTT connection is available across the range.

The reason for naming – is that the source of the connection may be in more than one place.

From: tzapu [mailto:notifications@github.com] Sent: 27 January 2016 15:28 To: tzapu/node-red-contrib-blynk Cc: Peter Scargill Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

cool,

maybe it s an android thing, works perfectly for me on ios it seems

alex

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-175655752 . https://github.com/notifications/beacon/ABzUg-LTbn4QJGMHNEouUbuohb76BWecks5peMtsgaJpZM4Gm_QF.gif

tzapu commented 8 years ago

i ll add name for global scope, there s been a change in node-red, you ve now got a scope dropdown in the top right corner of any config window https://www.dropbox.com/s/kn43ktwwkqovm9c/Screenshot%202016-01-28%2019.06.38.png?dl=0

scargill commented 8 years ago

HEY – isn’t that neat……

Ok, will look forward to a name … much better – and thanks for the education!

Pete

From: tzapu [mailto:notifications@github.com] Sent: 28 January 2016 18:07 To: tzapu/node-red-contrib-blynk Cc: Peter Scargill Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

i ll add name for global scope, there s been a change in node-red, you ve now got a scope dropdown in the top right corner of any config window https://www.dropbox.com/s/kn43ktwwkqovm9c/Screenshot%202016-01-28%2019.06.38.png?dl=0

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-176285694 . https://github.com/notifications/beacon/ABzUg-ZbfxtA6vVYlNWxmgjihOhohQD0ks5pekIngaJpZM4Gm_QF.gif

tzapu commented 8 years ago

now on npm https://www.npmjs.com/package/node-red-contrib-blynk-websockets with name for server label will slowly move all of the current one to the websockets one and start updading docs and so on.

scargill commented 8 years ago

Hi

Everything continues to work well – you’ve done a good job..

Question – it might just be me but..

On powerup of Node-Red if I wanted to see what state a button is currently in – i.e. 1 or 0 - I can’t see how I would do that – is there any way to interrogate a button?

From: tzapu [mailto:notifications@github.com] Sent: 03 February 2016 20:32 To: tzapu/node-red-contrib-blynk node-red-contrib-blynk@noreply.github.com Cc: Peter Scargill pete@scargill.org Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

now on npm https://www.npmjs.com/package/node-red-contrib-blynk-websockets with name for server label will slowly move all of the current one to the websockets one and start updading docs and so on.

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-179447543 . https://github.com/notifications/beacon/ABzUg0p0pCvyVTY_zdvEdmGl7vzsy2rJks5pgls4gaJpZM4Gm_QF.gif

tzapu commented 8 years ago

it looks like there might be a way to do it here https://github.com/blynkkk/blynk-library/blob/master/examples/More/SyncPhysicalButton/SyncPhysicalButton.ino

i ll have to look into it

for new issues and problems please use a new issue on the websockets project, this will be cleaned up and made obsolete soon

cheers