GithubHelp home page GithubHelp logo

Comments (14)

dbunic avatar dbunic commented on July 19, 2024 2

Hi, I made upgrade to version 1.0.8 using "Manage palette":

Screenshot from 2021-06-24 15-43-44

... and starting Node-RED log output:

===================
24 Jun 15:41:03 - [info] Node-RED version: v1.3.3
24 Jun 15:41:03 - [info] Node.js  version: v12.22.1
24 Jun 15:41:03 - [info] Linux 5.10.17+ arm LE
24 Jun 15:41:10 - [info] Loading palette nodes
24 Jun 15:41:38 - [info] Settings file  : /home/dbunic/.node-red/settings.js
24 Jun 15:41:38 - [info] Context store  : 'default' [module=memory]
24 Jun 15:41:38 - [info] User directory : /home/dbunic/.node-red
24 Jun 15:41:38 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Jun 15:41:38 - [info] Flows file     : /home/dbunic/.node-red/flows_raspi.json
24 Jun 15:41:38 - [info] Server now running at http://127.0.0.1:1880/
24 Jun 15:41:38 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
24 Jun 15:41:39 - [info] Starting flows
24 Jun 15:41:51 - [info] Started flows
24 Jun 15:41:52 - [info] [sqlitedb:a57deb46.324718] opened /home/dbunic/project/www/_database/house.sqlite3 ok
24 Jun 15:41:54 - [info] [mqtt-broker:raspi] Connected to broker: mqtt://192.168.100.3:1883
24 Jun 15:41:56 - [info] nora: connected, uid: xxxx
24 Jun 15:41:56 - [info] nora: connection - is connected: false
24 Jun 15:42:00 - [info] nora: connection - is connected: true
24 Jun 15:42:11 - [info] nora: synced 19 device(s), group: <default>

Thank you very much for quick plugin update and all provided info. We will monitor how all together is working and we hope for the best.
Cheers!

from node-red-contrib-smartnora.

dbunic avatar dbunic commented on July 19, 2024 1

Hi Andrei,
everything works excellent after update. I didn't notice any issue regarding disconnected devices since update to version 1.0.8

It seems this is fixed and it can be closed. Thank you for this plugin and quick response.

Kind regards,
Darko

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

@dbunic What version of smartnora are you using? There was a bug in an earlier version where the connection was not properly retried once it was disconnected...

from node-red-contrib-smartnora.

dbunic avatar dbunic commented on July 19, 2024

Hi, I made yesterday upgrade to version 1.0.7 ... and with upgraded version from yesterday I noticed today that devices are disconnected so I decided to search for help. With previous version 1.0.6 I also saw this issue and therefore made upgrade in hope to resolve this issue.

Screenshot from 2021-06-23 16-06-02

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

So the devices are marked as offline when the app disconnects from the firebase database (it always keeps an active connection to be able to get notifications about cloud changes).
It should automatically retry the connection periodically so yes, it might be related to your ISP (maybe they don't like long running HTTPS connections).

The issue with retrying connection was previous to v1.0.5

from node-red-contrib-smartnora.

dbunic avatar dbunic commented on July 19, 2024

OK, thank you for explanation how plugin works. Anyway, is restarting flows once per day a good way to overcome my current issue or you can suggest more elegant solution. I think automatic flows restarting (or maybe with cron node-red-restart) should be the same as "flows restart" in Node-RED app and from this point devices should be connected again. I'm just guessing where to start with resolving ...

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

I really can't say. In my mind, it should work the same. I did notice there is an update to the firebase client nora is using (from 8.6.2 to 8.6.8) might be there was a bug in firebase and now it's fixed.

You could try something like (for a default rpi installation - not sure how you're running it):

cd .node-red/node_modules/node-red-contrib-smartnora
npm install [email protected]

If this fixes it for you, I'll update the dependencies and publish a new version.

from node-red-contrib-smartnora.

dbunic avatar dbunic commented on July 19, 2024

Yes I have default rpi installation and I made firebase update as you suggested:

dbunic@raspi:~/.node-red/node_modules/node-red-contrib-smartnora $ npm install [email protected]

> [email protected] postinstall /home/dbunic/.node-red/node_modules/node-red-contrib-smartnora/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> [email protected] postinstall /home/dbunic/.node-red/node_modules/node-red-contrib-smartnora/node_modules/protobufjs
> node scripts/postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 63 packages from 63 contributors and audited 63 packages in 428.405s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Everything is OK (I also restarted Node-Red with node-red-restart). The only thing a bit confusing is that I now have firebase (and other modules) in two locations. Previous one from yesterday upgrade in parent directory. This upgrade is done using web "manage palette":

dbunic@raspi:~/.node-red/node_modules $ ls -lad firebase
drwxr-xr-x 16 dbunic dbunic 4096 Jun 22 13:55 firebase

... and new one in node-red-contrib-smartnora/node_modules directory after command npm install:

dbunic@raspi:~/.node-red/node_modules $ ls -lad node-red-contrib-smartnora/node_modules/fire*
drwxr-xr-x 16 dbunic dbunic 4096 Jun 23 17:08 node-red-contrib-smartnora/node_modules/firebase

My guess is that smartnora will first use node modules from its directory so older firebase from parent directory will be ignored or maybe modules from node-red-contrib-smartnora/node_modules should be relocated to ~/.node-red/node_modules. If this is OK, I will now monitor how everything works and let you know if that has solved the problem.

Thank you!

from node-red-contrib-smartnora.

Sdsyc avatar Sdsyc commented on July 19, 2024

Hi. I have the same problem since yesterday. I made upgrade to version 1.0.7. When a routine is started, Google assistant reports that the devices are disconnected.

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

@Sdsyc 1.0.7 only had a small bugfix, nothing related to the firebase connection.

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

There might be a weird edge case on the connection state and last will...
Where maybe a new connection is already established (from a new IP) by the time the server detects the old one timed out (which triggers marking the devices offline). I'll have a look on how I could improve this...

So steps would be:

  1. node-red establishes a connection from ip1 and asks firebase to mark devices offline if the connection is lost
  2. isp refreshes the connection with a new public ip
  3. node-red establishes a connection from ip2 (based on the retry connection logic)
  4. after a few minutes (not sure what the timeout is - it's not public), firebase detects that connection to ip1 is lost and marks all devices as offline (even though there is a new connection from ip2).

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

I'll probably just ditch the firebase ondisconnected last will implementation and just go with a simple heartbeat online detection instead.

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

@dbunic @Sdsyc I created a small release (v1.0.8) that changes the online detection to use a heartbeat mechanism and also updated all the dependencies.

Let me know if you guys still experience any issue.

from node-red-contrib-smartnora.

andrei-tatar avatar andrei-tatar commented on July 19, 2024

@dbunic Have you encountered this issue since the update?

from node-red-contrib-smartnora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.