https://github.com/openshwprojects/OpenBK7231T_App
https://github.com/openshwprojects/OpenBK7231T_App
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamIn obk_config.h:
#if PLATFORM_XR809
// Enabling the TuyaMCU drivers on XR809
#define ENABLE_DRIVER_TUYAMCU 1
//#define OBK_DISABLE_ALL_DRIVERS 1
In driver/drv_uart.c:
#if PLATFORM_XR809
#include "driver/chip/hal_uart.h"
//#include <hal_uart.h>
#endif
...
#elif PLATFORM_XR809
// Transferred across from OpenXR809-master\project\example\uart\main.c, uart_init()
#define UARTID UART1_ID
...
In uart_sendbyte(byte b):
#elif PLATFORM_XR809
// Adapted from OpenXR809-master\project\example\uart\main.c, uart_init()
// UARTID defined as UART1_ID
HAL_UART_Transmit_IT(UARTID, &b, 1);
...
In uart_inituart:
#elif PLATFORM_XR809
// Adapted from OpenXR809-master\project\example\uart\main.c, uart_init()
// HAL_Status status = HAL_ERROR;
UART_InitParam param;
param.baudRate = 115200; // XR809 sdk example: baud=115200
param.dataBits = UART_DATA_BITS_8;
param.stopBits = UART_STOP_BITS_1;
param.parity = UART_PARITY_NONE;
param.isAutoHwFlowCtrl = 0;
HAL_UART_Init(UARTID, ¶m);
//status = HAL_UART_Init(UARTID, ¶m);
//if (status != HAL_OK)
// printf("uart init error %d\n", status);
Getting a number of undefined references like:
../shared/src/cmnds/cmd_if.o: In function `getVoltage': C:\openxr809\project\oxr_sharedApp\gcc/../shared/src/cmnds/cmd_if.c:208: undefined reference to `DRV_GetReading')
Resulting in:
collect2.exe: error: ld returned 1 exit status
make: *** [../../../project/project.mk:204: oxr_sharedApp.axf] Error 1)cp -u oxr_sharedApp.bin ../image/xr809/app.bin
cp -u oxr_sharedApp_xip.bin ../image/xr809/app_xip.bin
cp -u -t ../image/xr809 ../../../bin/xr809/boot.bin ../../../bin/xr809/net.bin ../../../bin/xr809/net_ap.bin ../../../bin/xr809/wlan_bl.bin ../../../bin/xr809/wlan_fw.bin ../../../bin/xr809/wlan_sdd.bin
cd ../image/xr809 && \
chmod a+r *.bin && \
../../../../tools/mkimage.exe -O -c image_auto_cal.cfg -o xr_system.img
cfg string:
{
"magic" :"AWIH",
"version" :"0.3",
"OTA" :{"addr": "1024K", "size": "32K"},
"count" :8,
"section" :[
{"id": "0xa5ff5a00", "bin" :"boot.bin", "cert": "null", "flash_offs": "0K", "sram_offs": "0x00067000", "ep": "0x00067101", "attr":"0x1"},
{"id": "0xa5fe5a01", "bin" :"app.bin", "cert": "null", "flash_offs": "32K", "sram_offs": "0x00010000", "ep": "0x00010101", "attr":"0x1"},
{"id": "0xa5fd5a02", "bin" :"app_xip.bin", "cert": "null", "flash_offs": "222K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr":"0x2"},
{"id": "0xa5fc5a03", "bin" :"net.bin", "cert": "null", "flash_offs": "409K", "sram_offs": "0x60000000", "ep": "0xffffffff", "attr":"0x1"},
{"id": "0xa5fb5a04", "bin" :"net_ap.bin", "cert": "null", "flash_offs": "631K", "sram_offs": "0x60000000", "ep": "0xffffffff", "attr":"0x1"},
{"id": "0xa5fa5a05", "bin" :"wlan_bl.bin", "cert": "null", "flash_offs": "883K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr":"0x1"},
{"id": "0xa5f95a06", "bin" :"wlan_fw.bin", "cert": "null", "flash_offs": "886K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr":"0x1"},
{"id": "0xa5f85a07", "bin" :"wlan_sdd.bin", "cert": "null", "flash_offs": "1014K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr":"0x1"}
]
}
err: bin 1 and bin 2 were overlaped!
Overlapped size: 17732 Byte(18kB)
bin 1 name:app.bin begin: 0x00008000 end: 0x0003BD44
bin 2 name:app_xip.bin begin: 0x00037800
Bin files are too big, can't generat new cfg file!!
Generate image file failed
make: *** [../../../project/project.mk:260: image] Error 127TL;DR: Open-source XR809 firmware boots an ARM Cortex-M4F at 160 MHz and shrinks cloud ping time to <100 ms [Elektroda, p.kaczmarek2, post #19447386] “Writing this software was basically like assembling ready-made blocks.” [Elektroda, p.kaczmarek2, post #19447386] Why it matters: you gain privacy, local control and Home Assistant readiness in one flash.
• MCU: XR809 (ARM Cortex-M4F 160 MHz, 384 KB SRAM + 2 MB flash) [Elektroda, p.kaczmarek2, post #19447386] • Build size after strip: 208 KB app + 190 KB XIP segment (fits 1 MB partition) [Elektroda, elektroretro, post #20884388] • Programming: UART at 115 200 bps via phoenixMC.exe; PB02 & PB03 low during reset [Elektroda, p.kaczmarek2, post #19447386] • Power draw: <80 mA Wi-Fi TX; resets if battery <3 V [Elektroda, p.kaczmarek2, post #19447386] • Compatible APIs: Tasmota HTTP, MQTT, TuyaMCU (after ENABLE_DRIVER_TUYAMCU) [Elektroda, p.kaczmarek2, post #20882645]
mqtt_client_connect() in your init and publish payloads inside a timer. A 2 kB JSON sensor message every 30 s uses ≈4 KB RAM [Elektroda, p.kaczmarek2, post #19629281]#define ENABLE_DRIVER_TUYAMCU 1 and undefine OBK_DISABLE_ALL_DRIVERS in obk_config.h, plus include UART init in drv_uart.c [Elektroda, p.kaczmarek2, post #20882645]xr-ap-xxxxx, browse 192.168.51.1, enter SSID/pass, then reserve fixed IP in your router’s DHCP table [Elektroda, p.kaczmarek2, post #19447386]GPIO_InitParam param={.mode=GPIOx_Pn_F0_INPUT}; HAL_GPIO_Init(PORT_A, PIN_22,¶m); 2. Call state = HAL_GPIO_ReadPin(PORT_A,PIN_22); 3. Map HIGH/LOW to JSON ‘POWER1’ before sending HTTP reply [Elektroda, p.kaczmarek2, post #19447386]