ARMmbed / mbed-client-linux-example

DEPRECATED: mbed Client example program for Linux platform
https://cloud.mbed.com/docs/current
Other
2 stars 0 forks source link

M2MInterface::NetworkError #24

Closed talkjoey closed 8 years ago

talkjoey commented 8 years ago

Hi, I have been trying to run this example but I am running in to " M2MInterface::NetworkError". I have a 64 bit Ubuntu VM on windows 7. I have opened ports 5684 and 5683 on VM as well windows m/c.

This is the output I see

$ ./mbed-client-linux-example 
Endpoint Name : c472d941-3ef6-4cd8-9a15-25458a7ae8c5

Interface created
register object created
Device object created !!
Registering endpoint

Error occured  : M2MInterface::NetworkError

This is from wireshark:

445 34.753495000    10.**.**.** 132.245.28.178  SSL 215 Client Hello
446 34.778695000    132.245.28.178  10.**.**.** TCP 60  https > 57410 [ACK] Seq=1 Ack=162 Win=27728 Len=0
448 34.785603000    132.245.28.178  10.**.**.** TLSv1   2598    Server Hello, Certificate, Server Key Exchange, Server Hello Done
450 34.797147000    10.**.**.** 132.245.28.178  TLSv1   220 Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
...
...
This is the last one I see.
463 35.247374000    10.**.**.** 132.245.28.178  TCP 60  57410 > https [ACK] Seq=1596 Ack=5184 Win=65280 Len=0

What am I missing ?

ciarmcom commented 8 years ago

ARM Internal Ref: IOTCLT-521

yogpan01 commented 8 years ago

Hi, this looks like your request is failing during DTLS handshake phase. Which server are you trying to connect against ? Also, have you updated your Server and client certificates as mentioned in the README instructions ?

talkjoey commented 8 years ago

I have updated security.h file with the contents from security credentials from https://connector.mbed.com/#credentials I am trying to connect to server here : https://connector.mbed.com/.

Thanks

yogpan01 commented 8 years ago

Hi, I just tried the latest example now with my Ubuntu machine and it works fine. Can you please try again . My coap address in main.cpp is "coap://api.connector.mbed.com:5684"

talkjoey commented 8 years ago

Hi, I have a Ubuntu 14.04 VM on VMware player. I tried it and I am getting : Error occured : M2MInterface::NetworkError Could it be that this example does not run on a VM ?

yogpan01 commented 8 years ago

Hi, This should not be an issue as we are also running the example over VMWare. Are you using TCP mode for connection ?

talkjoey commented 8 years ago

Wireshark shows that protocol is TCP and TLSv1. How can that be ensured? If that is to be updated, where should the change be made ? It is using Bridged connection.

talkjoey commented 8 years ago

Replacing server name with ip worked. Replaced "coap://api.connector.mbed.com:5684" with "coap://169.45.82.18:5684". Anyway this can be avaoided ?

yogpan01 commented 8 years ago

If that's working for you, then most probably there is some DNS resolving issue on your machine, because DNS resolving support is there in mbed-client.

janjongboom commented 8 years ago

I do believe that we should give better errors here. Why is there no error about DNS resolving failed?

anttiylitokola commented 8 years ago

We have now introduced re-connection logic and published couple of more error codes in M2MInterface. I'll close this ticket now.