Comments (10)
The issue root caused to corporate network blocking the communication.
I am able to resolve by creating a access point using raspberryPI.
Did the installations mentioned here. Just switched the configurations for eth0 and wlan0.
You need the wlan0 to act as your Internet connection, and eth0 to act as the access connection
(which is the opposite of what's here). You can ignore step 5 and step 8.
https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/
from mbed-cloud-client.
ARM Internal Ref: IOTCLT-3544
from mbed-cloud-client.
Hi @svgeorge, it is possible that 5684 is blocked by your company.
If you can enable some debug-tracing by setting "mbed-trace.enable": 1 it could give a bit more information what is causing the NetworkError. (https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/mbed_app.json#L21)
Can you confirm what network connectivity you are using with the board? It it is Wi-Fi, then using a mobile phone as access point (instead of corporate wlan), might give more unrestricted access.
from mbed-cloud-client.
Hello Teemu: Your conclusion is correct. I have used home network and application registered with mbed server. The board I am using donn't have any wi-fi. I am using Ethernet connection. Any work around I could implement to listen on another port?
Thanks
Varughese
from mbed-cloud-client.
Client is listening to random port number so that should not be a problem. Client is trying to connect to 5684, so can it be a problem that outbound connection is also blocked?
You can fix the client-side port via configuration: https://github.com/ARMmbed/mbed-cloud-client/blob/4f4a8463dd06160844fe430192741a678cd34183/mbed-cloud-client/MbedCloudClientConfig.h#L113
from mbed-cloud-client.
The port 5684 is Ok from my desktop. I will change the client configuration and try it again.
const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = "coaps://bootstrap.us-east-1.mbedcloud.com:5684?aid=016b2914a5fc762d28a836d200000000";
~$ nc -vz bootstrap.us-east-1.mbedcloud.com 5684
Connection to bootstrap.us-east-1.mbedcloud.com 5684 port [tcp/] succeeded!
~$nc -vuz bootstrap.us-east-1.mbedcloud.com 5684
Connection to bootstrap.us-east-1.mbedcloud.com 5684 port [udp/] succeeded!
from mbed-cloud-client.
I have enabled the trace logs and the following trace obtained.
Connect Failed due to
PAL_ERR_TLS_WANT_READ --> MBEDTLS_ERR_SSL_WANT_READ --> PAL_ERR_SOCKET_WOULD_BLOCK --> NSAPI_ERROR_WOULD_BLOCK
So the root error is NSAPI_ERROR_WOULD_BLOCK which set when recvfrom() call returns -1
***** trace ****
[DBG ][mClt]: M2MConnectionHandlerPimpl::receive_handshake_handler()
[DBG ][mClt]: M2MConnectionSecurityPimpl::connect
[DBG ][mClt]: M2MConnectionSecurityPimpl::start_handshake
[ERR ][PAL ]: PAL_ERR_SOCKET_WOULD_BLOCK status set due to NSAPI_ERROR_WOULD_BLOCK
[ERR ][PAL ]: MBEDTLS_ERR_SSL_WANT_READ status set due to PAL_ERR_SOCKET_WOULD_BLOCK
[DBG ][mClt]: M2MConnectionSecurityPimpl::start_handshake - handshake ret: 0XFFF00005
[DBG ][mClt]: M2MConnectionSecurityPimpl::start_handshake - PAL_ERR_TLS_WANT_READ ret: 0XFFF00005
[DBG ][mClt]: M2MConnectionSecurityPimpl::connect - handshake ret: -2
*** trace end ***
*** testing of the port ***
const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = "coaps://bootstrap.us-east-1.mbedcloud.com:5684?aid=016b2914a5fc762d28a836d200000000";
~$ nc -vz bootstrap.us-east-1.mbedcloud.com 5684
Connection to bootstrap.us-east-1.mbedcloud.com 5684 port [tcp/] succeeded!
~$nc -vuz bootstrap.us-east-1.mbedcloud.com 5684
Connection to bootstrap.us-east-1.mbedcloud.com 5684 port [udp/] succeeded!
As mentioned before, the same program works fine using home network.
The issue shows only with corporate network. I donβt have wi-fi support on my board to use hotspot.
setting #define MBED_CLOUD_CLIENT_LISTEN_PORT 1 had no impact.
any chance this could be related to some time parameters?
from mbed-cloud-client.
It seems like a company firewall issue. It may block the connections. Note that when you run nc with -z parameter, it does not really do anything on UDP. Are you using UDP or TCP? On TCP it creates a socket, but as there is no actual data transfer, the firewall may not act on it. I suggest to run without the -z.
It should be verified from IT what kind of firewall and proteins is done, if we can solve it in the networking stack.
from mbed-cloud-client.
@svgeorge note that with MBED_CLOUD_CLIENT_LISTEN_PORT you define the number of the LISTEN port to something fixed.
0 => not defined, client will randomize it for you.
0 client will use that port number. (So its not boolean, 1 => use port number 1).
Generally you should not need to touch this parameter, even if connecting from behind a firewall.
from mbed-cloud-client.
this can be closed
from mbed-cloud-client.
Related Issues (20)
- Memory leak
- Building .a library HOT 3
- client-lite public release HOT 5
- dereferencing pointer to incomplete type 'mbedtls_md_info_t' build error HOT 2
- Backup & restore FCC on production devices HOT 8
- Auto Observable Allocation Event Handler HOT 5
- Thread safety of M2MResourceBase::set_value HOT 3
- Bug fix for multi instance resource with no initial instances HOT 2
- Different struct layouts in source files cause hard faults HOT 3
- Retransmission buffer size invalidated HOT 4
- M2MConnectionHandlerPimpl::eventloop_event_handler is called after object instance is deleted HOT 2
- mbed-os pal_crypto.h file name conflict with cloud-client file HOT 6
- Security object not lwm2m specification compliant HOT 5
- Resource 1/0/7 (Server/Binding) should be writable HOT 3
- No bootstrapping when EST feature is disabled HOT 7
- Deletion of Server object should be allowed during bootstrapping HOT 3
- Abort unregistration process on failure HOT 4
- Errors when disabling bootstrapping HOT 5
- Avoid unnecessary includes HOT 4
- Compiler error with IAR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbed-cloud-client.