Skip to content

missing data when upload data or download data with Version 5.x #894

Closed

Description

@renovictor

Hi dear developer,

I am big fan for teraterm. I have use teraterm for more than 10 years. I use teramterm to control our product. Some time I need download big data. Sometime I need upload big data to my product. I recently discovered that teraterm will loose couple lines data with version later than 5.x. I tried 5.5, 5.4, 5.3, 5.1. They all showed similar problem. They randomly loosing data. I tried 4.108, 4.106 and several 4.x. All of 4.x working reliable. There is some problem with 5.x. I discovered 5.x is faster. But not reliable.

Upload case:
When I upgrade my product firmware, I will use below code to load new firmware in binary.
; --------------------------------------------------------------------------- FW Start
sendln ':020000040000FA'
mpause 5
sendln ':0A000000600080FF04000000120001'
mpause 5
sendln ':04000A00EC00000006'
mpause 5
sendln ':20000E000000A0FFD6000000020000E8000066016701C0054DE1C0FF0DE100000F602FE680'
mpause 5
sendln ':20002E0049009061103E00E3360017606FE68A024CE101000CE1A086A2E0024000006FE461'
mpause 5
sendln ':20004E000E050749FD1387E110006FE60E0500E1970368E60C0507E125006FE60A0547E1CC'
mpause 5
sendln ':20006E00910007E18D992FE684024CE100000CE10400000027916FE40E051F49FD1BFF631A'
mpause 5
sendln ':20008E002FE6490080052701260101E800001000000000E800006601F5054DE1C0FF0DE103'
mpause 5
sendln ':2000AE00000007E100022FB62EA587E1FB003E08051836002FB520004600000007E105005D'
mpause 5
sendln ':2000CE00AFB42EA487E1802C3E08051836002FB4200046000000B505260101E8000010000D'

The whole size is around 1Mbyte. I use this way to upgrade my product in the past 10 years. I have never experience any problem until I use 5.x version. I put 5mS delay in between line. Like I said, I use this way for past 10 years.

download case:
Sometime I need download data from my product. Ususally I download 36MByte data with baud rate 230400bps. It roughly take me 27 minutes to complete download it. I recently found teramterm will loose several lines for this large file download. I have go back to 4.x. It's no problem at all.

Best regards,
Victor Huang

Activity

  1. zmatsuo commented on Oct 20, 2025

    @zmatsuo
    Member

    Thank you for reporting.
    We will investigate.

    We want to know where problem, so please tell us.

    Is it unreliable when sending files without using macros?

    With File > Send file...
    And file to be sent will be as follows.

    :020000040000FA
    :0A000000600080FF04000000120001
    :04000A00EC00000006
    :20000E000000A0FFD6000000020000E8000066016701C0054DE1C0FF0DE100000F602FE680
        :
        :
    
    Image

    Please try increasing per line delay.

  2. hkanou commented on Oct 20, 2025

    @hkanou
    Member

    Thank you for reporting the issue.
    I would like to reproduce the event for investigation purposes.
    Could you please provide information about the operating environment and the serial port settings, particularly the flow control?
    My environment is as follows, and I would appreciate it if you could provide such information.

    device
    
     Port  USB serial-cable  Controller         driver
     COM3  Elecom UC-SGT     PL-2303 XA / HXA   Prolific 3.3.11.152
     COM7  Elecom UC-SGT     PL-2303 TA         Elecom   3.4.62.294
    
    connection
    
     Windows 11 24H2
     Tera Term 5.5.0(64bit) - COM3 - USB serial-cable(PL-2303 XA / HXA) - null (cross) modem cable┐
     Tera Term 5.5.0(64bit) - COM7 - USB serial-cable(PL-2303 TA)       - null (cross) modem cable┘
    
    setting
    
     Speed        230400
     Data         8 bit
     Parity       none
     Stop bits    1bit
     Flow control Xon/Xoff, RTS/CTS, DSR/DTR, none
    
    macro
    
     connect '/C=1'
     setsync 1
     i = 0
     do while i < 100000
        i = i + 1
        sprintf2 str '%8d XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' i
        sendln str
        mpause 5
     loop
    
    test pattern
    
     230400 8-N-1 RTS/CTS  COM3 -> COM7 
     230400 8-N-1 DSR/DTR  COM3 -> COM7 
     230400 8-N-1 Xon/Xoff COM3 -> COM7 
     230400 8-N-1 None     COM3 -> COM7 
     ----------------------------------
     230400 8-N-1 RTS/CTS  COM3 <- COM7 N/A There is data loss, and receiving data at 230400 bps is difficult with PL-2303 XA / HXA. 
     230400 8-N-1 DSR/DTR  COM3 <- COM7 N/A There is data loss, and receiving data at 230400 bps is difficult with PL-2303 XA / HXA. 
     230400 8-N-1 Xon/Xoff COM3 <- COM7 N/A There is data loss, and receiving data at 230400 bps is difficult with PL-2303 XA / HXA. 
     230400 8-N-1 None     COM3 <- COM7 N/A There is data loss, and receiving data at 230400 bps is difficult with PL-2303 XA / HXA. 
    
  3. renovictor commented on Oct 21, 2025

    @renovictor
    Author
  4. renovictor commented on Oct 21, 2025

    @renovictor
    Author
  5. hkanou commented on Oct 21, 2025

    @hkanou
    Member

    Thank you for the information.
    It appears there were files attached, but when you reply to GitHub via email, the attachment is deleted and it can't view it.
    Could you please paste the attachment from the web or send an email to the Tera Term mailing list below?

    https://groups.io/g/TeraTerm
    TeraTerm@groups.io

    The storage locations for the configuration files are different between Tera Term 4.X and 5.X.
    For 4.X: C:\Program Files (x86)\teraterm\TERATERM.INI
    For 5.X: %APPDATA%\teraterm5\TERATERM.INI
    Could you please check if the settings are the same in both 4.X and 5.X, just to be sure?

  6. zmatsuo commented on Oct 22, 2025

    @zmatsuo
    Member

    Hi

    Tera Term 4 and 5 have different internal processing.
    Main difference is conversion from/to Unicode,
    And we are working to improve sending, receiving and rendering.

    Therefore,
    optimal delay value for your product is likely to differ between Tera Term 4 and Tera Term 5.
    I think that Tera Term 5 requires longer delay.

    Macro uses "mpause 5",
    Please increase delay per line to more than 5 ms.

    We need to know which part of Tera Term is causing problem.

    First, could you try sending a file using "file>sendfile.." with longer delay to check working correctly.
    And flow control information is also important.

  7. renovictor commented on Oct 22, 2025

    @renovictor
    Author
  8. renovictor commented on Oct 22, 2025

    @renovictor
    Author
  9. renovictor commented on Oct 22, 2025

    @renovictor
    Author
  10. hkanou commented on Oct 26, 2025

    @hkanou
    Member

    Thank you for sending emails to the Tera Term ML.
    I compared the behavior of Tera term 4.108 and Tera term 5.5.0-x86 with the following settings,
    but I was unable to reproduce the problem.
    I'll continue to try.

    Speed: 230400
    Data: 8bit
    Parity: none
    Stop bits: 1bit
    Flow control: none
    Transmit delay: 0 msec/char 0msec/line

    There is no flow control, so data may be lost at some point.
    If the connected device supports flow control, setting it may improve the situation.

  11. hkanou commented on Nov 6, 2025

    @hkanou
    Member

    I compared the operation of Tera Term v4 and v5.
    It seems that v5 has a higher GPU usage than v4.
    Tera Term generally processes the following tasks in a single-threaded manner, assuming that each task progresses smoothly:

    • Reading from serial devices
    • Log output
    • Screen display
    • Interaction with macros

    Therefore, if any of these tasks experience a high load, data loss may occur during reception.
    (Regarding data transmission, while delays may occur, data loss is unlikely.)

    As a countermeasure, I am considering adding a menu specialized for downloading as [File] menu - Receive file,
    and I am currently investigating whether reading from serial devices and file output can be processed in separate threads.

    Additionally, I found that data transmission and reception can stop under the following conditions:

    1. Holding down the left mouse button on the title bar without moving the mouse
    2. Displaying the toolbar menu
    3. Left-clicking on the display screen (client area)

    When performing operation 1 or 2, it seems that the control enters a modal loop handled by the OS itself, blocking the usual message loop, which prevents transmission and reception.
    I am considering calling the transmission and reception processes from a timer to ensure they occur even during the modal loop.


    in Japanese

    Tera Term v4とv5で動作を比較しました。
    v5はv4よりGPUの使用率が高いようです。
    Tera Termは、下記の処理を概ねシングルスレッドで処理しており、各処理がスムーズに進むことを想定しています。

    • シリアルデバイスの読み取り
    • ログ出力
    • 画面表示
    • マクロとのやりとり

    そのため、いずれかの負荷が高いと受信時にデータの欠落が発生します。
    (データ送信については、遅延は発生するもののデータの欠落は無いように思います)

    対応案として、ダウンロードに特化したメニューを [File]menu - Receive file として追加し、シリアルデバイスからの読み取りとファイル出力を別スレッドで処理出来ないか確認中です。

    その他、下記の場合にデータ送受信が停止することがわかりました。

    1. タイトルバーを左クリックしたままマウスを動かさない
    2. ツールバーのメニューを表示する
    3. 表示画面(クライアント領域)を左クリックする

    1.又は2.の操作を行うと制御をOS自身に渡すモーダルループに入り、通常のメッセージループがブロックされるため、送受信が行われないようです。
    モーダルループ中でも送受信処理が行われるよう、タイマーから送受信処理を呼び出すことを検討しています。

  12. 39 remaining items

  13. nmaya commented on Nov 30, 2025

    @nmaya
    Member

    わかりやすくなりました。ありがとうございます。

    ここのリンクがおかしいようです。

    <LI><A HREF="data_drop.html"></A>送受信データのドロップ</LI>
    
  14. hkanou commented on Nov 30, 2025

    @hkanou
    Member

    ここのリンクがおかしいようです。

    ありがとうございます、92c3cfc で修正させて頂きました。

  15. hkanou commented on Dec 2, 2025

    @hkanou
    Member

    Fixed to reduce data dropouts during serial connections.
    I have confirmed that no dropped data occurs in the following environment (except under extremely high load).

    • Communication speed: 819200 bps
    • Flow control: None
    • USB-to-serial conversion cable: Elecom UC-SGT (PL-2303 TA)
    • CPU: Intel N100

    The binary files used for testing are located at the following location:
    https://github.com/TeraTermProject/teraterm/actions/runs/19864973927
    Please let me know if you experience any issues with this binary.

  16. zmatsuo commented on Dec 4, 2025

    @zmatsuo
    Member

    chmの目次を追加しました。
    PRにPRを出せるのかよくわからず、ブランチ名を変えてpushしました。
    よければ取り込んでください。

  17. hkanou commented on Dec 4, 2025

    @hkanou
    Member

    ありがとうございます 🙏
    chmの目次の修正が漏れておりました。
    PR #968 に取り込ませて頂きます。

  18. hkanou commented on Dec 6, 2025

    @hkanou
    Member

    chmの目次を修正し、メインにマージさせて頂きました。
    本issueをクローズします。

  19. added a commit that references this issue on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions