octoblu / meshblu

Meshblu is a cross-protocol IoT machine-to-machine messaging system.
https://meshblu.readme.io/
MIT License
816 stars 182 forks source link

NodeBlu - Can it communicate with skynet on Pi #53

Closed gadgethome closed 9 years ago

gadgethome commented 10 years ago

Can the Skynet In and Skynet Out send messages to the Skynet installation on my Raspberry Pi or are they just for http://skynet.im/ when devices are registered?

Please could you give some steps on how to use Skynet In and Out?

Thanks

monteslu commented 10 years ago

As long as you know the uuid for the pi, you can message it to and from NodeBlu. They'll pass through skynetim.

Just add the uuid of the pi in dialog of a skynet node in NodeBlu.

Also, you might want to look at https://github.com/skynetim/hub for running on the pi. I was coincidentally about to push some docs to help with that setup in a few minutes :)

gadgethome commented 10 years ago

Great. That would be really helpful. Thanks

monteslu commented 10 years ago

Docs updated: https://github.com/skynetim/hub/tree/master/devices/raspberryPi

gadgethome commented 10 years ago

I had the hub previously installed on my pi. Just following the above instructions and ran npm install and then ran sudo node server.js Seems to be coming up with lots of errors that were not there before. Says express was missing so I installed it. Now saying

~/hub $ sudo node server.js

module.js:340 throw err; ^ Error: Cannot find module './lib/parse-js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/pi/hub/node_modules/skynet/node_modules/socket.io-client/node_modules/uglify-js/uglify-js.js:14:17) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

Have I missed any steps out? thanks

monteslu commented 10 years ago

possibly git pull origin master from the hub directory to make sure you're at the latest?

monteslu commented 10 years ago

also, can you confirm which node version you're running? node --version

gadgethome commented 10 years ago

On my Pi I am running v0.10.23. Its not the latest but the hub did work 2-3 days ago.

monteslu commented 10 years ago

Should be fine. Dependencies are versioned, so only thing else I can think is maybe an error in npm downloading. Perhaps remove the node_modules folder and run npm install again?

gadgethome commented 10 years ago

Thanks for checking. I removed the hub directory and decided to start the install fresh. Takes a long time on the Pi but hopefully be able to test before bed :)

gadgethome commented 10 years ago

Its all installed and up and running now. Also tested the skynethub.sh and all good so far.

octoblu commented 10 years ago

w00t!

gadgethome commented 10 years ago

Do you have any examples on communicating with a device attached to the hub on a Raspberry Pi? I'm struggling to understand how to achieve it. Thanks

chrismatthieu commented 9 years ago

You can now run the following command from Nodeblu's background page to connect to private instances of SkyNet:

setupConn('http://192.168.100.20', 3000, function(data){ console.log('hi', data); } );

Replace the IP address and port with your local configuration.