Giter Site home page Giter Site logo

tuya / tuya-iotos-embeded-sdk-wifi-ble-bk7231n Goto Github PK

View Code? Open in Web Editor NEW
47.0 18.0 49.0 87.37 MB

Tuya IoTOS Embeded SDK WiFi & BLE for BK7231N

Home Page: https://www.tuya.com/

C 99.80% C++ 0.07% Shell 0.05% CMake 0.08%
iot wifi ble tuya bk7231n iotos tuya-iotos

tuya-iotos-embeded-sdk-wifi-ble-bk7231n's Introduction

Tuya IoTOS Embedded Wi-Fi and BLE SDK for bk7231n

中文版 | English

Overview

Developed independently by Tuya Smart, Tuya IoTOS is the world's only IoT operating system covering all levels of IoT sensing, interruption, network, platform, and application. Benefiting from Tuya Smart's accumulation in the IoT industry, TuyaIoTOS provides solutions for a full range of products from product design, R&D, to post-operation.

Tuya IoTOS embedded SDK is an important part of Tuya IoTOS. By virtue of dedicated design, it provides customers with unified APIs, rich SDKs, and DIY functions, enhancing the integrality of the IoT industry. It can be applied to industrial IoT, vehicle networking, security monitoring, outing, and smart home development.

Features of Tuya IoTOS embedded SDK

  • Flexible options: Tuya IoTOS embedded SDK provides rich SDKs covering the core of the IoTOS, general IoT functions, and IoT technology stacks in different fields. Developers can select the solutions as needed, and competent developers can make in-depth customization online as needed.
  • Cross-platform: The design of Tuya IoTOS embedded SDK supports cross-hardware platforms and operating systems. It can be migrated to any hardware chip and system, which greatly improves the development efficiency.
  • Security and privacy: Tuya IoTOS embedded SDK features secure data storage, secure network communication, identity verification, secure startup, and security upgrades, and strict compliance with the security and privacy policies around the world.
  • Rich ecology: Tuya Smart is cooperating closely with major chip manufacturers, and providing over 100 models for developers. Furthermore, all products developed in Tuya IoTOS can be linked. Powered by Tuya has achieved a complete ecosystem of the IoT industry.

Quick start

Dependency

Some package dependencies need to be installed before compiling.

Debian/Ubuntu

$ sudo apt-get install build-essential wget git python libc6-i386 

Windows

Supports compilating in Cygwin, MinGW, WSL2 and more environments

Get SDK

Make sure to get SDK through git recursion:

$ git clone --recursive https://github.com/tuya/tuya-iotos-embeded-sdk-wifi-ble-bk7231n.git

or

$ git clone https://github.com/tuya/tuya-iotos-embeded-sdk-wifi-ble-bk7231n.git
$ git submodule update --init

Compile

The compile project is in the apps directory, you can quickly compile, burn, and run the process through tuya_demo_template. Use the following command in the root directory to compile:

$ sh build_app.sh apps/tuya_demo_template tuya_demo_template 1.0.0

apps/tuya_demo_template: compile project path

tuya_demo_template: compile project name

1.0.0: The version of the current compilation firmware

Compilation cleanup

You can clear the compiled intermediate files with the following commands:

$ sh build_app.sh apps/tuya_demo_template tuya_demo_template 1.0.0 clean

Burning authorization

For more information about firmware burning authorization, see Burn and Authorize WB Series Modules

Evaluation kits

For more information about SDK, see Sandwich Evaluation Kits

Technical support

You can get support from Tuya through the following accesses:

tuya-iotos-embeded-sdk-wifi-ble-bk7231n's People

Contributors

flyingcys avatar shiliu-yang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tuya-iotos-embeded-sdk-wifi-ble-bk7231n's Issues

Unable to Establish HTTPS Connection on Non-Tuya Server Using TuyaOS SDK

Issue Title:

Unable to Establish HTTPS Connection on Non-Tuya Server Using TuyaOS SDK

Issue Description:

I'm encountering difficulties establishing an HTTPS connection to a non-Tuya server using the TuyaOS SDK. Below are the relevant logs from my application:

[01-01 00:00:04 ty D][lr:0x8146d] cache dns [REDACTED_URL]<->[REDACTED_IP]
[01-01 00:00:04 ty D][lr:0x9c779] DNS parse type:2
[01-01 00:00:04 ty D][lr:0x9c82f] bind port:0 ok
[01-01 00:00:05 ty E][lr:0x5b511] MAX SECURITY_LEVEL CONFIG ERROR: L->0,M->1
[01-01 00:00:05 ty E][lr:0x84847] tls transporter connect err:-2
[01-01 00:00:05 ty D][lr:0x84715] tls transporter close socket fd:1
[01-01 00:00:05 ty D][lr:0x9c8f5] tcp transporter close socket fd:1
[01-01 00:00:05 ty D][lr:0x8472f] tls transporter close tls handler:0x4252bc
[01-01 00:00:05 ty D][lr:0x5b827] TUYA_TLS Disconnect ENTER
[01-01 00:00:05 ty D][lr:0x5b877] TUYA_TLS Disconnect Success
[01-01 00:00:05 ty D][lr:0x76d99] Connect: [REDACTED_URL] Port: 7000 --<< ,r:-1
[01-01 00:00:05 ty D][lr:0x92cd1] Get Rssi:-63
[01-01 00:00:05 ty D][lr:0x8d8e3] url:[REDACTED_URL]
[01-01 00:00:05 ty D][lr:0x8d8f7] pstr:.[REDACTED_DOMAIN]
[01-01 00:00:05 ty D][lr:0x84715] tls transporter close socket fd:-1
[01-01 00:00:05 ty D][lr:0x84741] tls transporter already closed
[01-01 00:00:05 ty D][lr:0x5b4b3] tuya_tls_connect_destroy.
[01-01 00:00:05 ty D][lr:0x81559] lower_dns_cache_priority:0
[01-01 00:00:05 ty E][custom_http_client.c:321] Error opening HTTP session.(code: -1)

Steps to Reproduce:

  1. Attempt to establish an HTTPS connection to a non-Tuya server using the TuyaOS SDK.
  2. Observe the logs provided above.

Expected Behavior:

The HTTPS connection should be successfully established without errors.

Actual Behavior:

The connection attempt fails with the following error: Error opening HTTP session.(code: -1).

Environment Details:

  • TuyaOS SDK version: [3.9.0]
  • Device/Platform: [Beken7231n]
  • Server URL: [REDACTED_URL]

Additional Information:

  • I have confirmed that the server is reachable and operational as I have tested with python server.
  • I have verified the correctness of the server URL.
tuya_tls_config_t tls_config;
tls_config.mode = TUYA_TLS_SERVER_CERT_MODE;  // Example mode, adjust as needed
tls_config.hostname = host_uri;
tls_config.port = 7000;  // HTTPS port

// Set CA certificate (assuming CA_CERT is defined as per your previous definitions)
tls_config.ca_cert = CA_CERT;
tls_config.ca_cert_size = strlen(CA_CERT);

// Set timeout and other parameters as needed
tls_config.timeout = 10;  // Example timeout

// If you have client certificate and key, set them as follows:
tls_config.client_pkey = SSL_PRIVATE_KEY;
tls_config.client_pkey_size = strlen(SSL_PRIVATE_KEY);

/* Setup callbacks */
tls_config.f_send = send_callback;
tls_config.f_recv = recv_callback;
tls_config.exception_cb = event_callback;

// Open HTTP session with Tuya TLS configuration
int http_ret = http_open_session_with_config(&https_handle, host_uri, &tls_config, TLS_ENABLE, 0);

Proposed Solution:

Please investigate the logs provided and advise on any configuration changes or updates to the TuyaOS SDK that may be required to establish HTTPS connections to non-Tuya servers successfully and also explain what error this line is referring to specifically L->0 and M->0:

[01-01 00:00:05 ty E][lr:0x5b511] MAX SECURITY_LEVEL CONFIG ERROR: L->0,M->1
[01-01 00:00:05 ty E][lr:0x84847] tls transporter connect err:-2

how to connect bk7231 to my server

How can i connect BK7231 to my server? i found function "create_mqtt_hand" in mqtt_client.h in SDK folder but i could not find anywhere your examples call this function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.