POST
|
I recommend that you get an IDE if you don't have one. I recommend WebStorm, but it's only free for a month, then you'll have to pay. Some alternatives are Visual Studio, Aptana, search this forum for others next you'll go on your command line and navigate to your project directory, mine is C:\projects\tk106\server\src the next step will walk you through creating your package.json file, it will ask you want you want to call your application file, it defaults to index.js, I call mine server.js, so anywhere you see server.js below, replace it with the name you give your file type 'npm init' This will help you create your package.json file which is the package manager for your file. It will ask you a few questions, then create the file. I believe you said you installed tk102 already, if so, skip this step: Once the file is created, type 'npm install tk102 --save' the --save option will be sure to add the dependency into your package.json file My personal preference is to install nodemon as well, so that my server auto restarts as I make changes I do that by typing 'npm install nodemon --save-dev' This will add nodeman as a dependency to your development environment inside your package.json file if you installed nodemon do the following: Now open your package.json file remove the line "main": "server.js", add this line in the scripts object above test "start": "NODE_ENV=local ./node_modules/.bin/nodemon server.js", Depending on what you stated your default node file would be, create that file. I created a file named server.js Open your server.js file and follow the example from the tk106 repo: type the following: ------------------------------------------------------------------------------------ 'use strict'; var server = require('tk102'); server.createServer({ port: 1337 }); server.on( 'listening', function( listen ) { console.log('listening on port: ' + listen.port); }); server.on( 'data', function( raw ) { console.log( 'Incoming data: '+ raw ) }); server.on( 'track', function( gps ) { console.log( gps ) }); ------------------------------------------------------------------------------------ at this point, you should be able connect your device to your server. if things don't work, then you'll have to dig into the tk102 server source code and update it. it's located in node_modules\tk102\tk102.js if you attach the manual, I may be able to help further as any errors will probably be in the parser. Hopefully you get something in the console.log( 'Incoming data: '+ raw ) statement let me know how that goes. sometimes you may have to stop node from running, in that case I run this on my mac lsof -n -i :1337 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 1887 alexbostic 14u IPv4 0x7e6cfdb8acf18bf5 0t0 TCP *:hbci (LISTEN) sudo kill -9 1887 lsof -n -i :1337 npm start
... View more
02-15-2015
11:20 AM
|
0
|
1
|
2067
|
POST
|
I would still install NodeJS-TK102. From your command line navigate to the directory you want to operate from (you may have to create it) For prototypes, I put things in my c>projects directory, so I would create a folder under C:\projects\ called tk102, then I create a folder under that called server. So mine would be C:\projects\tk102\server once you are in that directory run this command taken from the github repo you posted npm install tk102 That will install the NodeJS-TK102 library for you. next, you'll want to prepare your device for transponding your coords, do you have instructions on that, or the manual you can link to? after that you would create a node project, pull in the library and interact with it's api. I can post about that later
... View more
02-14-2015
12:04 PM
|
0
|
3
|
2067
|
POST
|
I'm not a GPS tracker guy, so take that I don't think the differences will be major with a grain of salt. To get started with Node in a windows environment, I would recommend downloading Chocolatey Gallery and using that as you windows package manager. then from your command line you can do this C:\> choco install nodejs.install I suppose you'll need to have your device connected to your machine so that it can communicate to your open port. If connecting your machine to your device is not an option, I would suggest using OpenShift to get things up and going on the open web for free. Sign up for an account and follow these instructions OpenShift Online for Windows | OpenShift Developers Once you get Node setup on your machine or OpenShift, come back and we'll go to the next step. If you need help getting set up, let me know
... View more
02-14-2015
10:22 AM
|
1
|
5
|
2067
|
POST
|
Yes, but you need a MAC to get it all set up Enable Remote Debugging with Safari Web Inspector in iOS 6 | Modus Create I clicked reply too early in my first post. Before I use remote debugging, I use the emulator in Chrome to get a sense how it will look on various devices Mobile emulation - Google Chrome Then I use remote debugging if something is not working as expected or css is not doing its job Hope they help
... View more
07-25-2014
01:56 PM
|
1
|
0
|
607
|
Title | Kudos | Posted |
---|---|---|
1 | 07-25-2014 01:56 PM | |
1 | 02-14-2015 10:22 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|