taetcheson 发表于 16-10-2020 05:52:48

CT-3 - Serial or TCP interface

I bought the CT-3 to use for functional testing of USB devices in a production line environment. I need to be able to read the instantaneous voltage and current from the device into another app with minimal input from the user.

I read somewhere that the CT-2 has a COM port interface where you can send "Get Meter Data" and receive the data back in binary format. This would have been perfect for my situation. Unfortunately, the CT-3 does not seem to have this capability, since I don't get any response on the COM port.

I have been able to use the Lua tcp (which seems customized and is undocumented except for in the sample Lua script) to send information over TCP, but unfortunately it seems the only way to initialize the TCP socket is by using the Shizuku System Box app and starting the Lua TCP port by clicking the Play button. I need to know how to create the TCP port automatically without using the app.

Similarly, I have been able to use the Lua print() function to print to the Terminal within the app, but I can't figure out how to get that data out to another app.

Please provide some more documentation on automation using either the serial interface or TCP.

yanke928 发表于 16-10-2020 06:14:05

First about lua TCP: It won't work with print() function, sending data over TCP requires another sets of API which is not documented in English so far. However, you can easily understand functions just by a glance of their prototype, Chinese doc version: https://yk-lab.org:666/shizuku/lua-api/lua-api-zh-cn/Modules/tcp.html

Also, sending data over VCP of USB, forwarding by Shizuku System Box to TCP is so complicated, I'd recommend you to try C# API to communicate with the meter directly. However this part is also not well documented yet. You can have a look in the attachment, it should be able to get you started with comments.

These documentations will be completed (maybe slowly).

taetcheson 发表于 16-10-2020 12:12:18

Thank you! The C# library is exactly what I needed, since my application is in C#. I ended up using the ShizukuProtocol.CallerDescriptor.Callback_t to get the data I needed.
页: [1]
查看完整版本: CT-3 - Serial or TCP interface