This weekend I’ve built a web terminal that can be used to query any spark core from the web.
Here is how it works:
- define a pubicly callable function in the Spark Cloud (ie.
Spark.function( "moistLevel", moistLevel ); )
- Go to the web terminal and fill in the credentials of your core
- Type in the function in the terminal you want to query (ie.
moistLevel( )) and the terminal will reply with the return value of the function. You can also pass variables (ie.
write( D1,HIGH ))
It only has been tested in Chrome (+ mobile) so it might behave a bit quirky since it’s been hacked together just to get the job done. I don’t have an SSL certificate, so your credentials are being passed to my server unencrypted, keep that in mind when using this
It’s written in PHP (bit of an odd choice) and you can download the source code on the GitHub repository https://github.com/pascalculator/sparkio-terminal if you want to run your local version.