Socket error: [Errno 111] Connection refused


Hi, I have a problem when I send a message from my app (in nodejs). I send the message via “hologram-node” module or “request”. My problem is that in the Hologram console the data message say “Socket error: [Errno 111] Connection refused” and the data sent is “Test Message from App”.

Here is my methods:

// Message from hologram-node module
function sendMessage() {
    var HologramAPI = Hologram("my_api_ke", { orgid: "my_orgid" });
    HologramAPI.Device.sendData(["174220"], "Test Message from App", "80", "TCP").then((resp) => {

// Message from request module
function sendMessagerequest() {
     var request = require('request');
         method: 'POST',
         url: '',
         headers: {
             'Content-Type': 'application/json'
         body: "{  \"deviceids\": [174220],  \"protocol\": \"TCP\",  \"port\": 80,  \"encrypted\": false,  \"data\": \"Test Message from App\"}"
     }, function (error, response, body) {
         console.log('Status:', response.statusCode);
         console.log('Headers:', JSON.stringify(response.headers));
         console.log('Response:', body);

I need that the message in console says “Test Message from App”.
Someone can help my? Thanks


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.