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

Empty reply from server #92

Open
IoTopenTech opened this issue Feb 9, 2020 · 4 comments
Open

Empty reply from server #92

IoTopenTech opened this issue Feb 9, 2020 · 4 comments

Comments

@IoTopenTech
Copy link

IoTopenTech commented Feb 9, 2020

Hi,
I have installed this agent using the recommeded docker-compose.yml.

It seems to be installed properly:

imagen

But if I issue this command:
curl -v http://localhost:4061/iot/about

The result is:

imagen

How could I solve this.
Kind regards

@IoTopenTech
Copy link
Author

After updating node and npm to the latest versions, and replacing the docker-compose.yml with this one (https://stackoverflow.com/questions/57944790/fiware-ttn-iot-agent) it is working properly.
`version: "3.1"

services:
iot-agent:
image: fiware/iotagent-lorawan:1.2.2
hostname: iot-agent
container_name: fiware-iot-agent
depends_on:
- mongo-db
expose:
- "4041"
ports:
- "4041:4041"
environment:
- "IOTA_CB_HOST=orion"
- "IOTA_CB_PORT=1026"
- "IOTA_NORTH_PORT=4041"
- "IOTA_REGISTRY_TYPE=mongodb"
- "IOTA_MONGO_HOST=mongo-db"
- "IOTA_MONGO_PORT=27017"
- "IOTA_MONGO_DB=iotagent-lorawan"
- "IOTA_PROVIDER_URL=http://iot-agent:4041"
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent

mongo-db:
    image: mongo:3.6
    hostname: mongo-db
    container_name: db-mongo
    expose:
        - "27017"
    ports:
        - "27017:27017"
    command: --bind_ip_all --smallfiles
    volumes:
        - mongo-db:/data

orion:
    image: fiware/orion
    hostname: orion
    container_name: fiware-orion
    depends_on:
        - mongo-db
    expose:
        - "1026"
    ports:
        - "1026:1026"
    command: -dbhost mongo-db

volumes:
mongo-db: ~`

@jfernandz
Copy link

I'm having the same issue and I guess @IoTopenTech wants to mean this one docker-compose.yml file

version: "3.1"

services:
    iot-agent:
        image: fiware/iotagent-lorawan:1.2.2
        hostname: iot-agent
        container_name: fiware-iot-agent
        depends_on:
            - mongo-db
        expose:
            - "4041"
        ports:
            - "4041:4041"
        environment:
            - "IOTA_CB_HOST=orion"
            - "IOTA_CB_PORT=1026"
            - "IOTA_NORTH_PORT=4041"
            - "IOTA_REGISTRY_TYPE=mongodb"
            - "IOTA_MONGO_HOST=mongo-db"
            - "IOTA_MONGO_PORT=27017"
            - "IOTA_MONGO_DB=iotagent-lorawan"
            - "IOTA_PROVIDER_URL=http://iot-agent:4041"
            - IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent

    mongo-db:
        image: mongo:3.6
        hostname: mongo-db
        container_name: db-mongo
        expose:
            - "27017"
        ports:
            - "27017:27017"
        command: --bind_ip_all --smallfiles
        volumes:
            - mongo-db:/data

    orion:
        image: fiware/orion
        hostname: orion
        container_name: fiware-orion
        depends_on:
            - mongo-db
        expose:
            - "1026"
        ports:
            - "1026:1026"
        command: -dbhost mongo-db

volumes:
    mongo-db: ~

Just to clarify. I'm going to try it.

@jfernandz
Copy link

jfernandz commented May 23, 2020

Well, I would like to remark a few things.

  • This docu seems apparently to be deprecated; I mean, I was in fact following that docu, but when you use the suggested docker-compose.yml file inside docker folder you are probably going to get that curl: (52) Empty response from server or as in my case curl: (56) Recv failure: Connection reset by peer

  • To solve this, I've tried the docker-compose.yml which this answer in StackOverflow suggests.

  • I've noticed a variation of this alternative docker-compose.yml is also suggested in the README.md inside the docker folder of the repo itself. However, is still nonfunctional due few typos/indentation issues. Also the docker-compose.yml included in the repo was not updated properly. Neither the mentioned docu.

  • Once you've deployed the docker containers using that alternative docker-compose.yml, you have to be aware this new docker-compose.yml exposes a different port, 4041 instead 4061 (as the docu suggests). So your curl request has to take this into account: curl -v http://localhost:4041/iot/about then curl should be able to give you the right response: {"libVersion":"2.10.0-next","port":"4041","baseRoot":"/"}. You also can modify the container exposed ports in the docker-compose.yml and keep curl requesting to http://localhost:4061/iot/about; this is totally up to you.

In conclusion,

Finally, this is my suggestion for a newer and fixed docker-compose.yml

version: "3.1"                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                
services:                                                                                                                                                                                                                                                                       
    iot-agent:                                                                                                                                                                                                                                                                  
        image: ioeari/iotagent-lora                                                                                                                                                                                                                                             
        hostname: iot-agent                                                                                                                                                                                                                                                     
        container_name: fiware-iot-agent      
        depends_on:                                    
            - mongo-db                                 
        expose:                                                     
            - "4061"                                                
        ports:                                                      
            - "4061:4061"                                           
        environment:                                                
            - "IOTA_CB_HOST=orion"                                  
            - "IOTA_CB_PORT=1026"                                   
            - "IOTA_NORTH_PORT=4061"                                
            - "IOTA_REGISTRY_TYPE=mongodb"                          
            - "IOTA_MONGO_HOST=mongo-db"                            
            - "IOTA_MONGO_PORT=27017"                               
            - "IOTA_MONGO_DB=iotagent-lorawan"                      
            - "IOTA_PROVIDER_URL=http://iot-agent:4061"             
                                                                    
    mongo-db:             
        image: mongo:3.6  
        hostname: mongo-db
        container_name: db-mongo
        ports:
            - "27017:27017"
        command: --bind_ip_all --smallfiles
        volumes:
            - mongo-db:/data

    orion:
        image: fiware/orion
        hostname: orion
        container_name: fiware-orion
        depends_on:
            - mongo-db
        expose:
            - "1026"
        ports:
            - "1026:1026"
        command: -dbhost mongo-db

volumes:
    mongo-db: ~

@thilko
Copy link

thilko commented Sep 3, 2020

I had the same issue. Any progress on updating the doc?

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

3 participants