i am a fiware user and i have created an iot agent on an ubuntu 14.04 empty vm and when i send a create service or a device registration request , i get an error. And i've made sure that the ports listen properly and i've also allowed tcp connection on the port 4061. and also get an error whenever i send the request .
here's the create service request
(curl -H 'content-type: application/json' -H 'fiware-service: bla770' -H 'fiware-servicepath: /howtobla770' -X POST 'http://217.172.12.243:4061/iot/services' -d #- ) << EOF
{
"services": [
{
"apikey": "api70",
"token": "token",
"cbroker": "http://147.27.60.58:1026",
"resource": "/iot/d",
"entity_type": "thing"
}
]
}
EOF
and this is the error which i get .
connect to 217.172.12.243 port 4061 failed: Connection timed out
* Failed to connect to 217.172.12.243 port 4061: Connection timed out
Although i have allowed the port 4061 through the firewall by the command
sudo ufw allow 4061
sudo ufw allow 4061
So, what could be done to solve this error please ?
i think you can solve this by deploy preconfigured image like Cepheus and it will allow you to use port8080 and 8081 and you can configure your iot agent to listen by change in config.js file
Related
I have a home server on my Raspberry Pi with a registered domain (say: mysite.com). I would like to use a subdomain to point to my MQTT broker running on the Pi so that I can use mqtt.mysite.com from outside my house.
In order to do that I have added a CNAME record to my DNS and verified that I can ping it.
However, I am not able to use the domain with MQTT. I am using mosquitto, the daemon is running on the Pi on the default port 1883. The port is open on the firewall via ufw allow 1883.
If I use the private IP address everything works fine:
mosquitto_pub -h 192.168.1.80 -p 1883 -t home/bedroom/temp -m 23.4
However if I use the subdomain
mosquitto_pub -h mqtt.mysite.com -p 1883 -t home/bedroom/temp -m 23.4
I get a Connection refused error.
Am I missing something?
I have at Fiware Lab a virtual machine deployed with Context Broker + Wilma Pep proxy. PEP is configured with https enabled at config.js config.https = { enabled =true...}
Executing the command below I can see "https" process related to the node.js pep process
[centos#orion ~]$ sudo netstat -t -l -p
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:https *:* LISTEN 1492/node
But when I try to execute the following curl command I get the following message
curl -v -i -X GET https://public-ip-at-fiware-lab:443/v2/entities -H "X-Auth-Token: auth-token-from-idm-keyrock"
curl: (35) Unknown SSL protocol error in connection to public-ip-at-fiware-lab:443
What is missing in the configuration of PEP?
How can I debug what is happening in fiware-lab machine?
How can I test the SSL with curl command?
Any tip is wellcome!
Many thanks in advance
Finally I created a new certificate for the machine and the curl command works.
i am a fiware user and i have created an iot agent on an ubuntu 14.04 empty vm and when i send a create service or a device registration request , i get an error. And i've made sure that the ports listen properly and i've also allowed tcp connection on the port 4061. and also get an error whenever i send the reuest .
here's the create service request
(curl -H 'content-type: application/json' -H 'fiware-service: bla770' -H 'fiware-servicepath: /howtobla770' -X POST 'http://217.172.12.243:4061/iot/services' -d #- ) << EOF
{
"services": [
{
"apikey": "api70",
"token": "token",
"cbroker": "http://147.27.60.58:1026",
"resource": "/iot/d",
"entity_type": "thing"
}
]
}
EOF
and this is the error which i get .
connect to 217.172.12.243 port 4061 failed: Connection timed out
* Failed to connect to 217.172.12.243 port 4061: Connection timed out
Although i have allowed the port 4061 through the firewall by the command
sudo ufw allow 4061
It is necessary adding a security rule opening port 4061 in your Security Groups (cloud portal).
I'm using IDAS. I can register a service through an IoT Agent, but if I try to do it using the iota manager, seems that I can't due to an issue with the protocols. When I try to register it:
curl -X POST 172.21.0.23:8091/iot/services \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: sanitysrvm" \
-H "Fiware-ServicePath: /sanitysspath" \
-d '{"services": [{ "apikey": "apikey", "token": "token", "cbroker": "http://127.0.0.1:1026", "entity_type": "thingsrv", "protocol": ["PDI-IoTA-UltraLight"] }]}'
I get this response:
HTTP/1.1 400 Bad Request
Connection: close
Host: 172.21.0.23:8091
Content-Length: 94
Content-Type: application/json
{"reason":"The request is not well formed","details":"No exists protocol PDI-IoTA-UltraLight"}
I have checked the protocols:
http://172.21.0.23:8091/iot/protocols
But seems that there are none:
{ "count": 0,"protocols": []}
Is this issue related, as it seems, with the protocol?
Can be that the protocol wan't correctly defined when installing the IDAS?
How should I define the protocols?
Thanks!
I think you just installed IDAS iot-agent-base-xxxxxxx, and not the iot-agent-ul-xxxxxxx rpm package
I have a running installation and I installed it as follows (you may change the DGIT_VERSION and DGIT_COMMIT values in cmake command to build a newer version if possible):
git clone https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus.git
pwd
cd fiware....
mkdir -p build/Release
cd build/Release
cmake -DGIT_VERSION=20527 -DGIT_COMMIT=217023407f25ed258043cfc00a46b6c05fb0b52c -DMQTT=ON -DCMAKE_BUILD_TYPE=Release ../../
make install
make package
The packages will be created in pack/Linux/RPM/
rpm -i iot-agent-base-xxxxxxx
rpm -i iot-agent-ul-xxxxxx
IDAS will be installed in /usr/local/iot
Hope this helps you.
I setup HHVM inside Docker on cPanel server with this configuration:
http://wiki.mikejung.biz/HHVM
Section - "How to run HHVM in a Ubuntu docker container on cPanel"
My Docker configuration is:
"Name": "/sad_wozniak",
"NetworkSettings": {
"Bridge": "docker0",
"Gateway": "172.17.42.1",
"IPAddress": "172.17.0.13",
"IPPrefixLen": 16,
"MacAddress": "02:42:ac:11:00:0d",
"PortMapping": null,
"Ports": {
"9000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "9000"
and on VirtualHost of domain i add:
<IfModule mod_proxy_fcgi.c>
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://172.17.0.13:9000/home/username/public_html/
</IfModule>
I check that it works with curl:
HTTP/1.1 200 OK
Date: Sat, 04 Apr 2015 22:34:52 GMT
Server: Apache
X-Powered-By: HHVM/3.6.1
X-Mod-Pagespeed: 1.9.32.3-4448
Cache-Control: max-age=0, no-cache
Content-Length: 17
Content-Type: text/html; charset=utf-8
But i get MySQL error:
Error establishing a database connection
Outside Docker MySQL server has permissions to use any remote connection. I'd like to use "localhost" on server to MySQL server.
MySQL run on:
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 498 19250361 3206/mysqld
How to connect HHVM with this MySQL which is outside the Docker?
As documentation states, you need to add host address as alias to container
http://docs.docker.com/reference/commandline/cli/#adding-entries-to-a-container-hosts-file
Note: Sometimes you need to connect to the Docker host, which means getting the IP address of the host. You can use the following shell commands to simplify this process:
$ alias hostip="ip route show 0.0.0.0/0 | grep -Eo 'via \S+' | awk '{ print \$2 }'"
$ docker run --add-host=docker:$(hostip) --rm -it debian
After that you should be able to connect to host MySQL using address docker:3306 from container.