technobly / SparkCore-WebApp

An amazing web based interface for your Spark Core. It uses the power of Node.js, Express, Jade, Stylus for the backend, jQuery and AngularJS for the frontend, and the Spark API to let you remote control your own Spark Core. Simply log into your device, and take control... from anywhere in the world! Fork us and make your own!
http://sparkcore.herokuapp.com
MIT License
35 stars 21 forks source link

Install File Missing #1

Open ghost opened 10 years ago

ghost commented 10 years ago

Hi,

I was trying to get a local install of SparkCore-WebApp.

I followed your instructions. Node.js is installed, and the Sparkcore-WebApp is cloned.

Now within the cloned directory, if I do node install, I get:

module.js:340 throw err; ^ Error: Cannot find module 'C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\install' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

Any Help?

Vishal.

cybear commented 10 years ago

Please type npm install to install the dependencies.

ghost commented 10 years ago

Dear Cybear, Thanks for the quick response.

After doing npm install. When I launch node spark.js, I get the following error in the Browser --

Express 500 Error: C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\views\home.jade:196 194| script 195| $('document').ready(function() { > 196| setTimeout(function(){ 197| $('div#wrapper').parent().removeClass(); 198| $('div#footer').parent().removeClass(); 199| },1000); unexpected token "indent" 194| script 195| $('document').ready(function() {

196| setTimeout(function(){ 197| $('div#wrapper').parent().removeClass(); 198| $('div#footer').parent().removeClass(); 199| },1000); unexpected token "indent" at Parser.parseExpr (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:252:15) at Parser.block (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:706:25) at Parser.tag (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:815:24) at Parser.parseTag (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:736:17) at Parser.parseExpr (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:211:21) at Parser.block (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:706:25) at Parser.parseBlock (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:512:14) at Parser.parseExpr (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:215:21) at Parser.parse (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\parser.js:122:25) at parse (C:\Documents and Settings\Username\Desktop\SparkCore-WebApp-master\SparkCore-WebApp-master\node_modules\jade\lib\jade.js:95:21)

technobly commented 10 years ago

Thanks @cybear for that typo catch. 'npm install' is correct.

@gdcvishal if you didn't get any Python errors when you ran 'npm install' everything was probably installed and compiled correctly. There were some Jade syntax errors as Jade has evolved a bit since I wrote this. I figured out the problems and pushed a few changes to the repo, check the last two commits.

Keep in mind this was written before Spark used Device ID and Access Token, so you'll have to figure out how to add that... and if you do please submit a pull request ;-)

ghost commented 10 years ago

@technobly thanks for such a quick fix.

I am new to the spark world and the webapp. It does lauch now.

A stupid query:

Is the Webapp just a frontend, or does it actually allow one to connect to the spark core, like the Tinker App. So when I do a High/Low on D0, will it actually be possible for the WebApp to control the D0 pin?

Thanks!

technobly commented 10 years ago

Yep, it's just a front end, served up by a Node.js server, that does actually allow you to connect to the Spark Core just like tinker. But only for Digital Outputs in it's current state.

I'm thinking if this one sounds too complicated to you, you should probably check out my https://github.com/technobly/Simple-Spark-Core-Controller

and also my https://github.com/technobly/Remote-Spark

Which do a similar thing, albeit not as fancy. They do however work out of the box with no modification needed other than supplying a DEVICE_ID and ACCESS_TOKEN.

ghost commented 10 years ago

Thanks!! I will try the simple apps you pointed out. Since I am just staring to tinker with it, I just want a webapp link to the core's digital io's at present to be grounded onto the platform.