TTN API connection issue

I’ve create NodeJS API based on SDK, but i stumbled over strange issue – assume it’s kind of network problem. I’ve tested the code on my local machine with „home” internet connection and all worked as expected. But when i’ve deployed my code to CentOS 7 server with NodeJS and PM2 my API can’t connect to discovery.thethingsnetwork.org server on port 1900. I pretty sure that code-wise my API is free from bugs (i’ve testet it also on my friend’s server – also CentOS but different ISP – and it’s working. I can’t run it anywhere else than on the server where i have this issue – project requirements. I’ve checked all possibilities – firewall issue, selinux (which is disabled), port forwarding, NAT settings – every other service on the „issue casing” ISP like DNS, MAIL, www are working.

I’ve contacted my ISP and they said that everything is opend, nothing should be blocked. Below my nmap output:

nmap

Starting Nmap 6.40 ( http://nmap.org ) at 2019-01-17 18:44 CET

Nmap scan report for 52.178.215.58

Host is up (0.055s latency).

PORT STATE SERVICE

1900/tcp open upnp

Nmap done: 1 IP address (1 host up) scanned in 0.21 second

This leads to conclusion that there is nothing wrong network-wise, but the issue somehow exists.

Mayby my IP is on some kind of blacklist which You’re blocking?

Below „testing” basic code where output „hangs” on console.log("Starting connection to TTN with key: " + accessKey);

"use strict";

var express = require("express");

var bodyParser = require("body-parser");

var ttn = require("ttn");

var appID = "waga1-test";

var accessKey = "MY TTN KEY – checked couple of times, recreated also 2 or 3 times";

var app = express();

var appPort = 24123; // checked mupltiple ports between 10k-25k

console.log("Prepparing the app"); // i can see this in the console

app.use(bodyParser.json());

app.use(bodyParser.urlencoded({ extended: true }));

app.use(function (req, res, next) {

res.setHeader('Access-Control-Allow-Origin', '*');

res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');

res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type');

res.setHeader('Access-Control-Allow-Credentials', true);

next();

});

console.log("Starting connection to TTN with key: " + accessKey); // i can see this in the console, but nothing below

ttn.application(appID, accessKey)

.then(function (res) {

require('./Router/routes')(app, res);

app.listen(appPort, function () {

console.log("App launched on port: " + appPort);

});

})

.catch(function (error) {

console.error("Error", error);

process.exit(1);

});

I would appreciate any help from Your site because i tried everywhere. I have also created gitbub issue but wasn’t too helpfull.

Nobody? :frowning:

Hi Ragry, finally do you solve the issue?
I have no experience on Nodered.js but studing about this with cloud.ibm bluemix
[661]