Page 1 of 1

【已解决】zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:28
by wqvbdcb123

不管怎麽添加IO口配置,编译后config.h 内容还是一直不变,不知道这问题出现在哪里?

1.json

{
"fimwareInfo": {
"name": "switch1",
"description": "this is a project demo",
"version": "1.0.0",
"bv_version": "1.0",
"ic": "TLSR8258F1KET",
"ota_image_type":"0x1602",
"manufacture_id":"0x1002",
"model_id":"TS0001",
"pid": "dse8ogfy",
"manufacture_name": "TZ3000",
"module_name":"ZS3L_A"
},
"uartConfig": {
"uart_enable": "true",
"uart_num": 1,
"uart": [
{
"uart0_rx_port": "PORT_A",
"uart0_rx_pin": "PIN_0",
"uart0_rx_loc": "LOC_0",
"uart0_tx_port": "PORT_D",
"uart0_tx_pin": "PIN_7",
"uart0_tx_loc": "LOC_0",
"uart0_bandrate": 115200
}
]
},
"ioConfig": {
"led_enable": "true",
"led_num": 1,
"key_enable": "true",
"key_num": 2,
"power_enable": "true",
"power_num": 1,
"led": [
{
"led0_port": "PORT_B",
"led0_pin": "PIN_6",
"led0_mode": "GPIO_MODE_OUTPUT_PP",
"led0_out": "GPIO_DOUT_HIGH",
"led0_driver": "GPIO_DOUT_LOW"
}
],
"key": [
{
"key0_port": "PORT_C",
"key0_pin": "PIN_0",
"key0_mode": "GPIO_MODE_INPUT_PULL",
"key0_out": "GPIO_DOUT_HIGH",
"key0_driver": "GPIO_LEVEL_LOW"
},
{
"key1_port": "PORT_B",
"key1_pin": "PIN_7",
"key1_mode": "GPIO_MODE_INPUT_PULL",
"key1_out": "GPIO_DOUT_HIGH",
"key1_driver": "GPIO_LEVEL_LOW"
}
],
"power": [
{
"power0_port": "PORT_B",
"power0_pin": "PIN_5",
"power0_mode": "GPIO_MODE_OUTPUT_PP",
"power0_out": "GPIO_DOUT_LOW",
"power0_driver": "GPIO_DOUT_HIGH"
}
],
}
}

2.config.h
/**********************************************************************************/
/
Automatically-generated file. Do not edit! /
/
**********************************************************************************/
#ifndef CONFIG_H
#define CONFIG_H

#include "tuya_zigbee_sdk.h"
/* firmware information! */
#define FIRMWARE_INFO "switch1_1.0.0"
#define FIRMWARE_NAME "switch1"
#define FIRMWARE_VER 0x40
#define PRODUCTOR_ID_PFEFIX "TZ3000"
#define IC "TLSR8258F1KET"
#define OTA_IMAGE_TYPE 0x1602
#define MODULE_NAME ZS3L_A
#define MODEL_ID "TS0001"
#define PRODUCTOR_ID "dse8ogfy"

/* uart config! */
#define UART_ENABLE true
#define UART_NUM 0x1

#define UART0_RX_PORT PORT_A
#define UART0_RX_PIN PIN_0
#define UART0_RX_LOC LOC_0
#define UART0_TX_PORT PORT_D
#define UART0_TX_PIN PIN_7
#define UART0_TX_LOC LOC_0
#define UART0_BANDRATE 115200

/* io config! /
/
led config! */
#define LED0_PORT PORT_B
#define LED0_PIN PIN_6
#define LED0_MODE GPIO_MODE_OUTPUT_PP
#define LED0_OUT GPIO_DOUT_HIGH
#define LED0_DRIVER GPIO_DOUT_LOW

/* io config! /
/
key config! */
#define KEY0_PORT PORT_C
#define KEY0_PIN PIN_0
#define KEY0_MODE GPIO_MODE_INPUT_PULL
#define KEY0_OUT GPIO_DOUT_HIGH
#define KEY0_DRIVER GPIO_LEVEL_LOW

#define KEY1_PORT PORT_B
#define KEY1_PIN PIN_7
#define KEY1_MODE GPIO_MODE_INPUT_PULL
#define KEY1_OUT GPIO_DOUT_HIGH
#define KEY1_DRIVER GPIO_LEVEL_LOW

#endif


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:33
by iot_man

io配置已废弃


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:41
by wqvbdcb123

那要怎么解决这个问题?


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:45
by 白芷冉然

tuyaos还是sdk开发?什么版本呢?


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:45
by iot_man

应用开发需要什么GPIO功能,在程序里面开发,json不会有driver的功能


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:47
by wqvbdcb123

tuya-zigbee-sdk-tlsr8258 telink zigbee SDK 1.0.2:


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:51
by wqvbdcb123

就是想通过Json来在 config.h 中自动生成相应的 IO 宏定义,现在不管怎么添加,编译后 config.h 的宏定义还是不变!这主要是什么问题?要怎么去解决这个问题呢?


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 11:52
by 白芷冉然

从已知的信息来看,是json中的 power关键字没有解析,建议采用以下几种方案:
1.在应用程序中添加配置管脚信息,不再json中修改
2.修改project路径下的pre-build-telink.py或是pre-build.py脚本,添加“power”关键字解析
3.将power关键字中管脚信息通过另外关键字实现,比如led或是key


Re: zigbee8285修改package.json問題

Posted: 2022年 Dec 16日 13:43
by wqvbdcb123

可以了,謝謝!