Jacques44 / node-red-contrib-bigfile

node-red contribution. This node is for managing big files in a blue way !
Apache License 2.0
2 stars 3 forks source link

Getting error when I use big file reader in bluemix node-red #3

Closed Ameritronik closed 8 years ago

Ameritronik commented 8 years ago

Hi, I was able to include the big file reader in my app on bluemix. I downloaded my starter code, then added the following line in package.json: "node-red-contrib-bigfile":"1.1.0", and pushed it back to blue mix. I was able to see the big file reader in the node-red editor. When I try to deploy, I get the error message in the debug tab:

"5/2/2016, 10:38:50 PM2997ced5.fc4302 msg : error TypeError: undefined is not a function"

How to solve the above issue? Thanks

Jacques44 commented 8 years ago

hello, thanks for your feedback. I'm having a look right now

Jacques44 commented 8 years ago

I've pulled a fresh version of the node and made it work without any problem. I've not any bluemix account right now but I'll check this evening.

Please did you use the node? When did you get this error message?

Ameritronik commented 8 years ago

Hi Jacques44,

I tried this again this morning and get the same error, listed below. I have attached the node red-code with your big file included. I am not sure if I am using this correctly.

Also in the recommended method for adding node, I followed the package.json update but not the "add the required node package to the dependencies section" Can you please tell me where the dependencies go?

May be the dependencies is the problem?

Here is what I am attempting to do:

(device to bluemix) Input is an MQTT text message. The input text is provided to Text-To-Speech (TTS). The TTS outputs audio in a unsigned-character-array. I am attempting to break up this unsigned character-array into 1KB chunks to be returned via MQTT to device (bluemix-to-device).

You can see that I attempted ( rather pathetically :-) ) to generate an output format-er (Ofrmtr) to do the same or similar to your big file. But then I found your big file and attempted to use it..

Also the IBM's MQTT output node expects the msg.payload to be in json format. I assume the bigfile will generate in json format right?

------------------------------- IBM blue mix's recommended method to import nodes------------------- Adding new nodes to the palette There is a growing collection of additional nodes that can be added to the Node-RED editor. You can search for available nodes in the Node-RED library. Edit the file package.json and add the required node package to the dependencies section. The format is: "node-red-node-package-name":"x.x.x" Where x.x.x is the desired version number.

----------------------------------- Node red error message--------------

5/3/2016, 7:50:43 AM9a72e17d.be10amsg : errorTypeError: undefined is not a function

--------- Original Message --------- Subject: Re: [Jacques44/node-red-contrib-bigfile] Getting error when I use big file reader in bluemix node-red (#3) From: "Jacques W" notifications@github.com Date: 5/3/16 12:21 am To: "Jacques44/node-red-contrib-bigfile" node-red-contrib-bigfile@noreply.github.com Cc: "Ameritronik" hk@ameritronik.com, "Author" author@noreply.github.com

I've pulled a fresh version of the node and made it work without any problem. I've not any bluemix account right now but I'll check this evening. Please did you use the node? When did you get this error message?

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

[{"id":"3e77d543.c1882a","type":"ibmiot in","z":"301c75a2.d2eb5a","authentication":"boundService","apiKey":"","inputType":"evt","deviceId":"Gobbledegook","applicationId":"","deviceType":"MyEchoT3PO","eventType":"eid","commandType":"","format":"json","name":"IBM IoT App In","service":"registered","allDevices":false,"allApplications":false,"allDeviceTypes":false,"allEvents":false,"allCommands":false,"allFormats":false,"x":251,"y":291,"wires":[["ae0082ac.51ff8","c0c482df.3f3b8"]]},{"id":"ae0082ac.51ff8","type":"function","z":"301c75a2.d2eb5a","name":"text","func":"return {payload:msg.payload.text};","outputs":1,"noerr":0,"x":424.5,"y":337,"wires":[["3d3fc123.63be7e","d0049f40.80a16"]]},{"id":"5dad02b7.a252fc","type":"debug","z":"301c75a2.d2eb5a","name":"AudioOut","active":true,"complete":"true","x":877.4999847412109,"y":244,"wires":[]},{"id":"c0c482df.3f3b8","type":"debug","z":"301c75a2.d2eb5a","name":"device data","active":true,"console":"false","complete":"true","x":427.5,"y":196,"wires":[]},{"id":"3d3fc123.63be7e","type":"watson-text-to-speech","z":"301c75a2.d2eb5a","name":"","lang":"english","voice":"en-US_AllisonVoice","format":"audio/wav","x":649.5,"y":331,"wires":[["5dad02b7.a252fc","c21726fb.cf1238","9a72e17d.be10a"]]},{"id":"d0049f40.80a16","type":"debug","z":"301c75a2.d2eb5a","name":"Text Payload","active":true,"console":"false","complete":"true","x":549.5,"y":424,"wires":[]},{"id":"b7389e7a.58f02","type":"ibmiot out","z":"301c75a2.d2eb5a","authentication":"boundService","apiKey":"","outputType":"cmd","deviceId":"Gobbledegook","deviceType":"MyEchoT3PO","eventCommandType":"cid","format":"json","data":"na","name":"IBM IoT","service":"registered","x":1103.8609924316406,"y":471.14624786376953,"wires":[]},{"id":"c21726fb.cf1238","type":"function","z":"301c75a2.d2eb5a","name":"OFrmtr","func":"var amsg = {};\nvar tpc = 'iot-2/type/MyEchoT3PO/id/Gobbledegook/cmd/cid/fmt/json';\nvar dlen = msg.speech.length;\nvar d = msg.speech;\nvar hdr = '{\"Audio\": \"'+d+'\" }';\namsg.topic = tpc;\namsg.payload = hdr;\namsg.data = d;\nreturn amsg;","outputs":1,"noerr":0,"x":871.1701354980469,"y":327.70496368408203,"wires":[["e6e017de.cf3338"]]},{"id":"e6e017de.cf3338","type":"debug","z":"301c75a2.d2eb5a","name":"output OFrmtr","active":true,"console":"false","complete":"true","x":1059.3957214355469,"y":327.67017364501953,"wires":[]},{"id":"ff09a4f9.fe9cf8","type":"inject","z":"301c75a2.d2eb5a","name":"","topic":"","payload":"hello this is test for Joseph","payloadType":"str","repeat":"","crontab":"","once":false,"x":538,"y":125.5,"wires":[["3d3fc123.63be7e"]]},{"id":"9a72e17d.be10a","type":"bigfile reader","z":"301c75a2.d2eb5a","name":"Blocks_Out","filename":"msg.speech","nopayload":false,"flow":"blocks","highWaterMark":"1","encoding":"base64","format":"base64","keepEmptyLines":false,"x":842.9449882061488,"y":474.72335052490234,"wires":[["b7389e7a.58f02","e288ac0c.ca749"],["b7389e7a.58f02","e288ac0c.ca749"]]},{"id":"e288ac0c.ca749","type":"debug","z":"301c75a2.d2eb5a","name":"dbg_big_file_out","active":true,"console":"false","complete":"true","x":1097.5,"y":410,"wires":[]}]

Ameritronik commented 8 years ago

Hi Jaques44, A quick update:

I included the following files in package.json: "byline":"4.2.1", "node-red-biglib":"1.1.0", "node-red-contrib-bigfile":"1.1.0", So now the dependencies are also pushed to blue mix, but still same error when I click on deploy button in node-red editor.


--------- Original Message --------- Subject: RE: Re: [Jacques44/node-red-contrib-bigfile] Getting error when I use big file reader in bluemix node-red (#3) From: hkanekal@ameritronik.com Date: 5/3/16 8:06 am To: "Jacques44/node-red-contrib-bigfile" reply@reply.github.com, "Jacques44/node-red-contrib-bigfile" node-red-contrib-bigfile@noreply.github.com

Hi Jacques44,

I tried this again this morning and get the same error, listed below. I have attached the node red-code with your big file included. I am not sure if I am using this correctly.

Also in the recommended method for adding node, I followed the package.json update but not the "add the required node package to the dependencies section" Can you please tell me where the dependencies go?

May be the dependencies is the problem?

Here is what I am attempting to do:

(device to bluemix) Input is an MQTT text message. The input text is provided to Text-To-Speech (TTS). The TTS outputs audio in a unsigned-character-array. I am attempting to break up this unsigned character-array into 1KB chunks to be returned via MQTT to device (bluemix-to-device).

You can see that I attempted ( rather pathetically :-) ) to generate an output format-er (Ofrmtr) to do the same or similar to your big file. But then I found your big file and attempted to use it..

Also the IBM's MQTT output node expects the msg.payload to be in json format. I assume the bigfile will generate in json format right?

------------------------------- IBM blue mix's recommended method to import nodes------------------- Adding new nodes to the palette There is a growing collection of additional nodes that can be added to the Node-RED editor. You can search for available nodes in the Node-RED library. Edit the file package.json and add the required node package to the dependencies section. The format is: "node-red-node-package-name":"x.x.x" Where x.x.x is the desired version number.

----------------------------------- Node red error message--------------

5/3/2016, 7:50:43 AM9a72e17d.be10amsg : errorTypeError: undefined is not a function

--------- Original Message --------- Subject: Re: [Jacques44/node-red-contrib-bigfile] Getting error when I use big file reader in bluemix node-red (#3) From: "Jacques W" notifications@github.com Date: 5/3/16 12:21 am To: "Jacques44/node-red-contrib-bigfile" node-red-contrib-bigfile@noreply.github.com Cc: "Ameritronik" hk@ameritronik.com, "Author" author@noreply.github.com

I've pulled a fresh version of the node and made it work without any problem. I've not any bluemix account right now but I'll check this evening. Please did you use the node? When did you get this error message?

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

Jacques44 commented 8 years ago

Hello, it's very strange. I've made a fresh install here and everything is perfect. I've another issue on bigcsv which seems the same as yours.

Is it possible for you to start node-red in verbose mode and tell me if you've more details?

Regards

Jacques44 commented 8 years ago

Seems solved by upgrading node. Do you know which release of node you are using?

Ameritronik commented 8 years ago

Hi Jacques44,

This is what I have in my packages.json : "byline":"4.2.1", "node-red-biglib":"1.1.0", "node-red-contrib-bigfile":"1.1.0",

But I decided to write my own big-file-type of code in one of the function nodes available on bluemix. I will probably use the bigfile reader later and try the latest version then,

Thank you for the follow up.

--------- Original Message --------- Subject: Re: [Jacques44/node-red-contrib-bigfile] Getting error when I use big file reader in bluemix node-red (#3) From: "Jacques W" notifications@github.com Date: 5/5/16 4:02 am To: "Jacques44/node-red-contrib-bigfile" node-red-contrib-bigfile@noreply.github.com Cc: "Ameritronik" hk@ameritronik.com, "Author" author@noreply.github.com

Seems solved by upgrading node. Do you know which release of node you are using?

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

Jacques44 commented 8 years ago

You're welcome !