8000 Does Trice support receiving trace data from an MCU over UDP or TCP? · Issue #528 · rokath/trice · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Does Trice support receiving trace data from an MCU over UDP or TCP? #528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
srgg opened this issue May 14, 2025 · 5 comments · May be fixed by #529
Open

Does Trice support receiving trace data from an MCU over UDP or TCP? #528

srgg opened this issue May 14, 2025 · 5 comments · May be fixed by #529

Comments

@srgg
Copy link
srgg commented May 14, 2025

I'm implementing Trice on an ESP32-S3 board and would like to send traces wirelessly over WiFi to a PC using either UDP or TCP.

In the documentation, I see support for various output methods like UART and RTT, but I couldn't find clear information about network protocols. I've set up Trice on my ESP32-S3 and have implemented a WiFi connection, but I'm not sure about the best way to send the trace data over the network.

I've successfully implemented Trice on my ESP32-S3 board with UDP transmission for the trace data. The ESP32-S3 is properly connected to WiFi and is sending Trice packets via UDP to my PC's IP address and port.

However, I can't figure out how to receive and decode these traces on the PC side.

@srgg
Copy link
Author
srgg commented May 15, 2025

Answering myself: UDP receiver wasn’t implemented — started working on it. Getting some packets from MCU, but clearly incomplete:

 ./trice log -p UDP4 -pf none -singleFraming    
May 15 00:04:51.250079  UDP4:       triceConfig.cpp    85       37_866 CYCLE_ERROR: 20 != 192  (count= 1 )
May 15 00:04:51.250130  UDP4:                                          err:len(p.B) = 0 < p.ParamSpace =  1 - ignoring package:
May 15 00:04:51.250130  UDP4: 
May 15 00:04:51.250130  UDP4: Hints:Baudrate? Encoding? Interrupt? Overflow? Parameter count? Format specifier? Password? til.json? Version?
May 15 00:04:51.250266  UDP4:                           0 4110,488_723 CYCLE_ERROR: 0 != 21  (count= 2 )
May 15 00:04:51.250273  UDP4:                                          CYCLE_ERROR: 245 != 1  (count= 3 )
May 15 00:04:51.250304  UDP4:                                          trice test: no args
May 15 00:04:51.250350  UDP4:       triceConfig.cpp    97       35_995 CYCLE_ERROR: 54 != 246  (count= 4 )
May 15 00:04:51.250354  UDP4:                                          err:len(p.B) = 0 < p.ParamSpace =  2 - ignoring package:
May 15 00:04:51.250354  UDP4: 
May 15 00:04:51.250354  UDP4: Hints:Baudrate? Encoding? Interrupt? Overflow? Parameter count? Format specifier? Password? til.json? Version?
May 15 00:04:52.288869  UDP4:       triceConfig.cpp    97        0_566 CYCLE_ERROR: 248 != 55  (count= 5 )
May 15 00:04:52.288892  UDP4:                                          err:len(p.B) = 0 < p.ParamSpace =  4 - ignoring package:
May 15 00:04:52.288892  UDP4: 
May 15 00:04:52.288892  UDP4: Hints:Baudrate? Encoding? Interrupt? Overflow? Parameter count? Format specifier? Password? til.json? Version?
May 15 00:04:53.312758  UDP4:                           0              CYCLE_ERROR: 86 != 249  (count= 6 )
May 15 00:04:53.312791  UDP4:                                          CYCLE_ERROR: 52 != 87  (count= 7 )
May 15 00:04:53.312865  UDP4:                                          CYCLE_ERROR: 98 != 53  (count= 8 )
May 15 00:04:54.234791  UDP4:                                          err:len(p.B) = 0 < p.ParamSpace =  2 - ignoring package:
May 15 00:04:54.234791  UDP4: 
May 15 00:04:54.234791  UDP4: Hints:Baudrate? Encoding? Interrupt? Overflow? Parameter count? Format specifier? Password? til.json? Version?
May 15 00:04:54.234858  UDP4:       triceConfig.cpp   101        0_610 CYCLE_ERROR: 249 != 99  (count= 9 )
May 15 00:04:54.234862  UDP4:                                          err:len(p.B) = 0 < p.ParamSpace =  8 - ignoring package:
May 15 00:04:54.234862  UDP4: 
May 15 00:04:54.234862  UDP4: Hints:Baudrate? Encoding? Interrupt? Overflow? Parameter count? Format specifier? Password? til.json? Version?
May 15 00:04:55.258889  UDP4:                           0 3168,727_048 CYCLE_ERROR: 154 != 250  (count= 10 )
May 15 00:04:55.258904  UDP4:                                          CYCLE_ERROR: 86 != 155  (count= 11 )
May 15 00:04:55.258981  UDP4:                                          CYCLE_ERROR: 52 != 87  (count= 12 )
May 15 00:04:55.259007  UDP4:                                          CYCLE_ERROR: 86 != 53  (count= 13 )

@srgg srgg changed the title Does Trice support sending traces over UDP/TCP from MCU Does Trice support receiving trace data from an MCU over UDP or TCP? May 16, 2025
@srgg
Copy link
Author
srgg commented May 16, 2025

A pull request has been opened to implement this feature #529. It adds IPv4 UDP support to enable receiving trace data from an MCU.

@rokath
Copy link
Owner
rokath commented May 16, 2025

Trice in the current version should be able to receive over TCP: https://github.com/rokath/trice/blob/master/docs/TriceUserManual.md#1327-tcp-input

Thanks a lot for the pull request. I am able to have a closer look only in June.

@srgg
Copy link
Author
srgg commented May 16, 2025

@rokath Thank you for the fantastic tool—really appreciate your work! June is fine (I'm using a self-built version for now).

I saw the example, but it looked like it was capturing from a COM port and forwarding to TCP. In my case, I'm just using a UDP receiver with no wired connection. Since UDP doesn't require a persistent connection, it's a good fit for telemetry or debug in the field.

For reference, here's the example I saw:

trice l -p COM3 -tcp 127.0.0.1:23

Oh, I see niw, another example:

trice l -p TCP4 -args "192.168.2.3:45678"

Thank you, that makes sense now.
Hopefully I didn’t miss this earlier—UDP is definitely a better fit for my use cases.

@rokath
Copy link
Owner
rokath commented May 16, 2025

Yes, you are right. Trice can transmit over TCP and also receive over TCP. But UDP is a good enrichment and I am looking forward to integrate your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0