Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REALTEK_RTL8195AM - WiFi implementation not complete? #4683

Closed
JanneKiiskila opened this issue Jun 30, 2017 · 25 comments
Closed

REALTEK_RTL8195AM - WiFi implementation not complete? #4683

JanneKiiskila opened this issue Jun 30, 2017 · 25 comments

Comments

@JanneKiiskila
Copy link
Contributor

JanneKiiskila commented Jun 30, 2017

Note: This is just a template, so feel free to use/remove the unnecessary things

Description

  • Type: Bug
  • Related issue: #4665
  • Priority: Major

Bug

Target
REALTEK_RTL8195AM

Toolchain:
GCC_ARM

Toolchain version:
gcc-arm-none-eabi-6-2017-q1-update/

mbed-cli version:
(mbed --version)
1.1.1

meed-os sha:
(git log -n1 --oneline)
commit a3a7846817d7eefe59731762f681f53d2fc80da7 (HEAD -> enable_sdram, origin/enable_sdram)

Previous commit;
commit a39ac60
Merge: 4fc4405 ec72ac0
Author: Jimmy Brisson [email protected]
Date: Wed Jun 28 09:31:25 2017 -0500

Merge pull request #4159 from adustm/STM_sha256_F439ZI

NUCLEO_F439ZI/mbedtls: add SHA256 hw_acceleration

DAPLink version:
?

Expected behavior

mbed-os-example-client should be able to connect to the mbed Connector.

Actual behavior

mbed-os-example-client is not able to connect, absolutely nothing seems to happen.
(Problem now that we can't enable the full logset due to the other issues).

Steps to reproduce

Question - has the ASYNC network API been implemented fully to the REALTEK_RLT8195AM?
Please note that mbed-os-example-wifi does not exercise the ASYNC API at all.

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jun 30, 2017

K
K
K

KIFI is already running

Starting mbed Client example
[EasyConnect] IPv4 mode
[EasyConnect] Using WiFi (REALTEK)
[EasyConnect] Connecting to WiFi xxxxx

RTL8195A[Driver]: set ssid [xxxxx] 

RTL8195A[Driver]: start auth to ec:1d:7f:92:6d:99

RTL8195A[Driver]: auth success, start assoc

RTL8195A[Driver]: association success(res=1)

RTL8195A[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)

RTL8195A[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[EasyConnect] Connected to Network successfully
[EasyConnect] MAC address f0:03:8c:e7:a9:cd
[EasyConnect] IP address 192.168.1.149

SOCKET_MODE : TCP
Connecting to coap://api.connector.mbed.com:5684

It doesn't get very far.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 3, 2017

cc @Archcady

@JanneKiiskila
Copy link
Contributor Author

That K K K print and "KIFI" is also a bit strange.

@Archcady
Copy link
Contributor

Archcady commented Jul 3, 2017

This "K" message can be switch off by undefine CONFIG_DEBUG_LOG in platform_autoconf.h inside of REALTEK's target directory. However I didn't get [EasyConnect] Using WiFi (REALTEK), instead I have [EasyConnect] Using WiFi (ESP8266) which obviously is my setting of code being incorrect...

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jul 3, 2017

Yes, please modify the mbed_app.json connection line -> change WIFI_ESP8266 to WIFI_REALTEK.
I could push a new commit to the mbed-os-example-client with a pre-defined config file for Realtek, but right now I'm not able to generate a working binary even w/o logs, which is puzzling me quite a bit.

@JanneKiiskila
Copy link
Contributor Author

Remember to also use the .mbedignore in case you have a compilation problem with Atmel RF.

cp configs/eth-wifi-mbedignore ./.mbedignore 

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jul 3, 2017

Pushed new commit to mbed-os-example-client PR ARMmbed/mbed-os-example-client#268.

Remember mbed deploy to update easy-connect repo.

@JanneKiiskila
Copy link
Contributor Author

Ok, now we managed to get it to register ONCE with UDP- seems every run is a bit different and it either hangs or dies. Other issues we see

  1. WiFi connection is not stable - after a reboot, even though my hotspot is available - RTL8195 fails to connect to it.
Starting mbed Client example
[EasyConnect] IPv4 mode
[EasyConnect] Using WiFi (REALTEK)
[EasyConnect] Connecting to WiFi jannek.iki.fi

RTL8195A[Driver]: set ssid [jannek.iki.fi] 

RTL8195A[Driver]: start auth to ec:1d:7f:92:6d:99

RTL8195A[Driver]: sta recv deauth reason code(1) sta:ec:1d:7f:92:6d:99
failed: -1
[EasyConnect] MAC address f0:03:8c:e7:a9:cd
[EasyConnect] Connection to Network Failed -3004!

Connection to Network Failed - exiting application...

RTL8195A[Driver]: sta recv disassoc reason code(4) sta:ec:1d:7f:92:6d:99
  1. With TCP I sometimes get a beacon disconnect
RTL8195A[Driver]: no beacon for a long time, disconnect or roaming

I think that's a bug and it shouldn't happen?

@Archcady
Copy link
Contributor

Archcady commented Jul 4, 2017

I've got log like this, the register didn't success.

<RTL8195A>
=========================================================


ROM Version: 0.2


Build ToolChain Version: gcc version 4.8.3 (Realtek ASDK-4.8.3p1 Build 2003) 


=========================================================

Check boot type form eFuse

SPI Initial

Image1 length: 0x2d64, Image Addr: 0x10000bc8

Image1 Validate OK, Going jump to Image1


Initializing WIFI ...

WIFI initialized


WIFI is already running
Starting mbed Client example
[EasyConnect] IPv4 mode
[EasyConnect] Using WiFi (REALTEK)
[EasyConnect] Connecting to WiFi RealEZ


RTL8195A[Driver]: set ssid [RealEZ] 


RTL8195A[Driver]: start auth to 9c:1c:12:13:cd:01


RTL8195A[Driver]: auth success, start assoc


RTL8195A[Driver]: association success(res=4)


RTL8195A[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)


RTL8195A[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[EasyConnect] Connected to Network successfully
[EasyConnect] MAC address 00:e0:4c:87:00:58
[EasyConnect] IP address 172.25.24.43
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_object : Name : 3200�[0m

�[2K�[90m[DBG ][mClt]: M2MObject::create_object_instance - id: 0�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 5501)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m

�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceInstance::report() - combined level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - mode = 1, is_observable = 1�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_object : Name : 3201�[0m

�[2K�[90m[DBG ][mClt]: M2MObject::create_object_instance - id: 0�[0m

�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m

�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 5853)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m

�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m

�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 5850)�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_object : Name : 1000�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::create_object_instance - id: 0�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 1)�[0m

�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - IN�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - parameters endpoint name : 37f2cc5e-0210-4b20-9c01-8bca13228ae1�[0m

�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - parameters endpoint type : test�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - parameters life time(in secs): 100�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - parameters Listen Port : 0�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - parameters Binding Mode : 9�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - parameters NetworkStack : 1�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - Creating M2MInterfaceImpl�[0m

�[2K�[90m[D
�[2K�[39m[INFO][mBFO][mClt]: connectClt]: connection_eion_event_handler: vent_handler: default type: 0�[0m
default type: 0�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 1)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 6)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 7)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 8)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::M2MNsdlInterface()�[0m

�[2K�[90m[DBG ][coap]: Coap random msg ID: 18857�[0m
�[2K�[90m[DBG ][coap]: Coap BLOCKWISE_MAX_TIME_DATA_STORED: 60�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::initialize()�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::M2MInterfaceImpl() -IN�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_endpoint( name 37f2cc5e-0210-4b20-9c01-8bca13228ae1 type test lifetime 100, domain f2e7a916-a80a-4ad9-b905-21a82bf6132d, mode 1)�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::M2MInterfaceImpl() -OUT�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_interface - OUT�[0m

SOCKET_MODE : TCP
Connecting to coap://api.connector.mbed.com:5684
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::set_platform_network_handler()�[0m

�[2K�[90m[DBG ][mClt]: set_platform_network_handler�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_security�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::create_object_instance - id: 0�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 1)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 2)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 3)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 4)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 5)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 10)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m

�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceInstance::report() - combined level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - mode = 1, is_observable = 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceInstance::report() - combined level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - mode = 1, is_observable = 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceInstance::report() - combined level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - mode = 1, is_observable = 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m

�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m

�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceInstance::report() - combined level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - mode = 1, is_observable = 0�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceFactory::create_device�[0m

�[2K�[90m[DBG ][mClt]: M2MObject::create_object_instance - id: 0�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::object_instance(inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m

�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 4)�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource_instance(resource_name 11)�[0m
�[2K�[90m[DBG ][mClt]: M2MResource::resource(resource_name inst_id 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MBase::M2Mbase resource name is EMPTY ===========�[0m
�[2K�[90m[DBG ][mClt]: M2MResource::add_resource_instance()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceInstance::report() - combined level 0�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::report() - mode = 1, is_observable = 1�[0m

�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 16)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m

�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 0)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 17)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 1)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MObjectInstance::create_dynamic_resource(resource_name 2)�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::set_value()�[0m
�[2K�[90m[DBG ][mClt]: M2MResourceBase::is_value_changed() -- true�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::register_object - IN�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::external_event : new state 6�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::external_event : handle new state�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::internal_event : new state 6�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_engine�[0m

�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register - server_type : M2MSecurity::M2MServer�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_list_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_list_structure - Object count is 4�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure()�[0m

�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure - Object Instance count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure - ResourceBase count 7�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/4)�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::set_observation_handler - handler: 0x0x1003a9ac�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure - ResourceInstance count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/11/0)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m

�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/11)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/16)�[0m

�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/0)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/17)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/1)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0/2)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3/0)�[0m

�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure - Object Instance count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure - ResourceBase count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3200/0/5501)�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::set_observation_handler - handler: 0x0x1003a9ac�[0m

�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure - Object Instance count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure - ResourceBase count 2�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3201/0/5853)�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::set_observation_handler - handler: 0x0x1003a9ac�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (3201/0/5850)�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_structure - Object Instance count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_object_instance_structure - ResourceBase count 1�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource_structure()�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - path (1000/0/1)�[0m
�[2K�[90m[DBG ][mClt]: M2MObject::set_observation_handler - handler: 0x0x1003a9ac�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::create_nsdl_resource - Creating in NSDL-C result 0�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register - create_nsdl_list_structure - success�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register - server_address coap://api.connector.mbed.com:5684�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register - IP address api.connector.mbed.com , Port 5684�[0m
�[2K�[90m[DBG ][mClt]: resolve_server_address()�[0m
�[2K�[90m[DBG ][mClt]: send_dns_event()�[0m
�[2K�[90m[DBG ][mC
�[2K�[90m[DBG ][lt]: M2MConnectionHmClt]: M2MConnectioandlerPimpl::dns_hanHandlerPimpl::dns_handler - _socket_statndler - _soe = 0�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m

�[2K�[90m[DBG ][mClt]: address family: 2�[0m

�[2K�[90m[DBG ][mClt]: IPv4 Address a9:2d:52:12�[0m
�[2K�[90m[DBG ][mClt]: init_socket - IN�[0m
�[2K�[90m[DBG ][mClt]: Interface count: 1�[0m
�[2K�[90m[DBG ][mClt]: Interface name: �[0m
�[2K�[90m[DBG ][mClt]: Interface no: 0�[0m
�[2K�[90m[DBG ][mClt]: init_socket - port 0�[0m
�[2K�[90m[DBG ][mClt]: init_socket - OUT�[0m
�[2K�[90m[DBG ][mClt]: resolve_server_address - Using TCP�[0m
simulate button_click, device not registered

�[2K�[31m[ERR ][mClt]: pal_connect(): failed: -65526�[0m

�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::socket_error: (4), retry (1), reconnecting (0), reconnection_state (1)�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::internal_event : new state 0�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_engine�[0m

�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_idle�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::stop_timers()�[0m
�[2K�[90m[DBG ][mClt]: stop_listening()�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m

�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::socket_error - reconnecting in 15(s), count 1/3�[0m
simulate button_click, device not registered

�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::timer_expired()�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::internal_event : new state 6�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_engine�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register�[0m
�[2K�[90m[DBG ][mClt]: stop_listening()�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m

�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: resolve_server_address()�[0m
�[2K�[90m[DBG ][mClt]: send_dns_event()�[0m
�[2K�[90m[DBG ][mClt]: M2MConnectionHandlerPimpl::dns_handler - _socket_state = 0�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m

�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: address family: 2�[0m

�[2K�[90m[DBG ][mClt]: IPv4 Address a9:2d:52:12�[0m
�[2K�[90m[DBG ][mClt]: init_socket - IN�[0m
�[2K�[90m[DBG ][mClt]: Interface count: 1�[0m

�[2K�[90m[DBG ][mClt]: Interface name: �[0m
�[2K�[90m[DBG ][mClt]: Interface no: 0�[0m
�[2K�[90m[DBG ][mClt]: init_socket - port 0�[0m
�[2K�[90m[DBG ][mClt]: init_socket - OUT�[0m
�[2K�[90m[DBG ][mClt]: resolve_server_address - Using TCP�[0m
simulate button_click, device not registered

�[2K�[31m[ERR ][mClt]: pal_connect(): failed: -65526�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::socket_error: (4), retry (1), reconnecting (1), reconnection_state (1)�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::internal_event : new state 0�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_engine�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_idle�[0m
�[2K�[90m[DBG ][mClt]: M2MNsdlInterface::stop_timers()�[0m
�[2K�[90m[DBG ][mClt]: stop_listening()�[0m

�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m

�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::socket_error - reconnecting in 30(s), count 2/3�[0m
simulate button_click, device not registered
simulate button_click, device not registered

�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::timer_expired()�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::internal_event : new state 6�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_engine�[0m
�[2K�[90m[DBG ][mClt]: M2MInterfaceImpl::state_register�[0m
�[2K�[90m[DBG ][mClt]: stop_listening()�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: resolve_server_address()�[0m
�[2K�[90m[DBG ][mClt]: send_dns_event()�[0m
�[2K�[90m[DBG ][mClt]: M2MConnectionHandlerPimpl::dns_handler - _socket_state = 0�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - IN�[0m
�[2K�[90m[DBG ][mClt]: close_socket() - status: 0 OUT�[0m
�[2K�[90m[DBG ][mClt]: address family: 2�[0m
�[2K�[90m[DBG ][mClt]: IPv4 Address a9:2d:52:12�[0m
�[2K�[90m[DBG ][mClt]: init_socket - IN�[0m
�[2K�[90m[DBG ][mClt]: Interface count: 1�[0m
�[2K�[90m[DBG ][mClt]: Interface name: �[0m
�[2K�[90m[DBG ][mClt]: Interface no: 0�[0m
�[2K�[90m[DBG ][mClt]: init_socket - port 0�[0m
�[2K�[90m[DBG ][mClt]: init_socket - OUT�[0m

�[2K�[90m[DBG ][mClt]: resolve_server_address - Using TCP�[0m
simulate button_click, device not registered

@JanneKiiskila
Copy link
Contributor Author

Hi @Archcady - you seem to have some connection problem, it's not able to connect to the COAP server.

Can you reach this address coap://api.connector.mbed.com:5684?

How large are the buffers in your WiFi stack? The certificate downloads are getting 2381 bytes a chunk, it seems to repeat that. Also the TLS handshaking is really slow, which might cause problems as well. Is the SSL acceleration enabled in the Ameba board with mbed OS 5.5?

@Archcady
Copy link
Contributor

Archcady commented Jul 4, 2017

For wifi poor connection and no beacon behaviors, we think the reason is probably poor signal if you didn't attach antenna to board.
How do I check if I can reach the address (coap://api.connector.mbed.com:5684) or not?
Our WiFi receive buffer is enough to accept 802.11 packet, do you mean this buffer?
For TLS handshaking being slow, one possible reason is that our text code are put into SDRAM in order to make space.

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jul 4, 2017

Hi @Archcady

I have placed the white antenna to the board and the phone I'm using to host the Wifi hotspot for it is within centimetres of the Ameba board.

Checking the connectivity - if you have any device that can run for example ping api.connector.mbed.com from the same network, that should tell if it's OK or not.

@Archcady
Copy link
Contributor

Archcady commented Jul 4, 2017

Hi @JanneKiiskila ,
From my side I didn't meet poor WiFi connection problem. Then, this is a issue I should research at.

@JanneKiiskila
Copy link
Contributor Author

Hi @Archcady

I found out that if I just repeatedly restart the mbed-os-example-client, I would get various errors in the initial Wifi-stage. If you do 10 reboots (and I doubt one needs the mbed-os-example-client for this, as it's happening so early).

There also seem to be some random crashes/freezes as well, we should found out the root cause for those. I.e. if you run the client 10 times, it should always end up with the same end result. Now it does not.

@JanneKiiskila
Copy link
Contributor Author

With UDP & logs disabled I seem to have better luck, multiple passes now.

=========================================================
Check boot type form eFuse
SPI Initial
Image1 length: 0x2d64, Image Addr: 0x10000bc8
Image1 Validate OK, Going jump to Image1

Initializing WIFI ...
WIFI initialized
K
K
K
K

KIFI is already running

Starting mbed Client example
[EasyConnect] IPv4 mode
[EasyConnect] Using WiFi (REALTEK)
[EasyConnect] Connecting to WiFi jannek.iki.fi

RTL8195A[Driver]: set ssid [jannek.iki.fi] 

RTL8195A[Driver]: start auth to ec:1d:7f:92:6d:99

RTL8195A[Driver]: auth success, start assoc

RTL8195A[Driver]: association success(res=8)

RTL8195A[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)

RTL8195A[Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[EasyConnect] Connected to Network successfully
[EasyConnect] MAC address f0:03:8c:e7:a9:cd
[EasyConnect] IP address 192.168.1.149

SOCKET_MODE : UDP
Connecting to coap://api.connector.mbed.com:5684

Registered object successfully!

@marcuschangarm
Copy link
Contributor

@Archcady it might be easier to debug using the smaller example applicetion: #4700

I believe these issues might be related.

@JanneKiiskila
Copy link
Contributor Author

Yes, indeed. The mbed-os-example-client is a bit complicated with all the LWM2M stuff and the problem is clearly the TLS handshake - that we can see from the logs. So, if you get #4700 resolved - it will likely resolve the mbed-os-client-example issue as well.

Good work @marcuschangarm - smaller test case typically makes life easier.

Enabling logs with UDP also makes the success rate drop, so extra load from serial tracing seems to impact this as well.

@marcuschangarm
Copy link
Contributor

I've closed the other issue since it turned out to be unrelated.

When I run the mbed-os-example-client example, it often crashes before the TCP socket is even created, so the fix in the other thread wont help.

@Archcady what tools do you use for debugging the RTL8195AM? We currently don't have pyOCD support for that board so we can't debug using gdb.

@Archcady
Copy link
Contributor

@marcuschangarm, sadly we don't have some decent debugging methods, making debugging progress really slow.

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jul 11, 2017

@0xc0170 @c1728p9 - could we get the PyOCD support? Everyone would be needing it... Ah, @marcuschangarm - you were faster again, issue raised already by you (pyocd/pyOCD#317).

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jul 11, 2017

@sg- can we label is OSCA, due to the PyOCD dependency.

@JanneKiiskila
Copy link
Contributor Author

@Archcady - has now done fix proposal via, #4754

@Archcady
Copy link
Contributor

@JanneKiiskila with #4754, TLS handshake should now work fine.

@prashantrar
Copy link
Contributor

Is there any work needed still on this issue from realtek side?

@JanneKiiskila
Copy link
Contributor Author

I would close this one for now and file new issues via new issues. No point in hanging this for much longer unless more details can be surfaced. Though I have to admit that least I haven't been able to do much stress testing with this board anyway and it would likely be beneficial to run the stress tests for example for WiFi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants