Closed paultanner closed 6 years ago
This is not what it appears to be. The problem is caused by trying to use old versions of git, npm and node. As the code uses import, it seems that babel is also required. Still trying to get the server up to the latest versions of these. It would be useful to mention this in the readme and also link to the necessary update procedure.
ok. got a babel installation with advice from here
https://www.codementor.io/iykyvic/writing-your-nodejs-apps-using-es6-6dh0edw2o
now trying to get a fresh copy of the ttn library
npm install ttn
+ ttn@2.3.1
updated 1 package and audited 2686 packages in 9.384s found 2 moderate severity vulnerabilities run
npm audit fixto fix them, or
npm auditfor details up to date in 3.9s fixed 0 of 2 vulnerabilities in 2686 scanned packages 2 vulnerabilities required manual review and could not be updated
then ran npm audit fix same message returned no log file generated in this directory.
any suggestions?
Thx. Paul
These issues do not seem related to the ttn
package.
You are using an ancient version of node and NPM, I guess your issues are related to that. There are current packages available.
Your last comments seems to indicate that ttn was installed successfully:
updated 1 package
Sadly I don't know how I fixed it as I got interrupted. Certainly I ran npm audit fix multiple times.
The I hit this
Error: 7 PERMISSION_DENIED: permission denied: No "settings" rights to Application
but this only applies when I use application(appID, accessKey)
which I don't need at the moment.
Looking at this
https://www.thethingsnetwork.org/docs/network/account/authentication.html
I see that my server does not have permission to access the application that I set up in the TTN console.
OK. But it's not clear how to fix that.
The accessKeys are the same for my device and its application. Pasted straight from the TTN console.
code:
const appID = 'test_with_ti_shield2';
const accessKey = 'ttn-account-v2.etcetcetc';
// discover handler and open mqtt connection
data(appID, accessKey)
.then(function (client) {
client.on("uplink", function (devID, payload) {
console.log("Received uplink from ", devID)
console.log(payload)
})
})
.catch(function (err) {
console.error(err)
process.exit(1)
})
// discover handler and open application manager client
application(appID, accessKey)
.then(function (client) {
return client.get()
})
.then(function (app) {
console.log("Got app", app)
})
.catch(function (err) {
console.error(err)
process.exit(1)
})
console.log("starting ttn server");
Does the access key have the settings
right, as the error message indicates?
Presumably not. I checked the settings tabs for device and application and can see nothing relating to "permissions". Can you point me to the relevant setting that may be causing the issue pls?
BTW. As mentioned before, I can access the device OK but not the application. This implies that I have correctly pasted the accessKey from the TTN console.
Right, please check that the key you use has the settings
right too, not just devices
. You can manage keys under Settings.
I do not get a screen like that. Here's mine.
Click generate new access key and tick the right boxes.
The screenshot comes from the bottom of the application page by the way.
Ok Thx @johanstokking So the issue was that I did not know that another access key could be needed. I think the error message could be better:
No "settings" rights to Application
.. could instead say:
The accessKey you are using does not have rights to access the Application. You may need to generate another accessKey.
I originally did this install many months ago and want to reinstall the latest version. Is there a better way to install? this is what I get: