Android_SDK_Demo icon indicating copy to clipboard operation
Android_SDK_Demo copied to clipboard

Wireless gateway integration issue using new SDK

Open AAkanksha26 opened this issue 5 years ago • 1 comments

Hello!

I've used the SDK "ttlock-sdk-2.0.aar" and "ttlock-gateway-sdk-2.0.aar" in my project for the smart locks. Now I want to integrate the wireless gateway into my project. So I tried using GatewayAPI and followed the instruction given in TTLock documentation. It couldn't work for me and I don't know where I'm going wrong. So I tried the new SDK "com.tongtonglock:ttlock:3.0.6" for gateway integration. Using that I could scan the gateway, connect the gateway and scan wifi networks for gateway; but I couldn't init the gateway. I used the credentials of my TTLock account for this. I used the method as below -

        configureGatewayInfo.uid = MY_INTEGER_USER_ID;
        configureGatewayInfo.userPwd = MY_PASSWORD;
        configureGatewayInfo.ssid = binding.wifiName.getText().toString().trim();
        configureGatewayInfo.plugName = binding.gatewayName.getText().toString().trim();
        configureGatewayInfo.wifiPwd = binding.wifiPwd.getText().toString().trim();
        GatewayClient.getDefault().initGateway(configureGatewayInfo, new InitGatewayCallback() {
            @Override
            public void onInitGatewaySuccess(DeviceInfo deviceInfo) {
                makeToast("gateway init success");
            }

            @Override
            public void onFail(GatewayError error) {
                makeToast(error.getDescription());
            }
        });

It is not showing the message in onFail, not in onInitGatewaySuccess and not even showing some error or exception and after some time, the gateway times out.

Can you please tell me where I'm going wrong or help to solve the issue? Also please let me know if there is any way to integrate "ttlock-sdk-2.0.aar" along with "com.tongtonglock:ttlock:3.0.6".

Thanks in advance!

AAkanksha26 avatar Dec 04 '19 05:12 AAkanksha26

Hello @AAkanksha26 , Did you get any solution?

I am also facing a similar issue. For me, it's not even scanning.

@ttlock , @lxk123 Please help

the-code-chef avatar Aug 18 '20 13:08 the-code-chef