Closed SYuPing closed 8 years ago
@hasnainvirk Can you check this please? @SYuPing : What are your endpoint credentials ? ENDPOINT_NAME and DOMAIN values , because you are not using Connector, what values are you providing there ?
Hi, The ENDPOINT_NAME is "822e461e-5580-4522-91df-e96b0230f879" and DOMAIN value is "40c8e96d-e5b8-4d5b-a49c-c3f7cbe399ee", which are copied from security.h is getten on mDC, is it uncorrect?
Thanks.
ARM Internal Ref: IOTCLT-877
If you are using local device server , you need to use DOMAIN value as "domain"
Hi, I've tried some steps as follow but still can't connect.....
And the executed log is:
Starting mbed Client example... Using Mesh
Connecting to Mesh..
Connected to Network successfully IP address fd00:ff1:ce0b:a5e0:fcc2:3d00:4:b74d
SOCKET_MODE : UDP Connecting to coaps://[2607:f0d0:2601:52::20]:5684
[ERROR:] M2MInterface::SecureConnectionFailed
Many thanks....
Sorry, the message "Connecting to coaps://[2607:f0d0:2601:52::20]:5684" in log is wrong. It's my fault to check that when I paste it. Which correct log message is:
Starting mbed Client example... Using Mesh
Connecting to Mesh..
Connected to Network successfully IP address fd00:ff1:ce0b:a5e0:fcc2:3d00:4:b74d
SOCKET_MODE : UDP Connecting to coap://FD00:FF1:CE0B:A5E0::1:5683
[ERROR:] M2MInterface::NetworkError
Where the code I changed is as below,
In main.cpp
ifndef MESH
// This is address to mbed Device Connector
define MBED_SERVER_ADDRESS "coap://api.connector.mbed.com:5684"
else
// This is address to mbed Device Connector #define MBED_SERVER_ADDRESS "coap://FD00:FF1:CE0B:A5E0::1:5683"
endif
In security.h
#define MBED_DOMAIN "domain"
define MBED_ENDPOINT_NAME "822e461e-5580-4522-91df-e96b0230f879"
In simpleclient.h
void create_interface(const char server_address, void handler=NULL) { // Randomizing listening port for Certificate mode connectivity _server_address = server_address; srand(time(NULL));
uint16_t port = 5683;
and
if(security) { // Add ResourceID's and values to the security ObjectID/ObjectInstance security->set_resource_value(M2MSecurity::M2MServerUri, _server_address); security->set_resource_value(M2MSecurity::SecurityMode, M2MSecurity::NoSecurity); security->set_resource_value(M2MSecurity::ServerPublicKey, SERVER_CERT, sizeof(SERVER_CERT)); security->set_resource_value(M2MSecurity::PublicKey, CERT, sizeof(CERT)); security->set_resource_value(M2MSecurity::Secretkey, KEY, sizeof(KEY)); }
Hi,
When the changed above confige to be 6lowpan-ND and connected with another k64f board which code is used k64f-border-router could connect to mDS.
What I mean is that I used k64f board+6lowpan shield which downloaded k64f-border-router example to be a BR to represent gayway router. It could connected to mDS sucessfully.
But in thread mode + gateway still failed...
@hasnainvirk Can you please check this ?
Here is my mbed_app.json file
{ "config": { "network-interface":{ "help": "options are ETHERNET,WIFI,MESH_LOWPAN_ND,MESH_THREAD", "value": "MESH_THREAD" }, "wifi-ssid": { "help": "WiFi SSID", "value": "\"SSID\"" }, "wifi-password": { "help": "WiFi Password", "value": "\"Password\"" } }, "target_overrides": { "*": { "mbed-mesh-api.thread-config-channel-page": 0, "mbed-mesh-api.thread-config-channel": 12, "target.features_add": ["CLIENT", "IPV6", "COMMON_PAL"], "mbed-trace.enable": 1, "mbed-client.reconnection-count": 3, "mbed-client.reconnection-interval": 5 } } }
@SYuPing I tried a similar setup like you. And I was able to get connected. Can you please have a Skype session with me to look at what you are doing ? Please contact me at, skypeID = husnain.virk
@SYuPing My setup:
mbed-Gateway with Thread Static binary loaded(from this repo) K64F with Atmel-RF –Shield and mbed-os-example-client loaded on it mbed Device Server 3.1.0
Things I did differently :
In main.cpp:
#define MBED_SERVER_ADDRESS "coap://[fd00:ff1:ce0b:a5e0::1]:5683"
In simpleclient.h:
/*You need this port randomization. You can set here the port to be 5683*/
uint16_t port = rand() % 65535 + 12345;
On my laptop running mDS:
# You need to make your laptop accept router advertisements,
# so that you can establish routing between your mDS and border router
sudo sysctl -w net.ipv6.conf.eth0.accept_ra=1
Hi,
I still could not connect sucessfully after I followed your step...
BTW, My mDS is running on windows OS not linux...Is it effect? Should I still type some command on my dos command line?
Thanks a lot
@SYuPing Can you try this on windows
netsh interface ipv6 set interface "Local Area Connection" advertise=enabled
What I tried is netsh interface ipv6 set interface "區域連線 2" advertise=enabled The chinese I typed "區域連線 2" is the name of Local Area Connection in my computer but....it still failed... The version of mDS server what I used is 3.0.6
@SYuPing
I tried with Windows OS and I found out that the Windows Firewall was blocking all traffic on outgoing ports from Windows to BR.
Please follow the following instructions to get your issue resolved:
Now you should be able to see get your traffic from mDS through. Please close the issue if you are satisfied.
It can work after I changed the gateway code "gatewayThreadStatic.bin" which updated date is 8/19. The problem seems like the version of gatewayThreadStatic.bin file. No metter what the code I used is copied from you this week or three weeks ago which I chagned refer to your steps, both are workable now. But when I change the gateway code "gatewayThreadStatic.bin" back to 8/19 before (exctly date: 8/1), the problem shows up and both of two can't work...
The problem seems like that the version of gateway binary code is different...
Now, it is workable when I used this version of gateway binary (updated date: 8/19), and thanks for your help.
Close this issue.
Hi, I want to connect to local mDS instead of mDC because my contry do not support for IPv6 connectitvity... So, I did some change in main code as follow,
But... There's a bit confusing for me is where gatewayThreadStatic.bin comes from, and I've done two testing process...
First, I copied that from the lateset "mbed-os-example-client/ GW_Binary", after loaded to Gatway Router, and the meassage shows on Putty terminal is
Starting mbed Client example... Using Mesh
Connecting to Mesh..
Connected to Network successfully
SOCKET_MODE : UDP Connecting to coap://FD00:FF1:CE0B:A5E0::1:5683
The other gatewayThreadStatic.bin comes from "mbed-client-example-6lowpan-device_server/ GW_Binary" which version is mbed-os 3.0, and the message shows on Putty is
Starting mbed Client example... Using Mesh
Connecting to Mesh..
Connected to Network successfully
SOCKET_MODE : UDP Connecting to coap://FD00:FF1:CE0B:A5E0::1:5683
The two results are different, and both fail to connect to mDS, I don't know what the problem is, could someone help me to solve this?
Many thanks.