Harsch-Systems / node-red-contrib-pi-plates

Control Pi-Plates from Node-RED
Apache License 2.0
6 stars 7 forks source link

Node-Red: Missing Python Dependencies #18

Closed ExperimentalZeros closed 3 years ago

ExperimentalZeros commented 3 years ago

Hello and thank you for this product integration.

I am having problems having NR "talking" to the Pi-Plates DACC2 Plate, but I am able to control it over CLI/Python3 over the examples provided by the manufacturer just fine.

This is what I am getting while running logs set to "TRACE":

26 Apr 02:02:21 - [trace] git["--version"]
26 Apr 02:02:21 - [trace] git["config","--global","user.name"]
26 Apr 02:02:21 - [trace] git["config","--global","user.email"]
26 Apr 02:02:21 - [trace] git init: {"version":"2.20.1"}
26 Apr 02:02:21 - [info] 

Welcome to Node-RED
===================

26 Apr 02:02:21 - [info] Node-RED version: v1.3.3
26 Apr 02:02:21 - [info] Node.js  version: v12.22.1
26 Apr 02:02:21 - [info] Linux 5.10.17-v7l+ arm LE
26 Apr 02:02:22 - [info] Loading palette nodes
26 Apr 02:02:22 - [debug] Module: node-red-contrib-pi-plates 0.1.2 /home/?/.node-red/node_modules/node-red-contrib-pi-plates
26 Apr 02:02:22 - [debug] Module: node-red-contrib-play-audio 2.5.0 /home/?/.node-red/node_modules/node-red-contrib-play-audio
26 Apr 02:02:22 - [debug] Module: node-red-dashboard 2.29.0 /home/?/.node-red/node_modules/node-red-dashboard
26 Apr 02:02:22 - [debug] Module: node-red-node-pi-gpio 1.2.3 /home/?/.node-red/node_modules/node-red-node-pi-gpio
26 Apr 02:02:22 - [debug] Module: node-red-node-ping 0.3.1 /home/?/.node-red/node_modules/node-red-node-ping
26 Apr 02:02:22 - [debug] Module: node-red-node-random 0.4.0 /home/?/.node-red/node_modules/node-red-node-random
26 Apr 02:02:22 - [debug] Module: node-red-node-serialport 0.13.0 /home/?/.node-red/node_modules/node-red-node-serialport
26 Apr 02:02:22 - [debug] Module: node-red-node-smooth 0.1.2 /home/?/.node-red/node_modules/node-red-node-smooth
26 Apr 02:02:22 - [debug] Module: node-red-node-rbe 0.5.0 /usr/lib/node_modules/node-red/node_modules/node-red-node-rbe
26 Apr 02:02:22 - [debug] Module: node-red-node-tail 0.3.1 /usr/lib/node_modules/node-red/node_modules/node-red-node-tail
26 Apr 02:02:23 - [info] Dashboard version 2.29.0 started at /ui
26 Apr 02:02:23 - [info] Settings file  : /home/?/.node-red/settings.js
26 Apr 02:02:23 - [info] Context store  : 'default' [module=memory]
26 Apr 02:02:23 - [info] User directory : /home/?/.node-red
26 Apr 02:02:23 - [info] Projects directory: /home/?/.node-red/projects
26 Apr 02:02:23 - [trace] git["remote","-v"]
26 Apr 02:02:23 - [trace] git["rev-list","HEAD","--count"]
26 Apr 02:02:23 - [info] Server now running at http://127.0.0.1:1880/
26 Apr 02:02:23 - [trace] git["ls-files","--cached","--others","--exclude-standard"]
26 Apr 02:02:23 - [trace] git["status","--porcelain","-b"]
26 Apr 02:02:23 - [info] Active project : CRYPTO
26 Apr 02:02:23 - [info] Flows file     : /home/?/.node-red/projects/CRYPTO/flow.json
26 Apr 02:02:23 - [trace] runtime event: {"id":"runtime-state","retain":true}
26 Apr 02:02:23 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"070b190de24fabc33bf0e1899adbade4"},"retain":true}
26 Apr 02:02:23 - [info] Starting flows
26 Apr 02:02:23 - [debug] red/nodes/flows.start : starting flow : global
26 Apr 02:02:23 - [debug] red/nodes/flows.start : starting flow : 3e3bff3e.31d9e
26 Apr 02:02:23 - [debug] red/nodes/flows.start : starting flow : aa89fbeb.f4bdb8
26 Apr 02:02:23 - [trace] [flow:global] start flow [global]
26 Apr 02:02:23 - [trace] [flow:global] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:global]  id               | type         | alias
26 Apr 02:02:23 - [trace] [flow:global] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:global]  a8c38a6.e68d878  | pi_plate     | 
26 Apr 02:02:23 - [trace] [flow:global] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e] start flow [3e3bff3e.31d9e]
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  id               | type         | alias
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  a908c216.508a6   | http request | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  e991495.be59ab8  | debug        | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  e1ecce70.1c0a5   | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  a2e6a37b.71aed   | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  c68ed950.fd3f48  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  54a3bb89.b82d64  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  aecda2c8.cce39   | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  ba67a55d.e7f0b8  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  424eb79f.6303a8  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  a7bd53a9.4bb01   | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  9d8b7b76.5a52e8  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  335822a4.2117ae  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  f52f87d0.d48d28  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  8a3bf740.e86fb8  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  f96b52d.be261b   | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  6a9ad238.59858c  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  efa380e8.67bb2   | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  1f92c8f8.cff3b7  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  55504bf2.3729c4  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  9c95e599.ce8068  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  58f21a2c.a2e1f4  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  21b401ee.c97c2e  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  bd9d7daf.f3dca   | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  7f829a40.22fa94  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  1aeb9519.146a2b  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  8ed59bec.8d91e8  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  818d68ea.c9a828  | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  53914ead.df01b   | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  6643d335.4ab27c  | exec         | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  af3cd02.da5ed3   | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  d25f85e8.8ce2c8  | debug        | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  640c639.746fc9c  | debug        | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  4c2e0c7b.b9ddb4  | debug        | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  e0e2a3e8.1e5c9   | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  f85ebdf1.fad4    | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  4a849fe.527cc6   | json         | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  473a32d5.38a88c  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  484ff056.d5fd2   | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  ed988618.14be58  | inject       | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e]  ae4a5d8a.a607    | function     | 
26 Apr 02:02:23 - [trace] [flow:3e3bff3e.31d9e] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8] start flow [aa89fbeb.f4bdb8]
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  id               | type         | alias
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  ce02d99c.146a18  | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  26c7c152.9c804e  | debug        | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  47e844ad.e1678c  | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  69b64234.6071bc  | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  5c8640e6.541c5   | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  99894359.d92cc   | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  ff53641.8f50398  | comment      | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  80fcaaaf.6797e8  | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  efcf5002.8994c   | inject       | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  b3f703bd.022a9   | ppLED        | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8]  cb8328f8.d8fe98  | ppADC        | 
26 Apr 02:02:23 - [trace] [flow:aa89fbeb.f4bdb8] ------------------|--------------|-----------------
26 Apr 02:02:23 - [trace] runtime event: {"id":"runtime-state","retain":true}
26 Apr 02:02:23 - [info] Started flows

26 Apr 02:03:38 - [info] [ppLED:b3f703bd.022a9] missing python dependencies <---- ???
26 Apr 02:03:38 - [info] [ppADC:cb8328f8.d8fe98] missing python dependencies <--- ???

And, here is a screenshot of the issue: Screenshot_2021-04-26_02-07-10

Please advice if more detail is needed, or ways to help further.

Thank you

mharsch commented 3 years ago

This symptom usually indicates that you don't have python 3.x installed or that python 3.x isn't available via the 'python3' command. Is this the case for you?

mharsch commented 3 years ago

Ok, I think I can guess what's going on here. We instantiate all of the plate types in our underlying python script, and one in particular (TINKERPlate) has some unusual dependencies (e.g. pygame). These dependencies aren't always installed by default (e.g. Lite version of Raspberry Pi OS). Here's a setup procedure that should meet all the requirements:

pi setup for pi-plates Raspberry Pi OS Lite

Start with SD image: Raspberry Pi OS Lite initial config with raspi-config (include SPI:enabled) sudo apt install python3-pip sudo apt install python3-spidev sudo apt install python3-pygame sudo apt install python3-rpi.gpio sudo pip3 install pi-plates

ExperimentalZeros commented 3 years ago

Hi again,

Thank you for quick response!

It ended up being python3-pygame the missing dependency.

after re-starting NR, I noticed the following log trail:

26 Apr 11:30:49 - [info] Started flows
stderr: ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory

stderr: ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM default

.... I really wonder why it is asking anything from ALSA to make this python calls to work with this device.... I also wonder what dependency is given by "python3-pygame" that is not already covered by "python3-spidev", "python3-rpi.gpio", "pi-plates"... it just seems like the later should have all the elementals needed.

At least it is up and running now but if you do have any insight on the above, I would listen.

Again thank you!