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

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
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
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
