sudo apt update sudo apt install libfuse3-4 fuse3 libusb-1.0-0
Download cfnet-fs now.
Or, download directly to your target device using a terminal program like wget or curl.
wget https://downloads.comfiletech.com/CFNET/cfnet-fs/release/2.0.0/linux-arm64/cfnet-fs chmod +x cfnet-fs
Once downloaded, run the executable as illustrated below to create the virtual file system.
cfnet-fs {mount-point} {i2c1-device} {i2c2-device} {i2c3-device}
CFHEADER Mode (ComfilePi or Other ARM64 Linux Device)
cfnet-fs {mount-point} cfheader {cfheader-address}
While cfnet-fs is running, use ordinary file system utilities like ls or tree to navigate the file system at the mount point (e.g. /tmp/cfnet-fs).
$ tree /tmp/cfnet-fs/
├── analog-input
│ └── 0
│ └── channel
│ ├── 0
│ │ ├── amps.txt
│ │ ├── amps.bin
│ │ ├── volts.txt
│ │ └── volts.bin
│ ├── 1
│ │ ├── amps.txt
│ │ ├── amps.bin
│ │ ├── volts.txt
│ │ └── volts.bin
│ ...
├── analog-input
│ └── 1
│ └── channel
│ ├── 0
│ │ ├── amps.txt
│ │ ├── amps.bin
│ │ ├── volts.txt
│ │ └── volts.bin
│ ...
├── analog-output
│ └── 0
│ └── channel
│ ├── 0
│ │ ├── raw.txt
│ │ └── volts.txt
│ └── 1
│ ├── raw.txt
│ └── volts.txt
├── analog-output
│ └── 1
│ └── channel
│ ├── 0
│ │ ├── raw.txt
│ │ └── volts.txt
│ ...
├── digital-input
│ └── 0
│ ├── channel
│ │ ├── 0
│ │ │ ├── state.txt
│ │ │ └── state.bin
│ │ ├── 1
│ │ │ ├── state.txt
│ │ │ └── state.bin
│ │ ...
│ ├── state.txt
│ └── state.bin
├── digital-input
│ └── 1
│ ├── channel
│ │ ├── 0
│ │ │ ├── state.txt
│ │ │ └── state.bin
│ ...
└── digital-output
├── 0
│ ├── channel
│ │ ├── 0
│ │ │ ├── state.txt
│ │ │ └── state.bin
│ │ ├── 1
│ │ │ ├── state.txt
│ │ │ └── state.bin
│ │ ...
│ ├── state.txt
│ └── state.bin
└── 1
├── channel
│ ├── 0
│ │ ├── state.txt
│ │ └── state.bin
...
Automate the modules by simply reading from and writing to the files in the mount point.
echo 1 > /tmp/cfnet-fs/digital-output/0/channel/3/state.txt
File.WriteAllText("/tmp/cfnet-fs/digital-output/0/channel/3/state.txt", "1");
with open("/tmp/cfnet-fs/digital-output/0/channel/3/state.txt", "w") as f: f.write("1")