Compare commits

..
9 Commits
18 changed files with 1662 additions and 18 deletions

No files matched your search

+12 -10
View File
@@ -6,6 +6,15 @@ on:
RELEASE_TOKEN:
description: 'GitHub token for release creation'
required: true
FTP_PASSWORD:
description: 'FTP Password'
required: false
FTP_USER:
description: 'FTP User'
required: false
FTP_HOST:
description: 'FTP Host'
required: false
permissions:
contents: write
@@ -158,18 +167,11 @@ jobs:
- name: Upload Firmware via FTP
if: success()
env:
FTP_PASSWORD: ${{ vars.FTP_PASSWORD }}
FTP_USER: ${{ vars.FTP_USER }}
FTP_HOST: ${{ vars.FTP_HOST }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_USER: ${{ secrets.FTP_USER }}
FTP_HOST: ${{ secrets.FTP_HOST }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
echo "Environment variables:"
env | grep -E '^FTP_' | while read -r line; do
var_name=$(echo "$line" | cut -d= -f1)
var_value=$(echo "$line" | cut -d= -f2-)
echo "$var_name is $(if [ -n "$var_value" ]; then echo "set"; else echo "empty"; fi)"
done
cd .pio/build/esp32dev
if [ -n "$FTP_USER" ] && [ -n "$FTP_PASSWORD" ] && [ -n "$FTP_HOST" ]; then
echo "All FTP credentials are present, attempting upload..."
+3
View File
@@ -32,6 +32,9 @@ jobs:
uses: ./.github/workflows/github-release.yml
secrets:
RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_USER: ${{ secrets.FTP_USER }}
FTP_HOST: ${{ secrets.FTP_HOST }}
gitea-release:
needs: detect-provider
-7
View File
@@ -13,13 +13,8 @@
**/.Trashes
**/.fseventsd
.AppleDouble
.aider.chat.history.md
.aider.input.history
.DS_Store
.gitignore
.aider.tags.cache.v3/cache.db
.aider.tags.cache.v3/cache.db-shm
.aider.tags.cache.v3/cache.db-wal
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
@@ -28,7 +23,6 @@
include/README
lib/README
test/README
.aider*
# important
html/bambu_credentials.json
@@ -36,5 +30,4 @@ html/spoolman_url.json
_local/*
website/*
release.sh
.github/copilot-instructions.md
wiki
+43
View File
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FilaMan - Filament Management Tool</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
<script>
fetch('/api/version')
.then(response => response.json())
.then(data => {
const versionSpan = document.querySelector('.version');
if (versionSpan) {
versionSpan.textContent = 'v' + data.version;
}
})
.catch(error => console.error('Error fetching version:', error));
</script>
</head>
<body>
<div class="navbar">
<div style="display: flex; align-items: center; gap: 2rem;">
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
<a href="/">Start</a>
<a href="/waage">Scale</a>
<a href="/setup">Setup</a>
<a href="/upgrade">Upgrade</a>
</nav>
<div class="status-container">
<div class="status-item">
<span class="status-dot" id="filamanDot"></span>F
</div>
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
Binary file not shown.
+91
View File
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FilaMan - Filament Management Tool</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
<script>
fetch('/api/version')
.then(response => response.json())
.then(data => {
const versionSpan = document.querySelector('.version');
if (versionSpan) {
versionSpan.textContent = 'v' + data.version;
}
})
.catch(error => console.error('Error fetching version:', error));
</script>
</head>
<body>
<div class="navbar">
<div style="display: flex; align-items: center; gap: 2rem;">
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
<a href="/">Start</a>
<a href="/waage">Scale</a>
<a href="/config">Config</a>
<a href="/about">About</a>
<a href="/upgrade">Upgrade</a>
</nav>
<div class="status-container">
<div class="status-item">
<span class="status-dot" id="filamanDot"></span>F
</div>
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
<div class="content">
<h1>FilaMan</h1>
<p>Filament Management Tool</p>
<p>Your smart solution for <strong>Filament Management</strong> in 3D printing.</p>
<h2>About FilaMan</h2>
<p>
FilaMan is a tool designed to simplify filament spool management. It allows you to identify and weigh filament spools,
automatically syncing data with the FilaMan-System.
</p>
<p>Get more information at <a href="https://www.filaman.app" target="_blank">https://www.filaman.app</a>.</p>
<div class="features">
<div class="feature">
<h3>Spool Identification</h3>
<p>Easily identify filament spools using NFC tags.</p>
</div>
<div class="feature">
<h3>Automatic Syncing</h3>
<p>Seamlessly update spool data with the FilaMan API for accurate tracking.</p>
</div>
<div class="feature">
<h3>Scale Integration</h3>
<p>Built-in scale support for precise remaining weight calculation.</p>
</div>
</div>
</div>
<script>
let ws = null;
function connectWebSocket() {
ws = new WebSocket(`ws://${window.location.hostname}/ws`);
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'heartbeat') {
document.getElementById('filamanDot').style.backgroundColor = data.filaman_connected ? '#4caf50' : '#f44336';
document.getElementById('ramStatus').textContent = data.freeHeap + ' KB free';
}
};
ws.onclose = () => setTimeout(connectWebSocket, 2000);
}
connectWebSocket();
setInterval(() => { if(ws && ws.readyState === WebSocket.OPEN) ws.send(JSON.stringify({type:'heartbeat'})); }, 5000);
</script>
</body>
</html>
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
View File
Binary file not shown.
+87
View File
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FilaMan - Setup</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="navbar">
<div style="display: flex; align-items: center; gap: 2rem;">
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan</h1>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
<a href="/">Start</a>
<a href="/waage">Scale</a>
<a href="/setup">Setup</a>
<a href="/upgrade">Upgrade</a>
</nav>
</div>
<div class="content">
<h1>Device Setup</h1>
<div class="card">
<div class="card-body">
<h5 class="card-title">Registration</h5>
<p>Status: <strong>{{registered}}</strong></p>
<div class="form-group">
<label for="filamanUrl">FilaMan API URL:</label>
<input type="text" id="filamanUrl" class="form-control" value="{{filamanUrl}}" placeholder="http://192.168.1.10:8000">
</div>
<div class="form-group mt-2">
<label for="deviceCode">Registration Code (6 digits):</label>
<input type="text" id="deviceCode" class="form-control" maxlength="6" placeholder="123456">
</div>
<button id="registerBtn" class="btn btn-primary mt-3">Register Device</button>
<div id="statusMessage" class="mt-3"></div>
</div>
</div>
</div>
<script>
document.getElementById('registerBtn').addEventListener('click', () => {
const url = document.getElementById('filamanUrl').value;
const code = document.getElementById('deviceCode').value;
const statusMessage = document.getElementById('statusMessage');
if (!url || !code) {
statusMessage.innerHTML = 'Please provide both URL and Code';
statusMessage.className = 'alert alert-danger';
return;
}
statusMessage.innerHTML = 'Registering...';
statusMessage.className = 'alert alert-info';
fetch('/api/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: url, code: code })
})
.then(response => response.json())
.then(data => {
if (data.success) {
statusMessage.innerHTML = 'Registration successful! Rebooting...';
statusMessage.className = 'alert alert-success';
setTimeout(() => fetch('/reboot'), 2000);
} else {
statusMessage.innerHTML = 'Registration failed. Check code and URL.';
statusMessage.className = 'alert alert-danger';
}
})
.catch(error => {
console.error('Error:', error);
statusMessage.innerHTML = 'Network error.';
statusMessage.className = 'alert alert-danger';
});
});
</script>
</body>
</html>
Binary file not shown.
+1207
View File
File diff suppressed because it is too large. Load diff
BIN
View File
Binary file not shown.
+151
View File
@@ -0,0 +1,151 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FilaMan - Filament Management Tool</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
<script>
fetch('/api/version')
.then(response => response.json())
.then(data => {
const versionSpan = document.querySelector('.version');
if (versionSpan) {
versionSpan.textContent = 'v' + data.version;
}
})
.catch(error => console.error('Error fetching version:', error));
</script>
</head>
<body>
<div class="navbar">
<div style="display: flex; align-items: center; gap: 2rem;">
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
<a href="/">Start</a>
<a href="/waage">Scale</a>
<a href="/setup">Setup</a>
<a href="/upgrade">Upgrade</a>
</nav>
<div class="status-container">
<div class="status-item">
<span class="status-dot" id="filamanDot"></span>F
</div>
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
<div class="content">
<h1>Firmware Upgrade</h1>
<div class="warning">
<strong>Warning:</strong> Do not power off the device during update.
</div>
<div class="update-options">
<div class="update-section">
<h2>1) Firmware Update</h2>
<p>Upload a new firmware file (upgrade_filaman_firmware_*.bin)</p>
<div class="update-form">
<form id="firmwareForm" enctype='multipart/form-data' data-type="firmware">
<input type='file' name='update' accept='.bin' required>
<input type='submit' value='Start Firmware Update' class="btn btn-primary">
</form>
</div>
</div>
<div class="update-section">
<h2>2) Webpage Update</h2>
<p>Upload a new webpage file (upgrade_filaman_website_*.bin)</p>
<div class="update-form">
<form id="webpageForm" enctype='multipart/form-data' data-type="webpage">
<input type='file' name='update' accept='.bin' required>
<input type='submit' value='Start Webpage Update' class="btn btn-primary">
</form>
</div>
</div>
</div>
<div class="progress-container" style="display: none;">
<div class="progress-bar">0%</div>
</div>
<div class="status"></div>
</div>
<script>
const progress = document.querySelector('.progress-bar');
const progressContainer = document.querySelector('.progress-container');
const status = document.querySelector('.status');
let updateInProgress = false;
let lastReceivedProgress = 0;
// WebSocket Handling
let ws = null;
function connectWebSocket() {
ws = new WebSocket('ws://' + window.location.host + '/ws');
ws.onmessage = function(event) {
const data = JSON.parse(event.data);
if (data.type === "heartbeat") {
document.getElementById('filamanDot').style.backgroundColor = data.filaman_connected ? '#4caf50' : '#f44336';
document.getElementById('ramStatus').textContent = data.freeHeap + ' KB free';
}
if (data.type === "updateProgress" && updateInProgress) {
progressContainer.style.display = 'block';
const newProgress = parseInt(data.progress);
if (!isNaN(newProgress) && newProgress >= lastReceivedProgress) {
progress.style.width = newProgress + '%';
progress.textContent = newProgress + '%';
lastReceivedProgress = newProgress;
}
if (data.message) {
status.textContent = data.message;
status.style.display = 'block';
}
}
};
ws.onclose = () => setTimeout(connectWebSocket, 2000);
}
connectWebSocket();
function handleUpdate(e) {
e.preventDefault();
const form = e.target;
const file = form.update.files[0];
const updateType = form.dataset.type;
if (!file) return;
updateInProgress = true;
progressContainer.style.display = 'block';
status.style.display = 'none';
progress.style.width = '0%';
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = true);
const xhr = new XMLHttpRequest();
xhr.open('POST', '/update', true);
xhr.onload = function() {
if (xhr.status !== 200) {
status.textContent = "Update failed: " + xhr.responseText;
status.style.display = 'block';
updateInProgress = false;
document.querySelectorAll('form input[type=submit]').forEach(btn => btn.disabled = false);
}
};
const formData = new FormData();
formData.append('update', file);
xhr.send(formData);
}
document.getElementById('firmwareForm').addEventListener('submit', handleUpdate);
document.getElementById('webpageForm').addEventListener('submit', handleUpdate);
</script>
</body>
</html>
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FilaMan - Filament Management Tool</title>
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="style.css">
<script>
fetch('/api/version')
.then(response => response.json())
.then(data => {
const versionSpan = document.querySelector('.version');
if (versionSpan) {
versionSpan.textContent = 'v' + data.version;
}
})
.catch(error => console.error('Error fetching version:', error));
</script>
</head>
<body>
<div class="navbar">
<div style="display: flex; align-items: center; gap: 2rem;">
<img src="/logo.png" alt="FilaMan Logo" class="logo">
<div class="logo-text">
<h1>FilaMan<span class="version"></span></h1>
<h4>Filament Management Tool</h4>
</div>
</div>
<nav style="display: flex; gap: 1rem;">
<a href="/">Start</a>
<a href="/waage">Scale</a>
<a href="/setup">Setup</a>
<a href="/upgrade">Upgrade</a>
</nav>
<div class="status-container">
<div class="status-item">
<span class="status-dot" id="filamanDot"></span>F
</div>
<div class="ram-status" id="ramStatus"></div>
</div>
</div>
<div class="content">
<h1>WiFi Configuration</h1>
<p>Your device is connected to WiFi.</p>
<p>To change WiFi settings, you can reset the WiFi configuration by holding the hardware button (if available) or using the WiFi manager portal.</p>
</div>
<script>
let ws = null;
function connectWebSocket() {
ws = new WebSocket(`ws://${window.location.hostname}/ws`);
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'heartbeat') {
document.getElementById('filamanDot').style.backgroundColor = data.filaman_connected ? '#4caf50' : '#f44336';
document.getElementById('ramStatus').textContent = data.freeHeap + ' KB free';
}
};
ws.onclose = () => setTimeout(connectWebSocket, 2000);
}
connectWebSocket();
setInterval(() => { if(ws && ws.readyState === WebSocket.OPEN) ws.send(JSON.stringify({type:'heartbeat'})); }, 5000);
</script>
</body>
</html>
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[common]
version = "3.0.1"
version = "3.0.6"
to_old_version = "2.0.10"
##