diff --git a/.gitignore b/.gitignore index 1a4c25b..8a22a3c 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb +bin/ \ No newline at end of file diff --git a/3dprint/DESIGN.pdf b/3dprint/DESIGN.pdf new file mode 100644 index 0000000..23c41df Binary files /dev/null and b/3dprint/DESIGN.pdf differ diff --git a/README.pdf b/README.pdf new file mode 100644 index 0000000..9acd15c Binary files /dev/null and b/README.pdf differ diff --git a/docs/formulas.pdf b/docs/formulas.pdf new file mode 100644 index 0000000..aab7121 Binary files /dev/null and b/docs/formulas.pdf differ diff --git a/download-mdtopdf.ps1 b/download-mdtopdf.ps1 new file mode 100644 index 0000000..65e4bca --- /dev/null +++ b/download-mdtopdf.ps1 @@ -0,0 +1,42 @@ +# GitHub repository information +$RepoOwner = "Warky-Devs" +$RepoName = "go-mdtopdf-helper" +$GitHubApi = "https://api.github.com" + +# Determine architecture +$Arch = if ([Environment]::Is64BitOperatingSystem) { "x86_64" } else { "386" } + +# Get the latest release information +Write-Host "Fetching latest release information..." +$LatestRelease = Invoke-RestMethod -Uri "$GitHubApi/repos/$RepoOwner/$RepoName/releases/latest" +$Version = $LatestRelease.tag_name +$Version = $Version -replace '^v', '' # Remove 'v' prefix if present + +if (-not $Version) { + Write-Host "Failed to get latest version" + exit 1 +} + +# Construct the asset name with correct capitalization +$AssetName = "$RepoName`_$Version`_Windows_$Arch.zip" + +# Find the asset URL +$Asset = $LatestRelease.assets | Where-Object { $_.name -eq $AssetName } +if (-not $Asset) { + Write-Host "Failed to find download URL for $AssetName" + Write-Host "Looking for asset: $AssetName" + exit 1 +} + +# Create bin directory if it doesn't exist +New-Item -ItemType Directory -Force -Path "bin" | Out-Null + +# Download and extract the release +Write-Host "Downloading $AssetName..." +$ZipPath = "bin\$AssetName" +Invoke-WebRequest -Uri $Asset.browser_download_url -OutFile $ZipPath +Expand-Archive -Path $ZipPath -DestinationPath "bin" -Force +Remove-Item $ZipPath + +Write-Host "Successfully downloaded and installed go-mdtopdf-helper $Version" +Write-Host "Binary location: bin\go-mdtopdf-helper.exe" \ No newline at end of file diff --git a/download-mdtopdf.sh b/download-mdtopdf.sh new file mode 100644 index 0000000..df645ae --- /dev/null +++ b/download-mdtopdf.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +# GitHub repository information +REPO_OWNER="Warky-Devs" +REPO_NAME="go-mdtopdf-helper" +GITHUB_API="https://api.github.com" + +# Determine OS and architecture +OS=$(uname -s | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m) + +# Convert architecture names to match release naming +case "${ARCH}" in + x86_64) + ARCH="x86_64" + ;; + aarch64|arm64) + ARCH="arm64" + ;; + *) + echo "Unsupported architecture: ${ARCH}" + exit 1 + ;; +esac + +# Convert OS names to match release naming +case "${OS}" in + linux) + OS="Linux" + ;; + darwin) + OS="Darwin" + ;; + mingw*|msys*|cygwin*) + OS="Windows" + ;; + *) + echo "Unsupported operating system: ${OS}" + exit 1 + ;; +esac + +# Get the latest release information +echo "Fetching latest release information..." +LATEST_RELEASE=$(curl -s "${GITHUB_API}/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest") +VERSION=$(echo "${LATEST_RELEASE}" | grep -o '"tag_name": "[^"]*' | cut -d'"' -f4) +VERSION=${VERSION#v} # Remove 'v' prefix if present + +if [ -z "${VERSION}" ]; then + echo "Failed to get latest version" + exit 1 +fi + +# Construct the asset name +if [ "${OS}" = "Windows" ]; then + ASSET_NAME="${REPO_NAME}_${VERSION}_${OS}_${ARCH}.zip" +else + ASSET_NAME="${REPO_NAME}_${VERSION}_${OS}_${ARCH}.tar.gz" +fi + +# Get the download URL for the asset +ASSET_URL=$(echo "${LATEST_RELEASE}" | grep -o "\"browser_download_url\": \"[^\"]*${ASSET_NAME}\"" | cut -d'"' -f4) + +if [ -z "${ASSET_URL}" ]; then + echo "Failed to find download URL for ${ASSET_NAME}" + echo "Looking for asset: ${ASSET_NAME}" + exit 1 +fi + +# Create bin directory if it doesn't exist +mkdir -p bin + +# Download and extract the release +echo "Downloading ${ASSET_NAME}..." +if [ "${OS}" = "Windows" ]; then + curl -L "${ASSET_URL}" -o "bin/${ASSET_NAME}" + cd bin && unzip "${ASSET_NAME}" && rm "${ASSET_NAME}" +else + curl -L "${ASSET_URL}" | tar xz -C bin +fi + +# Make the binary executable on Unix-like systems +if [ "${OS}" != "Windows" ]; then + chmod +x "bin/go-mdtopdf-helper" +fi + +echo "Successfully downloaded and installed go-mdtopdf-helper ${VERSION}" +echo "Binary location: bin/go-mdtopdf-helper" \ No newline at end of file diff --git a/firmware/mega/mega-sd-mb-pm8000/mega-sd-mb-pm8000.pdf b/firmware/mega/mega-sd-mb-pm8000/mega-sd-mb-pm8000.pdf new file mode 100644 index 0000000..0ca3836 Binary files /dev/null and b/firmware/mega/mega-sd-mb-pm8000/mega-sd-mb-pm8000.pdf differ diff --git a/firmware/mega/mega-sd-mb-vsd-generic/mega-sd-mb-vsd-generic.pdf b/firmware/mega/mega-sd-mb-vsd-generic/mega-sd-mb-vsd-generic.pdf new file mode 100644 index 0000000..2bbcb6a Binary files /dev/null and b/firmware/mega/mega-sd-mb-vsd-generic/mega-sd-mb-vsd-generic.pdf differ diff --git a/firmware/mega/pinout.pdf b/firmware/mega/pinout.pdf new file mode 100644 index 0000000..f120b39 Binary files /dev/null and b/firmware/mega/pinout.pdf differ diff --git a/firmware/mega/troubleshoot.pdf b/firmware/mega/troubleshoot.pdf new file mode 100644 index 0000000..653f193 Binary files /dev/null and b/firmware/mega/troubleshoot.pdf differ diff --git a/firmware/uno/modbus-SIM808-pm8000/modbus-SIM808-pm8000.pdf b/firmware/uno/modbus-SIM808-pm8000/modbus-SIM808-pm8000.pdf new file mode 100644 index 0000000..2d9608b Binary files /dev/null and b/firmware/uno/modbus-SIM808-pm8000/modbus-SIM808-pm8000.pdf differ diff --git a/firmware/uno/modbus-sd-VSD-generic/modbus-sd-vsd.pdf b/firmware/uno/modbus-sd-VSD-generic/modbus-sd-vsd.pdf new file mode 100644 index 0000000..f33a5b1 Binary files /dev/null and b/firmware/uno/modbus-sd-VSD-generic/modbus-sd-vsd.pdf differ diff --git a/firmware/uno/modbus-sd-pm8000/manual.pdf b/firmware/uno/modbus-sd-pm8000/manual.pdf index c24c63a..fa6ce6c 100644 Binary files a/firmware/uno/modbus-sd-pm8000/manual.pdf and b/firmware/uno/modbus-sd-pm8000/manual.pdf differ diff --git a/firmware/uno/modbus-sd-pm8000/modbus-sd-pm8000.pdf b/firmware/uno/modbus-sd-pm8000/modbus-sd-pm8000.pdf new file mode 100644 index 0000000..caf5455 Binary files /dev/null and b/firmware/uno/modbus-sd-pm8000/modbus-sd-pm8000.pdf differ diff --git a/firmware/uno/modbus-sim800c-pm8000/modbus-sim800c-pm8000.pdf b/firmware/uno/modbus-sim800c-pm8000/modbus-sim800c-pm8000.pdf new file mode 100644 index 0000000..01ca97c Binary files /dev/null and b/firmware/uno/modbus-sim800c-pm8000/modbus-sim800c-pm8000.pdf differ diff --git a/firmware/uno/pinout.pdf b/firmware/uno/pinout.pdf new file mode 100644 index 0000000..6829138 Binary files /dev/null and b/firmware/uno/pinout.pdf differ diff --git a/testing/modbus-sd-VSD-generic-alt/modbus-sd-vsd.pdf b/testing/modbus-sd-VSD-generic-alt/modbus-sd-vsd.pdf new file mode 100644 index 0000000..f33a5b1 Binary files /dev/null and b/testing/modbus-sd-VSD-generic-alt/modbus-sd-vsd.pdf differ