connect MQTT with BK7231N chip

Wi-Fi devices, Wi-Fi low power devices, Wi-Fi BLE dual-mode devices, Ethernet devices, Ethernet+Wi-Fi devices and so on.


tuannguyen.aiot
Posts: 6

I use CBU module, BK7231N chip, with TuyaOS 3.8.1 platform
How to connect with MQTT. I have done programming but the result is still connect fail.
Does anyone have an example or documentation for this.
End goal: I want to connect with MQTT with SSL/TLS authentication

Thanks a lot!

Last edited by tuannguyen.aiot on 2023年 Nov 9日 16:29, edited 1 time in total.
tuannguyen.aiot
Posts: 6

Re: connect MQTT with BK7231N chip

Is there someone here?

愚者千虑必有一得
Posts: 508

Re: connect MQTT with BK7231N chip

Hi,

We have an MQTT client and use it to connect to Tuya Cloud's MQTT server. However, we have not exposed the interface. If you need to connect to another MQTT server, we would need to make preparations and provide you with an example.

tuannguyen.aiot
Posts: 6

Re: connect MQTT with BK7231N chip

How long can you provide an example of connecting to another MQTT server? I need to connect to MQTT with SSL/TLS security.

Last edited by tuannguyen.aiot on 2023年 Nov 23日 09:27, edited 2 times in total.
tuannguyen.aiot
Posts: 6

Re: connect MQTT with BK7231N chip

愚者千虑必有一得 2023年 Nov 14日 18:31

Hi,

We have an MQTT client and use it to connect to Tuya Cloud's MQTT server. However, we have not exposed the interface. If you need to connect to another MQTT server, we would need to make preparations and provide you with an example.

yes, I want to connect to another MQTT server, can you provide me with an example and documentation?

愚者千虑必有一得
Posts: 508

Re: connect MQTT with BK7231N chip

Hi,

We have discussed internally and concluded that the BK7231N platform currently does not support access to third-party MQTT servers. This is because the BK7231N only supports accessing the tuya MQTT server using the built-in PSK KEY. Unfortunately, this built-in PSK KEY cannot be used to access other MQTT servers.

tuannguyen.aiot
Posts: 6

Re: connect MQTT with BK7231N chip

Hello,
Can you provide me with documentation and samples to connect to MQTT typically using port 1883?

愚者千虑必有一得
Posts: 508

Re: connect MQTT with BK7231N chip

The attachment is a sample for a custom MQTT client. It shown how to connect to a custom MQTT server using domain, port, and signature. It also provides publishing and callback functions for receiving messages.

However, it cannot be used on the BK7231N chip because its TLS has been optimized and can only connect to the Tuya Cloud.

Attachments
custom_mqtt_client.c
(7.5 KiB) Downloaded 240 times
tuannguyen.aiot
Posts: 6

Re: connect MQTT with BK7231N chip

I connect mqtt and get error ret = -2;
https://drive.google.com/drive/folders/ ... drive_link

愚者千虑必有一得
Posts: 508

Re: connect MQTT with BK7231N chip

Please check if the parameters are valid.

企业微信截图_17019414494800.png
Post Reply