Cannot connect
Hi,
I'm trying to connect like this:
wpjs.connect({number: 'xxxxxx', password: 'xxxxxxxxxxxxxxxxxxx=', yowsup: "/home/xxxx/yowsup/yowsup-cli" }, function(state){ console.log('state: ' + state); });
but state log never appears
wpjs.on() callback also doesn't seem to appear.
when i try to use wpjs.send() i get the following error: events.js:141 throw er; // Unhandled 'error' event ^
Error: read ECONNRESET at exports._errnoException (util.js:874:11) at Pipe.onread (net.js:544:26)
if i don't use wpjs.send() then it just runs and exits instantly and doesn't wait for messages even that i ran wpjs.on() My guess is something went wrong with the connection, because its callback haven't appeared.
Any ideas?
here is my whole code:
`console.log('1'); var wpjs = require('./wpjs/index.js'); console.log('2');
wpjs.connect({number: 'xxxxxxxxxxxx', password: 'xxxxxxxxxxxxxxxxxx=', yowsup: "/home/student/yowsup/yowsup/yowsup-cli" }, function(state){ console.log('state: ' + state); });
console.log('3');
wpjs.send({to: 'xxxxxxxxxxxxxx', type: 'txt', data: 'Im online…'});
wpjs.on('inbox',function(message){ console.log(message.type)//type of message (txt) console.log(message.from)// number_src of message console.log(message.username) // nickname console.log(message.date)// arrival date console.log(message.data)// message... });
console.log('4');`