st-one-io / node-red-contrib-ui-media

A Node-RED UI node to show media files (image and video) on the dashboard.
Apache License 2.0
13 stars 7 forks source link

File Pathing #6

Closed daveHounds closed 5 years ago

daveHounds commented 5 years ago

Loaded ui_media node successfully. Setup node per your instructions. Preview would not show anything. Saved settings. Whenever I reopen the media node, node-red crashes. Last attached image shows the file path location, it looks correct to me per your discussion and instructions. Yet node-red seems to be crashing with a pathing issue.

I am not strong with software and do not understand the node-red error information. Could you please review attached images and help to fix?

Welcome to Node-RED

22 May 14:19:17 - [info] Node-RED version: v0.19.5 22 May 14:19:17 - [info] Node.js version: v10.15.1 22 May 14:19:17 - [info] Windows_NT 10.0.17763 x64 LE 22 May 14:19:18 - [info] Loading palette nodes 22 May 14:19:20 - [warn] rpi-gpio : Raspberry Pi specific node set inactive 22 May 14:19:20 - [info] Dashboard version 2.15.2 started at /red/ui 22 May 14:19:20 - [warn] ------------------------------------------------------ 22 May 14:19:20 - [warn] [node-red/tail] Not currently supported on Windows. 22 May 14:19:20 - [warn] ------------------------------------------------------ 22 May 14:19:20 - [info] Settings file : \Users\dave.node-red\settings.js 22 May 14:19:20 - [info] HTTP Static : C:\Users\dave.node-red 22 May 14:19:20 - [info] Context store : 'default' [module=memory] 22 May 14:19:20 - [info] User directory : \Users\dave.node-red 22 May 14:19:20 - [info] Server now running at http://127.0.0.1:1880/red/ 22 May 14:19:20 - [info] Active project : Collection_Template_Widgets 22 May 14:19:20 - [info] Flows file : \Users\dave.node-red\projects\Collection_Template_Widgets\flow.json 22 May 14:19:20 - [info] Starting flows 22 May 14:19:21 - [info] Started flows 22 May 14:20:24 - [red] Uncaught Exception: 22 May 14:20:24 - TypeError: path must be absolute or specify root to res.sendFile at ServerResponse.sendFile (C:\Users\dave\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\response.js:421:11) at fs.access (C:\Users\dave.node-red\node_modules\node-red-contrib-ui-media\ui_media.js:287:10) at FSReqWrap.oncomplete (fs.js:141:20)

C:\Users\dave>

Media Configuration Media Files File Path

daveHounds commented 5 years ago

The following also gets outputted to the console periodically: 23 May 09:00:36 - [error] [trigger:a0146cda.203598] TypeError: Cannot read property 'tout' of undefined

steuck13 commented 5 years ago

Greetings, Thank your for your report. We'll take a look into it.

steuck13 commented 5 years ago

Could you export your flow for us?

daveHounds commented 5 years ago

[{"id":"3d7f4e50.e2b682","type":"ui_media","z":"ef743543.464e8","group":"558b65ae.a8af3c","name":"","width":0,"height":0,"order":1,"category":"LOGOs","file":"KanabHounds Rescale.jpg","layout":"adjust","showcontrols":true,"loop":true,"onstart":false,"scope":"local","tooltip":"","x":346,"y":384,"wires":[[]]},{"id":"558b65ae.a8af3c","type":"ui_group","z":"","name":"Give it a try","tab":"c1dfaba0.24ece","order":1,"disp":true,"width":"6","collapse":false},{"id":"c1dfaba0.24ece","type":"ui_tab","z":"","name":"Media","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

daveHounds commented 5 years ago

Not much of a flow :) Just imported your node and was learning how to use it in a project.

daveHounds commented 5 years ago

I messed up. Going to redo the export. Copied my "playing" with your node to a virgin/new project and it lost all of the file setup data. Dah! I will get my actual flow. Still a one-node flow.

daveHounds commented 5 years ago

[{"id":"559f417d.2c52f","type":"ui_media","z":"512939ab.2ab838","group":"49e1c729.08cd8","name":"","width":0,"height":0,"order":1,"category":"LOGOs","file":"KanabHounds Rescale.jpg","layout":"adjust","showcontrols":true,"loop":true,"onstart":false,"scope":"local","tooltip":"","x":312,"y":576,"wires":[[]]},{"id":"49e1c729.08cd8","type":"ui_group","z":"","name":"Group WITHOUT Image ","tab":"67171406.124bc4","order":2,"disp":true,"width":"6"},{"id":"67171406.124bc4","type":"ui_tab","z":"","name":"Use of Images","icon":"photo","order":1}]

daveHounds commented 5 years ago

@steuck13 have you been able to look at my problem? Any advise?

steuck13 commented 5 years ago

Greetings, Sorry for the delay, I've been very busy at work. So, I think I've fixed your problem on the new release. I just published it to npm, if some other problems arise, please report to us.

Thank you

daveHounds commented 5 years ago

@steuck13 I updated your media node and got a partial fix. Thank you.

Node-red does not crash anymore when I enter/open your node and the pathing errors are gone. I see the jpg picture in the node's properties file preview (see below).

However, the jpg picture does NOT show in the nr-dashboard. All I get is your ICON. I get some new info in the console when the flow is started (see below). This was not there before. And an old error message is still appearing (see below). Note, the "tout" error is logged exactly every 4 minutes after start of the flow.

File was found and previewed

3 Jun 09:40:46 - [info] Flows file : \Users\dave.node-red\projects\Collection_Template_Widgets\flow.json 3 Jun 09:40:46 - [info] Starting flows ; LG: e0e0acbd.a77d6 ; LG: e0e0acbd.a77d6 ; LG: e0e0acbd.a77d6 3 Jun 09:40:46 - [info] Started flows

3 Jun 09:44:46 - [error] [trigger:a0146cda.203598] TypeError: Cannot read property 'tout' of undefined

daveHounds commented 5 years ago

Current flow.

[{"id":"23c67b95.e9c2bc","type":"inject","z":"512939ab.2ab838","name":"","topic":"","payload":"{\"category\":\"LOGOs\",\"name\":\"KanabHounds Rescale.jpg\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":126,"y":576,"wires":[["559f417d.2c52f","497141a5.7deff8"]]},{"id":"497141a5.7deff8","type":"debug","z":"512939ab.2ab838","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":284,"y":512,"wires":[]},{"id":"559f417d.2c52f","type":"ui_media","z":"512939ab.2ab838","group":"49e1c729.08cd8","name":"","width":"2","height":"2","order":1,"category":"LOGOs","file":"KanabHounds Rescale.jpg","layout":"adjust","showcontrols":true,"loop":true,"onstart":false,"scope":"local","tooltip":"","x":312,"y":576,"wires":[[]]},{"id":"49e1c729.08cd8","type":"ui_group","z":"","name":"Group WITHOUT Image ","tab":"67171406.124bc4","order":2,"disp":true,"width":"6"},{"id":"67171406.124bc4","type":"ui_tab","z":"","name":"Use of Images","icon":"photo","order":1}]

steuck13 commented 5 years ago

Greeetings Could you provided us with the whole node-red log and a screenshot of your dashboard.

Thank you

daveHounds commented 5 years ago

dashboard with media

Your environment has been set up for using Node.js 10.15.1 (x64) and npm.

C:\Users\dave>node-red 10 Jun 06:58:26 - [info]

Welcome to Node-RED

10 Jun 06:58:26 - [info] Node-RED version: v0.19.5 10 Jun 06:58:26 - [info] Node.js version: v10.15.1 10 Jun 06:58:26 - [info] Windows_NT 10.0.17763 x64 LE 10 Jun 06:58:27 - [info] Loading palette nodes 10 Jun 06:58:30 - [warn] rpi-gpio : Raspberry Pi specific node set inactive 10 Jun 06:58:30 - [info] Dashboard version 2.15.4 started at /red/ui 10 Jun 06:58:31 - [warn] ------------------------------------------------------ 10 Jun 06:58:31 - [warn] [node-red/tail] Not currently supported on Windows. 10 Jun 06:58:31 - [warn] ------------------------------------------------------ 10 Jun 06:58:31 - [info] Settings file : \Users\dave.node-red\settings.js 10 Jun 06:58:31 - [info] HTTP Static : C:\Users\dave.node-red 10 Jun 06:58:31 - [info] Context store : 'default' [module=memory] 10 Jun 06:58:31 - [info] User directory : \Users\dave.node-red 10 Jun 06:58:31 - [info] Server now running at http://127.0.0.1:1880/red/ 10 Jun 06:58:31 - [info] Active project : media_node_experiment 10 Jun 06:58:31 - [info] Flows file : \Users\dave.node-red\projects\media_node_experiment\flow.json 10 Jun 06:58:31 - [info] Starting flows 10 Jun 06:58:31 - [info] Started flows

daveHounds commented 5 years ago

@steuck13 I stated an error I have been observing was caused by your media_node. NOT true! My mistake. 3 Jun 09:44:46 - [error] [trigger:a0146cda.203598] TypeError: Cannot read property 'tout' of undefined Please disregard this issue. It is not your issue, its mine.

daveHounds commented 5 years ago

I sent you the requested data. @steuck13 have you been able to look at my problem? Any advise?

steuck13 commented 5 years ago

Greetings, I'm currently having trouble reproducing your problem. I've done a fresh install on Windows 8 (I believe the windows version should not be a problem here) and all worked properly.

I'm still looking into it.

daveHounds commented 5 years ago

Thanks for the feedback.  Going on vacation for a few days.  Back on Monday.  I will try to provide you addition info then, if I can find any.

I would really like to get your widget working.  I could do lots with it.

Dave

From: Igor Steuck Lopes notifications@github.com Reply-To: netsmarttech/node-red-contrib-ui-media reply@reply.github.com Date: Tuesday, June 25, 2019 at 7:37 AM To: netsmarttech/node-red-contrib-ui-media node-red-contrib-ui-media@noreply.github.com Cc: daveHounds dave@milehihounds.com, Author author@noreply.github.com Subject: Re: [netsmarttech/node-red-contrib-ui-media] File Pathing (#6)

Greetings, I'm currently having trouble reproducing your problem. I've done a fresh install on Windows 8 (I believe the windows version should not be a problem here) and all worked properly.

I'm still looking into it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

su600 commented 5 years ago

I have a similar problem when I changed the host admin address and ui path. I noticed this from @daveHounds :

10 Jun 06:58:30 - [info] Dashboard version 2.15.4 started at /red/ui 10 Jun 06:58:31 - [info] Server now running at http://127.0.0.1:1880/red/

These are not default address of node-red, and in my project my Server now running at http://localhost, changed port 1880 to 80, and the editor is running at http://localhost/admin. After changing the host address (different from default), the ui-meida pattle can not display media on dashboard. After some tests, I found this problem is not about ui path, it is just because the admin address is changed, so could you please fix this, to make ui-media display media properly even the Server admin address is changed. The same problem as issue #5 Thank you!

gfcittolin commented 5 years ago

Hi, thanks for your report. I've just published version 1.1.2 that should have this issue and some others I've found out while fixing this one. Could you please test it out and report whether this has been really fixed? Thanks!

su600 commented 5 years ago

Sorry, I update ui_media to version1.1.2, my problem still not fixed... I run a new docker of Node-Red, installed ui_media then change the the editor address to http://localhost/admin, picture broken. I also try change http://localhost/admin first, then install the ui_media, also broken. What's the relationship between the admin address and ui_media? Why the admin address changing influence the media display? Please do more test, hope to fix this, thank you!

gfcittolin commented 5 years ago

This configuration affects ui_media because the node has to serve the images to be displayed by the dashboard, and this is part of the stack offered by Node-RED. So if this configuration is changed, the URL we have available for serving the media content also changes, therefore we need to consider that.

Changing the image by message was working, but the default image display was still indeed wrong. Version 1.1.3 has been just published which should fix this issue. Please test it out in your environment.

su600 commented 5 years ago

It works ! I have tested version 1.1.3,this problem fixed, good job!