Hi folk,
Just got my core recently & started digging - looks like fun.
I’ve gone through a few of the basic ‘hello world’ tests & so far so good.
What I would really want to do is have a customised mobile app control a custom build.
I’m really not much of an Android dev (working on getting my Python on), so I’m looking at MIT App Inventor as a solution to build some PoC app.
As such, I’ve started digging at the API docs. What’s “odd” is that is seems that all call happen via the internet & not directly with the node, meaning that my core needs to be always connected to be useful, whereas I plan on using it ‘off-line’ - or rather on an isolated network inaccessible from the 'net (almost air-gapped). Could this be correct?? Will this be addressed?
OK - accepting the above (for now) - I’m having a spot of trouble sending control signals from my App Inventor App to the node.
I send the following URL: (or something along these lines)
curl "https://api.spark.io/v1/devices/$CORE_ID/digitalwrite&?access_token=$TOKEN¶ms=D7,HIGH"
& get the following in response:
{
"cmd": "VarReturn",
"name": "digitalwrite&",
"TEMPORARY_allTypes": {
"string": " \u0000P\u0000",
"uint32": $REDACTED,
"number": $REDACTED,
"double": null,
"float": 1.0868491504456741e-19,
"raw": " \u0000P\u0000"
},
"result": " \u0000P\u0000",
"coreInfo": {
"last_app": "",
"last_heard": "2014-01-06T11:20:59.119Z",
"connected": true,
"deviceID": "$deviceID"
}
}
Looks like the connection goes through, but nothing happens.
I’m still fidling with App Inventor, so if anyone else has had luck controlling the device from there, use/tips would be appreciated, otherwise if anyone else could kindly point me in the right direction, that would be greatly appreciated.