i8beef / node-red-contrib-castv2

MIT License
22 stars 14 forks source link

Bug: Node messing up RPI behaviour #66

Closed arachnida closed 3 years ago

arachnida commented 3 years ago

To replicate: Put a text in the Message field, put a language code in the Language field and audio/mp3 in the Media Type field of the Castv2 node. Connect to a Google Hub device. Now inject an MP3 URL into the node, I used the TTS Voicerss.org site to generate the mp3. It looks to me that the node is writing in unprotected memory outside it's own dedicated memory as after injecting the URL I get strange behaviour of my domotics system running on the Rpi.

I'm not a programmer but to me it looks like the castv2 node was writing in memory outside it's own and messed up the other flows and functionality of Node-Red.

I understand it was a mistake not to remove the text in the message field of the node when sending an URL message to the node but the error should be trapped as it gives very unpredictable results.

i8beef commented 3 years ago

That sounds more like node-red crashing (Node's async exception handling is a little tricky, and its easy to miss an error being thrown in a single location which will crash the whole process). Can you reproduce and look at your node-red console output to see what its throwing? Not the debug console, the actual Linux console / Docker log of the node-red instance.

arachnida commented 3 years ago

I can do that but it will take some time. My Rpi works headless with only a Streamdeck XL as keyb/displ. I didn’t install some kind of remote desktop. Maybe I can do some tests on spare RPi with Node-Red installed. It certainly looks like Node-Red is crashing and rebooting but after the reboot the delay node isn’t reset and the time I get disconnected is way shorter than when I do a soft reboot of Node-Red.

i8beef commented 3 years ago

Put a text in the Message field, put a language code in the Language field and audio/mp3 in the Media Type field of the Castv2 node

You mean in the message being sent INTO the node right? This node doesn't HAVE fields in the node properties for these (node-red-contrib-cast does though)... just making sure I'm not troubleshooting a different implementation here...

arachnida commented 3 years ago

No, sorry my bad. You are right, I switched the original cast node for the castv2 node. I meant the yellow old one, that has the fields. Once again sorry for your time, ivo

arachnida commented 3 years ago

I use both nodes, cast and castv2 together. From castv2 I needed the type: "CLOSE" to get the screen of my Google Home back to normal after a cast with the cast node. This way I got confused. I liked the cast node because it has the property fields in the node configuration so i could skip a function node before it. You can close this ticket, sorry for the inconvenience.

i8beef commented 3 years ago

You should open this bug over on their board then. This means they are missing an error handling opportunity, and its bubbling the error all the way up and killing node-red: bad juju.

You SHOULD be able to use the nodes together, just note that we take different approaches to the connection / session management that can conflict, as their "connect, run command, disconnect" method without my patched in changes to the underlying library's bugs can leave the target thinking its still talking to a client when it isn't. I THINK you can probably live with that, but just be aware you could hit oddities eventually. Let me know if you do and I'll try and help.

arachnida commented 3 years ago

Hi, Hypnos3 doesn't maintain his node anymore and I saw another issue on his github page where connection to the webserver is lost. https://github.com/Hypnos3/node-red-contrib-cast/issues There is someone else: node-red-contrib-cast-new but it looks like it is still beta and not available in the manage palette of Node-Red. I guess I better move over to using your node for all my casts, something to do when it's raining.