xchoo 发表于 18-03-2021 21:26:59

Running software on Linux?

Edited by xchoo at 18-03-2021 21:29

Hi there!
I've been testing my CT-3 on windows and it's been working great so far. My primary goal is to use it to automatically log power data for USB devices connected to my machine. I would like to also get it running in a Linux operating system, but the typical approaches of using `wine` or `mono` do not appear to be working. Does anyone have any suggestions as to what I might try?

I took a peek at the csharp library, and it seems like communication is done over the serial port, but the communication protocol is quite complex. Is there a way to get the communication protocol schema so that I can reimplement it in Python or something?

Thanks!

yanke928 发表于 24-03-2021 21:39:08

Hi, sorry for the delay.

Unfortunately, we don't provide the protocol schema (decent amount of work to write the documentation).

I don't know the condition of wine or mono. But I guess there is a problem of detecting the device since the software use some windows APIs to detect the correct device (won't show any serial port blindly regardless of what kind of device it is).

So it's a very unfortunate stuck situation.

xchoo 发表于 10-04-2021 18:42:58

Hi! I managed to get it to run in Linux. :D

A note for the devs: I had to modify the ShizukuProtocol.dll code to fix an issue with the wrong value being set for `this.targetPort.BaudRate` (in the `_ShizukuProtocol` function). The original value was 11520000, and I corrected this to 115200. After doing this, everything worked without error on Linux. Before, it was giving an error about having an invalid speed.

For anyone else who works with Linux and is curious as to how to set this up:
1. Install WINE and winetricks: `apt install wine winetricks`
2. Configure your wine to be 32 bit: `WINEARCH=win32 winecfg`
3. Install dotnet45 in your wine environment: `winetricks dotnet45`
4. Add your user account to the `dialout` group: `usermod -aG dialout <username>`
5. Log out and log back into your account.
6. Add a serial port configuration for your wine environment: `wine regedit`
6a. Then go to: HKEY_LOCAL_MACHINE > Software > Wine > Ports , and add a string entry with the name "COM1" and the value "/dev/ttyACM0" (or whatever device the CT-3 gets mounted to)
7. Run your program with `wine <program_exe>`.

Note: The Shizuku app does start, but does not detect the serial port. You must write your own app using the ShizukuProtocol.dll extension.

xchoo 发表于 10-04-2021 18:45:48

Edited by xchoo at 11-04-2021 09:19

<deleted -- double post>

roger2k 发表于 03-05-2021 04:17:22

Nice!
I did not yet get my CT-3 to measure power consumption of my Thinkpad and my mobiles so have not looked deeper into host mode with Linux, but I plan to try out https://github.com/wellsaid/Py-AVHzY-CT-2 .

ldrakon 发表于 06-05-2021 10:52:26

static/image/common/user_online.gif roger2k static/image/common/clock.gif 03-05-2021 04:17
Nice!
I did not yet get my CT-3 to measure power consumption of my Thinkpad and my mobiles so have n ...

will not work

roger2k 发表于 08-05-2021 16:15:48

static/image/common/user_online.gif ldrakon static/image/common/clock.gif 06-05-2021 10:52
will not work

Can you share details?

ldrakon 发表于 09-05-2021 11:58:05

static/image/common/user_online.gif roger2k static/image/common/clock.gif 08-05-2021 16:15
Can you share details?

CT-3 does not react to this program in any way (apparently it has other commands)

mrspirytus 发表于 08-06-2021 17:58:41

Edited by mrspirytus at 12-06-2021 13:16

It would be great to even log data to csv file

EDIT: I see that the GUI app on windows can do this. Good. I still would like to have a command-line app at least on Linux.
Did the don't library work with Dotnet core 5? or is it older Dotnet framework Windows only?

页: [1]
查看完整版本: Running software on Linux?