IoT Broker through Internal Network
Answer
5/8/17 5:30 PM

Hello! I am currently working inside Bosch

 

I'd like to connect some XDKs, to the Example MQTT Broker (Iot Suite), through the company's Internal Network, since I was told it was possible to do so through the Companys Internal Network

 

I was told the internal IP of the broker, so I made the proper ACL Change requests of the IP addresses of the XDKs I wanted to connect, with the Port 1883

 

Despite the changes, I keep getting a Connection Refused from the broker, even though I have verified that the device is connected to the network.

 

Could anyone help me? Thanks!

 

Thanks!

0 (0 Votes)
RE: IoT Broker through Internal Network
Answer
5/9/17 4:39 PM as a reply to Emmanuel Martinez.

Hello Emmanuel,

I analyzed the code of the XDK Portal demo more in detail and would like to clarify some things first, before I make any solving conclusions.

Could you please explain in detail, how you received the connection refused error from the Bosch MQTT broker?  

Did you implement a Wi-Fi Enterprise solution extending the existing demo?
Due to my knowledge most of the internal hotspots are operating in WPA2-Enterprise mode.

The XDK Portal application code covers no error handling, if the connection to the Bosch MQTT broker could not be established.
Could you please explain what kind of error handling you implemented to cover it?

Additionally I would like to know how you verified that the XDK is able connect to the Bosch internal Wi-Fi network and if you were able to connect to the public URL of the MQTT Broker.

Kind regards,
Franjo

0 (0 Votes)
RE: IoT Broker through Internal Network
Answer
5/9/17 7:37 PM as a reply to Franjo Stjepandic.

Hello Franjo,

I made several code changes to the XDK Portal Demo

 

Yes, I adapted the Demo to be able to communicate over an Enterprise WPA Network (As told in the Enterprise-Wifi Demo). I got the proper Network credentials beforehand. Due the nature of the project, I am only allowed to use the Internal Network, so I got no way to test the public URL of the broker this way.

 

I assigned some static IP Addresses to the XDKs (the ones I defined at the ACL Change), and printed on console some debugging lines, which indicated a proper network connection. Besides, I ran some pings to the IP addresses of the XDKs and the connections seemed ok.

 

I modified the code so it could pass the socket address value directly (the IP Address of the Broker), rather than using the conversion method implemented at the demo (sl_NetAppDnsGetHostByName). I kept the Port as the same.

 

After more debugging, I figured that the connection problem was at the socket connection (sl_Connect), at the same file. I am getting a return code -111, which is a Connection Refused, as far as I Understand (defined at Socket.h)

 

Hope I explained clear enough my solution so far, thanks for your time

 

Best Regards

 

 

0 (0 Votes)
RE: IoT Broker through Internal Network
Answer
5/10/17 4:00 PM as a reply to Emmanuel Martinez.

Hello Emmanuel,

firstly, it's great to hear that you managed to setup the connection to the Enterprise WPA Network on your XDK. Additionally, everything you do seems to be in order. Unfortunately, we do not think we can really help you with this issue because of that.

The Connection Refused error indicates one of two things:


1. Your XDK finds something, but cannot connect due to firewalls blocking the request. As such, the TCP connection attempt gets dropped on the way, resulting on Connection Refused.

2. Your XDK finds something at the destination IP-address. But whatever the device at the destination is, doesn't listen on the port (1883) you specified. I.e. there is not process or programm that expects a TCP connection request on the Port 1883. That can mean two things: The Broker is not currently running at the IP-address, or it is the wrong IP-address entirely.

In both of these cases, you should check again if the IP-address was the correct one. If everything is correct, I suggest that you consult your system admins. If they determine that it cannot possibly be one of those two reasons, feel free to come back to us, and we will further investigate this issue.

Please tell me if this is helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)