mattdavis90 / node-red-contrib-tado-client

Tado web API client node for Node Red
MIT License
23 stars 16 forks source link

Failure to install on a pi 4? #27

Closed oldironUK closed 4 years ago

oldironUK commented 4 years ago

Hi Matt Firstly I have your Node running perfectly on a pi3, so thanks for your work on this.

However I have been migrating from a my pi 3 to a pi 4 and was moving my flows across. I moved my Tado flow prior to installing your 'client'. I then went to the palette and loaded the wrong Node! I mistakenly loaded "node-red-contrib-tado v0.1.6", but as soon as I started to configure this node I realized that I really wanted your "node-red-contrib-tado-client v0.9.0" . Even though I have deleted the original I now get a conflict message that prevents your Tado Config being saved.

I'm running under docker using the IOTstack setup. I can remove both Nodes and can see that the directory is empty (~/IOTstack/volumes/nodered/data/node_modules) - I can start the stack and reinstall "node-red-contrib-tado-client v0.9.0" and the files correctly appear in the directory. However as soon as I configure the node and deploy I get error :

"Flows stopped due to missing node types: tado-config tado

When I go back to the node that I had just configured I find that the fields have been cleared. I can re-populate and deploy but I always see this error message in the palette menu.

image

Logs show: 6 Nov 09:38:28 - [info] - node-red-contrib-tado-client:tado-config : SyntaxError: Invalid or unexpected token 6 Nov 09:38:28 - [info] - node-red-contrib-tado-client:tado : SyntaxError: Invalid or unexpected token 6 Nov 09:39:24 - [warn] [node-red-contrib-tado-client/tado] SyntaxError: Invalid or unexpected token

Any suggestions

Thanks GeofC

mattdavis90 commented 4 years ago

Hi GeofC,

Thanks for using my node-red module. I haven't tried to run this on a Raspberry Pi myself so I'm not 100% certain about how you'll be set up.

Looking at your logs though I think your issue is the version of nodejs that you're running. With the latest updates to this module a minimum of node v12 is required to use the async features. Hopefully this achievable on your Pi4 setup

Thanks, Matt

oldironUK commented 4 years ago

Hi Matt Thanks for getting back so quickly - I'll investigate the versions of nodejs on both my systems and let you know the results Regards GeofC

oldironUK commented 4 years ago

Solution

This solution is from the work of @Paraphraser on the IOTstack discord channel who I would like to thank very much for his input.

The actual problem is trying to run this Node on the current version of IOTstack and is not a problem with the Raspberry Pi 4.

The IOTstack currently builds Node Red in a docker container with an early version of node.js

Before: $ docker exec nodered node --version v10.23.0

Solution Edit file: ~/IOTstack/services/nodered/Dockerfile Change 1st line: FROM nodered/node-red:latest To: FROM nodered/node-red:latest-12

Then rebuild: $ cd ~IOTstack $ docker-compose up --build -d nodered $ docker exec nodered node --version v12.19.0

Note that this may leave a unused images in the image set. $ docker system prune (may require several iterations?)

mattdavis90 commented 4 years ago

Glad that you got this working, and thank you for documenting the steps for others to follow. Let me know if you bump into any other issues with the library.