User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Ninja Pi

Fri Feb 01, 2013 9:30 pm

Can't see ANY links to this http://ninjablocks.com/blogs/how-to/719 ... inja-block anywhere! :?

Anyone on here tried it?
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Ninja Pi

Mon Feb 11, 2013 10:58 pm

I'll take that as a no then.

But I've got it actually working now - in a fashion.

Based on the latest Rasbian Wheezy build, I've 'Ninja-fied' my R2 Pi using

Code: Select all

wget -O - https://raw.github.com/ninjablocks/utilities/master/setup_scripts/rpi_setup.sh | sudo bash
Then I created an account at https://a.ninja.is/born
and registered my NinjaPi Block using the Pi Serial Number

So now I have a plain vanila Pi masquerading as a Ninja Block

Its generally geared for using GPIO attached stuff such as the Arduino but you can fake sensors using a curl call back to the Ninja Block web site - I have a simple button press sensor simulated in a executable script called 'sensortest' as follows:-

Code: Select all

#!/bin/bash
curl -H 'Content-Type: application/json' \
-H "X-Ninja-Token: `cat /etc/opt/ninja/token.conf`" \
-X 'POST' \
-i https://api.ninja.is/rest/v0/block/`cat /etc/opt/ninja/serial.conf`/data \
-d '{"G":0,"V":0,"D":5,"DA":"0"}'
In its simplest form that last value "DA":"0" can be got from any old script you like (such as reading anything attached to GPIO) ;)

And then bingo, up pops an event on the Ninja Dashboard
Image
Note: that Block Id is no use anyone thinking of spoofing my NinjaPi as there's an internal token key that you can't see here :roll:

And Ninja allows you to then build rules to make things happen (send out an email an email in this case) but plenty of other options including webhooks, facebook, twitter etc
Image

I'll post more on here as I continue to play... ...allegedly there's a MakeyMakey module already so I should be able to set up a Text to my mobile when someone plucks a banana out of the fruit bowl :lol:
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

cdjaco
Posts: 18
Joined: Tue Aug 28, 2012 6:53 pm
Location: Colorado, United States

Re: Ninja Pi

Mon Feb 11, 2013 11:29 pm

Very cool! Thanks for sharing.

kurtdezhyrenze
Posts: 1
Joined: Thu Apr 18, 2013 3:32 am

Re: Ninja Pi

Thu Apr 18, 2013 4:04 am

Make your own...build new rules and go to what access you want.. https://a.ninja.is/born
and registered my NinjaPi Block using the Pi Serial Number... 8-) ;)

Consciousness is much more than the thorn, it is the black jack knife in the flesh.
Last edited by kurtdezhyrenze on Fri Apr 26, 2013 6:36 am, edited 2 times in total.

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Ninja Pi

Thu Apr 18, 2013 9:04 am

Pi ninja :D
dan3008 wrote:Pays your money, takes your choice

Return to “Automation, sensing and robotics”