TuyaMCU on UART2 (BK7231N)
How to connect the TuyaMCU driver to the UART2 on BK7231N.
Enable flag 26 ([UART] Use alternate UART for BL0942, CSE, TuyaMCU, etc).
Interesting, it's the first time I see that. Is there really a device with TuyaMCU on log port?
This termostat
module not receive data from mcu on uart2, if i am conect mcu to uart1 all data received.
hello. I purchased the same thermostat. how can I make it work with OpenBK?
Hi. I don’t have time to fully understand it yet, but there is no response from MCU regarding UART2. I am connected MCU to UART1, baud rate 38400.
Please send your own /autoexec.bat
startDriver TuyaMCU startDriver NTP ntp_timeZoneOfs 3 tuyaMcu_setBaudRate 38400 uartSendHex 55AA000300010306 delay_s 20 tuyaMcu_sendCurTime
Hello; I have a the same issue, tring to use the UART2: I have an energy power meter with 2 BL0942 chips : one over UART 1 and an other over UART2: I can send data command by UART2 but I cannot receive data: did you solved ?
@LucaArena Hi, I have same device energy power meter with 2 BL0942 chips : one over UART 1 and an other over UART 2. Did You find the solution? On second uart i'm getting just zeroes.
Hi,
Yes I modified the driver to support both chips:
Actually I’m testing the solution over 3 devices: it works with good precision (< 1% ) of total energy accumulated:
Just a note about software driver implementation:
The Interrupt Service Routine over the 2nd UART does not correctly run, so I apply a patch with polling request a 1ms.
Cheers
Da: XJ @.> Inviato: lunedì 11 novembre 2024 19:56 A: openshwprojects/OpenBK7231T_App @.> Cc: LucaArena @.>; Mention @.> Oggetto: Re: [openshwprojects/OpenBK7231T_App] TuyaMCU on UART2 (BK7231N) (Issue #1258)
@LucaArena https://github.com/LucaArena Hi, I have same device energy power meter with 2 BL0942 chips : one over UART 1 and an other over UART 2. Did You find the solution? On second uart i'm getting just zeroes.
— Reply to this email directly, view it on GitHub https://github.com/openshwprojects/OpenBK7231T_App/issues/1258#issuecomment-2468835037 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BIMAVELP3FBT3PILKROFTMD2AD4UFAVCNFSM6AAAAABIYFLMF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRYHAZTKMBTG4 . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BIMAVEOIRHKZHXSRKMOAHM32AD4UFA5CNFSM6AAAAABIYFLMF2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUTE5XN2.gif Message ID: @.*** @.***> >
@LucaArena Thx, You're using uart_read_byte or test_ty_read_uart_data_to_buffer ?
I’m using test_ty_read_uart_data_to_buffer: anyway this function calls using uart_read_byte.
The power measures are ok: there is an issue on the total energy: sometime it saved a wrong big value!
Da: XJ @.> Inviato: martedì 12 novembre 2024 16:54 A: openshwprojects/OpenBK7231T_App @.> Cc: LucaArena @.>; Mention @.> Oggetto: Re: [openshwprojects/OpenBK7231T_App] TuyaMCU on UART2 (BK7231N) (Issue #1258)
@LucaArena https://github.com/LucaArena Thx, You're using uart_read_byte or test_ty_read_uart_data_to_buffer ?
— Reply to this email directly, view it on GitHub https://github.com/openshwprojects/OpenBK7231T_App/issues/1258#issuecomment-2470905119 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BIMAVEKVTCZVVKUHGBG3AW32AIQCVAVCNFSM6AAAAABIYFLMF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZQHEYDKMJRHE . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BIMAVEO7I4ZUAOVMO5E4LOT2AIQCVA5CNFSM6AAAAABIYFLMF2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUTI4CR6.gif Message ID: @.*** @.***> >
I use test_ty_read_uart_data_to_buffer: anyway, this function calls with uart_read_byte. >
I am not able to receive any data from the UART2 using these functions (but the data on the pin is coming if I test it with an external receiver]), Can you send me the changed code? I couldn't find it in your repo branches.
Hi,
Yes I had the same issue: the interrupt service for UART2 appends, but the data is not available in the register data input:
I changed the strategy, to read the data from UART2: instead of using interrupt, I use a polling: I check if any data is available every 1mS: is a patch ( not optimized )
Maybe you cannot find in the branch because is a part of platform ( I cannot remember )
Anyway, I ‘d like help you: how can I share the code? By Google Drive ?
I need time to create a good branch, so everyone could use.
Cheers
Da: XJ @.> Inviato: mercoledì 13 novembre 2024 09:45 A: openshwprojects/OpenBK7231T_App @.> Cc: LucaArena @.>; Mention @.> Oggetto: Re: [openshwprojects/OpenBK7231T_App] TuyaMCU on UART2 (BK7231N) (Issue #1258)
I use test_ty_read_uart_data_to_buffer: anyway, this function calls with uart_read_byte. >
I am not able to receive any data from the UART2 using these functions (but the data on the pin is coming if I test it with an external receiver]), Can you send me the changed code? I couldn't find it in your repo branches.
— Reply to this email directly, view it on GitHub https://github.com/openshwprojects/OpenBK7231T_App/issues/1258#issuecomment-2472859377 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BIMAVEOCNS3XC76EUAR45WD2AMGSBAVCNFSM6AAAAABIYFLMF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZSHA2TSMZXG4 . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BIMAVEIGB6WO3PBO7P74YXD2AMGSBA5CNFSM6AAAAABIYFLMF2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUTMTLPC.gif Message ID: @.*** @.***> >
I ‘d like help you: how can I share the code? By Google Drive ?>
Can You send me simply the changed files or code snippets? Or You can simpy use any network service like https://www.uschovna.cz/en/?set_lang=en (i'm using it fo years, no registration, just need email). Google drive is also ok.
@LucaArena I already found the solution, you don't need to send me anything.