This is the code:
var http = require('http');
var serialport =
require('/var/lib/cloud9/examples/node_modules/serialport');
var nmea = require('/var/lib/cloud9/examples/node_modules/nmea');
var fs = require('fs');
var port = new serialport('/dev/tty1', {
baudrate: 115200,
parser: serialport.parsers.readline('\r\n')});
var stream = fs.createWriteStream('/tmp/out');
stream.once('open', function(fd) {
port.on('data',function(data){
// Not every line of data results in a successful parse
if (nmea.parse(data)) {
var loc = nmea.parse(data);
} else return;
// Match first NMEA GSV string
if (loc.type === 'satellite-list-partial') {
if (loc.msgNum === 1) {
stream.write("satsInView: " + loc.satsInView + '\n');
}
var ids = '';
for (var i=0; i < loc.satellites.length; i++) {
ids += loc.satellites[i].id + ',';
}ut
stream.write("Sats:" + ids + '\n');
}
// Match NMEA GGA string
if (loc.type === 'fix') {
stream.write(loc.latPole + loc.lat + " " + loc.lonPole +
loc.lon + '\n');
// Convert ddmm.mmmm to degrees decimal
var deg = loc.lat.toString().slice(0,2);
var min = loc.lat.toString().slice(2)/60;
var d = parseFloat(deg) + parseFloat(min);
// Convert dddmm.mmmm to degrees decimal
var deg = loc.lon.toString().slice(0,3);
var min = loc.lon.toString().slice(3)/60;
var e = parseFloat(deg) + parseFloat(min);
stream.write(d.toFixed(4) + ", -" + e.toFixed(4) + "\n");
}
});
});
On Thursday, August 18, 2016 at 8:08:12 PM UTC-4, Chintan Pathak wrote:
>
> This is not enough information to answer your question.
>
> What is the source of the js file ? If possible share its contents.
>
> JS can run on server as well as client. If you plan to run it on BBB with
> an output of Debugger listen... its most probably a serverside (NodeJS)
> file. How are you running it through Cloud9 ? Describe your steps, maybe
> attach screenshot. What output are you expecting ?
>
> On Thursday, August 18, 2016 at 6:53:41 AM UTC-7, [email protected] wrote:
>>
>> I have been trying to run a JavaScript file on the BeagleBone Black
>> (Cayenne radar module) and I keep getting the message
>>
>> Debugger Listening on Port 15454
>>
>> when I run the js file on the cloud9 ide, it doesn't seem to be doing
>> anything.
>>
>> Anyone have any ideas on how to fix this?
>>
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/8eb4314c-0d99-4219-9091-e0f31773ec2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.