====== Get Started Using cfnet-fs ======
==== 1. Install the Prerequisites ====
sudo apt update
sudo apt install libfuse3-4 fuse3 libusb-1.0-0
==== 2. Download the cfnet-fs Executable Program ====
[[cfnet-fs:download:index|Download cfnet-fs]] now.
Or, download directly to your target device using a terminal program like [[https://manpages.debian.org/trixie/wget/wget.1.en.html|wget]] or [[https://manpages.debian.org/trixie/curl/curl.1.en.html|curl]].
wget https://downloads.comfiletech.com/CFNET/cfnet-fs/release/2.0.0/linux-arm64/cfnet-fs
chmod +x cfnet-fs
==== 3. Execute cfnet-fs ====
Once downloaded, run the executable as illustrated below to create the virtual file system.
[[cfnet-fs:i2c:index|I²C Mode (e.g. Modular Pi)]]
cfnet-fs {mount-point} {i2c1-device} {i2c2-device} {i2c3-device}
[[cfnet-fs:cfheader:index|CFHEADER Mode (ComfilePi or Other ARM64 Linux Device)]]
cfnet-fs {mount-point} cfheader {cfheader-address}
==== 4. Interact with the File System at the Mount Point ====
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.
==== Example: Turning On Channel 3 of Digital Output Module 0 ====
=== Bash Script===
echo 1 > /tmp/cfnet-fs/digital-output/0/channel/3/state.txt
=== C# ===
File.WriteAllText("/tmp/cfnet-fs/digital-output/0/channel/3/state.txt", "1");
=== Python ===
with open("/tmp/cfnet-fs/digital-output/0/channel/3/state.txt", "w") as f:
f.write("1")
=== C/C++ ===
FILE *f = fopen("/tmp/cfnet-fs/digital-output/0/channel/3/state.txt", "w");
fputs("1", f);
fclose(f);