Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError when running ttn-aws-iot #28

Open
tonkatsu7 opened this issue Jun 27, 2017 · 0 comments
Open

SyntaxError when running ttn-aws-iot #28

tonkatsu7 opened this issue Jun 27, 2017 · 0 comments

Comments

@tonkatsu7
Copy link

Using the sample script from https://www.npmjs.com/package/ttn-aws-iot

'use strict';
 
const ttnawsiot = require('ttn-aws-iot');
 
// Replace with your AppEUI and App Access Key 
const appEUI = '<insert AppEUI>';
const appAccessKey = '<insert App Access Key>';
 
// Replace with your certificates from AWS IoT 
const caCert = 'examples/keys/root-CA.crt';
const clientCert = 'examples/keys/cert.crt';
const privateKey = 'examples/keys/private.key';
const region = 'eu-west-1';
 
const bridge = new ttnawsiot.Bridge(appEUI, appAccessKey, caCert, clientCert, privateKey, region);
 
bridge.on('aws-connect', () => {
  console.log('AWS connected');
});
 
bridge.on('ttn-connect', () => {
  console.log('TTN connected');
});
 
bridge.on('error', err => {
  console.warn('Error', err);
});
 
bridge.on('uplink', data => {
  console.log('Uplink', data);
});

And specifying the correct AppEUI, AppKey and generating an appropriate key/pair and downloading AWS root-CA, when I run npm app.js i get...

[ec2-user@ip-172-31-12-65 ttn-aws-iot]$ node --harmony app.js

/home/ec2-user/ttn-aws-iot/app.js:17
bridge.on('aws-connect', () => {
                          ^
SyntaxError: Unexpected token )
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant