I have to apologize, it seems that all the problem was that I transferred the certificates as a text files, although they seemed to be complete I decided to transmit them again in a compressed file (gz) to the Omega2, then I unzipped them and re-executed the installation and now it worked , I was wrong the problem was not ports but the validity of the files: certificate.pem.crt and private.pem.key.
Virgilio Enrique Aray Arteaga
@Virgilio Enrique Aray Arteaga
Best posts made by Virgilio Enrique Aray Arteaga
Latest posts made by Virgilio Enrique Aray Arteaga
-
RE: mosquitto_pub -> Error: Connection refused
-
RE: mosquitto_pub -> Error: Connection refused
@cas said in mosquitto_pub -> Error: Connection refused:
But then again, shouldn't the communication be outbound from your O2 to amazon and not inbound to your O2?
Yes, the rule that I wrote in the firewall should allow the entry and exit traffic through port 8883.
-
RE: mosquitto_pub -> Error: Connection refused
Hello @cas
Thanks for answering, the tcp 8883 port is used by amazon web services to access its IoT implementation through the MQTT protocol.
I installed the Mosquitto MQTT tools on my Omega2 device.
I did this to emulate Paul Cousins' project:
"Connecting your Omega to AWS IoT with a Single Command"
I followed all the instructions carefully but when I run the mosquitto_sub or mosquito_pub commands with the appropriate parameters I get the answer
"Connection refused"
Studying a bit I see that this protocol uses port 8883 to communicate with the AWA server as well as WWW servers use port 80, based on what I have researched I assume the problem is that my Omega 2 has by default blocked the port 8883, I can not think of anything else.
-
RE: mosquitto_pub -> Error: Connection refused
Now that I know that port 8883 is closed (by the way port tcp 8883 is the one used by AWS IOT for MTTQ communication with AWS IOT) I have tried to open that port.
After searching the Internet on this topic I followed these actions.
cat / proc / sys / net / ipv4 / ip_local_port_range
32000 64000
echo 1024 65535> / proc / sys / net / ipv4 / ip_local_port_range
This instruction increases the number of available ports.
Then I edited the file "/ etc / config / firewall" and added the following rule
config rule
option name "Mosquito AWS IOT"
option src ''
option dest ''
option scr_port '8883'
option dest_port '8883'
option proto 'tcp'
option target 'ACCEPT'Then I wrote the command
/etc/init.d/firewall restart
Then I rebooted Omega2 to make sure the new rule was activated
reboot
Then I checked if the new rule is in the iptables
iptables -L | grep 8883
ACCEPT tcp - anywhere anywhere tcp spt: 8883 dpt: 8883 / *! Fw3: Mosquitto AWS IOW * /
So it seems that the matter is resolved but in trying to execute
#mosquitto_sub [required parameters]
i got
error: Conection RefusedWhat's wrong? I'd appreciate a technical support response.
-
RE: mosquitto_pub -> Error: Connection refused
I see that Onion's support is not very good, at least not with me.
Ok, I tried to solve this "conection refused" issue and try to solve something that I guess the Onion staff can answer in 1 minute if it mattered.
I had to put myself inside the LEDE
I share the following to help other users
Starting from the premise that the problem is that port 8883 is closed, I had to investigate the following.
NETSTAT
IPTABLES
FIREWALLIs port 8883 closed? How to know?
The recommendation is to try to connect with telnet with aws, but Omega2 does not have telnet, so from another computer on the same LAN I executed these commands:
~ $ telnet xxxxxxxxxxxxx.iot.us-east-1.amazonaws.com 8883
Trying 52.44.113.236 ...
Connected to dualstack.iotmoonraker-u-elb-1bkszq0bvnbyv-1001897703.us-east-1.elb.amazonaws.com.
Escape character is '^]'.
xxxxxxxxxxx.iot.us-east-1.amazonaws.com ^ [[A ^ [[B
Connection closed by foreign host.This means that my LAN has access to port 8883 in AWS, it's not my AP's problem.
Now from that same machine I executed this command:
~ $ nc -zv omega-xxxx.local 8883
nc: connect to omega-xxxx.local port 8883 (tcp) failed: Connection refusedNow from the Omega2 command line I tried this command
root @ Omega-xxxx: #nc localhost 8883
nc: cant connect to remote host (127.0.0.1): conection refusedSo yes, the port is closed in my Omega2......
-
mosquitto_pub -> Error: Connection refused
Hello, I carefully followed the instructions of Paul Cousins in his excellent article "Industrial Machine Monitor Update" but when I tried to execute the command mosquito_pub -t <necessary parameters> but I get the error "Connection refuse"
Any ideas to overcome this problem?
Thanks in advance
-
Omega 2 datetime sync
hi, maybe someone has an answer to my problem; I'm doing a project with OMEGA 2 + and an ARDUINO DOCK, since I need the arduino sketch to have the correct date-time it occurred to me to do a python routine to move the date-time via UART (/dev/ttyS1) from the OMEGA to ARDUINO DOCK and it works fine, I added the routine to the boot sequence using the file the /etc/rm.local but the date-time that it returns is incorrect, apparently it is the last time before turning off (reboot) the OMEGA, I also verified that connecting via SSH during the boot sequence of the OMEGA and executing date command several times the date command will give me at the beginning an incorrect date-time and after several seconds it will be synchronized with the network I suppose, any idea?