Skip to content

Commit d84ab62

Browse files
committed
Merge PR #8: Fixes and Improvements
2 parents 72aadb2 + 33bbab4 commit d84ab62

12 files changed

Lines changed: 7459 additions & 1864 deletions

CLAUDE.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
FlashForgeWebUI is a standalone web-based interface for controlling and monitoring FlashForge 3D printers. It was ported from the FlashForgeUI-Electron project (located at `C:\Users\Cope\Documents\GitHub\FlashForgeUI-Electron`) to create a lightweight deployment option for low-spec devices like Raspberry Pi, without Electron dependencies.
7+
FlashForgeWebUI is a standalone web-based interface for controlling and monitoring FlashForge 3D printers. It provides a lightweight deployment option for low-spec devices like Raspberry Pi, without Electron dependencies.
88

9-
**Current Status**: Initial porting is complete but not fully tested. Some bugs are expected.
9+
**Current Status**: Production-ready. Core functionality tested and working including multi-printer support, Spoolman integration, and cross-platform binary distribution.
1010

1111
## Build & Development Commands
1212

@@ -278,19 +278,19 @@ class Service extends EventEmitter<EventMap> {
278278

279279
## Testing Notes
280280

281-
Initial porting is complete but **not fully tested**. Known areas to test:
281+
Core functionality has been tested and verified:
282282
- Multi-printer context switching
283-
- Camera proxy stability under load
284-
- RTSP streaming for supported printers
285283
- Spoolman integration (filament tracking)
286-
- Print state monitoring and notifications
287-
- Temperature anomaly detection
288-
- Different printer model backends (AD5X, 5M, 5M Pro, legacy)
284+
- Platform-specific binary builds (Linux ARM, Linux x64, Windows, macOS)
289285
- WebUI authentication
290-
- Platform-specific builds (Linux ARM, Windows, macOS)
286+
- Static file serving in packaged binaries
287+
288+
Areas for continued testing:
289+
- Camera proxy stability under extended load
290+
- RTSP streaming for all supported printers
291+
- Temperature anomaly detection edge cases
291292

292293
## Related Projects
293294

294-
- **FlashForgeUI-Electron**: Parent project with full Electron desktop app (`C:\Users\Cope\Documents\GitHub\FlashForgeUI-Electron`)
295295
- **@ghosttypes/ff-api**: FlashForge API client library (public package)
296296
- **@parallel-7/slicer-meta**: Printer metadata and model utilities (public package)

README.md

Lines changed: 120 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -122,61 +122,159 @@ FlashForge WebUI supports a wide range of FlashForge printers through its adapta
122122

123123
<div align="center">
124124

125+
**Pre-built Binaries**
126+
127+
</div>
128+
129+
Download the appropriate binary for your platform from the [Releases](https://github.com/Parallel-7/FlashForgeWebUI/releases) page:
130+
131+
| Platform | Binary | Notes |
132+
|----------|--------|-------|
133+
| Windows x64 | `flashforge-webui-win-x64.exe` | Most Windows PCs |
134+
| macOS x64 | `flashforge-webui-macos-x64` | Intel Macs |
135+
| macOS ARM | `flashforge-webui-macos-arm64` | Apple Silicon (M1/M2/M3) |
136+
| Linux x64 | `flashforge-webui-linux-x64` | Most Linux PCs |
137+
| Linux ARM64 | `flashforge-webui-linux-arm64` | Raspberry Pi 4/5 (64-bit OS) |
138+
| Linux ARMv7 | `flashforge-webui-linux-armv7` | Raspberry Pi 3/4 (32-bit OS) |
139+
140+
**Raspberry Pi Users:** Use `flashforge-webui-linux-arm64` for 64-bit Raspberry Pi OS, or `flashforge-webui-linux-armv7` for 32-bit.
141+
142+
```bash
143+
# Make the binary executable (Linux/macOS)
144+
chmod +x flashforge-webui-linux-arm64
145+
146+
# Run with auto-connect to last used printer
147+
./flashforge-webui-linux-arm64 --last-used
148+
149+
# Run without auto-connect
150+
./flashforge-webui-linux-arm64 --no-printers
151+
```
152+
153+
<div align="center">
154+
125155
**Running from Source**
126156

127157
</div>
128158

129159
```bash
130160
# Clone the repository
131-
git clone https://github.com/Parallel-7/flashforge-webui.git
132-
cd flashforge-webui
161+
git clone https://github.com/Parallel-7/FlashForgeWebUI.git
162+
cd FlashForgeWebUI
133163

134164
# Install dependencies
135165
npm install
136166

137-
# Build the application
167+
# Build the application (required before first run)
138168
npm run build
139169

140170
# Start the server
141171
npm start
172+
173+
# Or start with auto-connect to last used printer
174+
npm start -- --last-used
175+
```
176+
177+
**Development Mode:**
178+
```bash
179+
# Build and watch for changes with hot reload
180+
npm run dev
142181
```
143182

183+
<div align="center">
184+
<h2>Usage</h2>
185+
</div>
186+
187+
After starting the server, open your browser and navigate to:
188+
189+
```
190+
http://localhost:3000
191+
```
192+
193+
Or if accessing from another device on your network:
194+
195+
```
196+
http://<server-ip>:3000
197+
```
198+
199+
**Default Login:** The default password is `changeme`. You should change this in `data/config.json` or via the `--webui-password` flag.
200+
201+
<div align="center">
202+
<h2>Command Line Options</h2>
203+
</div>
204+
205+
| Option | Description |
206+
|--------|-------------|
207+
| `--last-used` | Connect to the last used printer on startup |
208+
| `--all-saved-printers` | Connect to all saved printers on startup |
209+
| `--printers="IP:TYPE:CODE,..."` | Connect to specific printers (TYPE: "new" or "legacy") |
210+
| `--no-printers` | Start WebUI only, without connecting to any printer |
211+
| `--webui-port=PORT` | Override the WebUI port (default: 3000) |
212+
| `--webui-password=PASS` | Override the WebUI password |
213+
144214
<div align="center">
145215
<h2>Configuration</h2>
146216
</div>
147217

148218
<div align="center">
149219

150-
The application automatically creates a configuration file at `data/config.json` on first run. You can modify this file to customize your experience.
220+
The application automatically creates a configuration file at `data/config.json` on first run.
151221

152222
</div>
153223

154-
```json
155-
{
156-
"WebUIEnabled": true,
157-
"WebUIPort": 3000,
158-
"WebUIPassword": "changeme",
159-
"WebUIPasswordRequired": true,
160-
"SpoolmanEnabled": false,
161-
"SpoolmanServerUrl": "http://your-spoolman-instance:7912",
162-
"CameraProxyPort": 8181
163-
}
164-
```
224+
| Setting | Default | Description |
225+
|---------|---------|-------------|
226+
| `WebUIEnabled` | `true` | Enable/disable the web interface |
227+
| `WebUIPort` | `3000` | Port for the web server |
228+
| `WebUIPassword` | `changeme` | Login password (change this!) |
229+
| `WebUIPasswordRequired` | `true` | Require password to access |
230+
| `SpoolmanEnabled` | `false` | Enable Spoolman integration |
231+
| `SpoolmanServerUrl` | `""` | Your Spoolman server URL (e.g., `http://192.168.1.100:7912`) |
232+
| `CameraProxyPort` | `8181` | Starting port for camera proxies |
165233

166234
<div align="center">
167-
<h2>Development</h2>
235+
<h2>Building from Source</h2>
168236
</div>
169237

170238
```bash
171-
# Start development server with hot-reload
172-
npm run dev
173-
174239
# Build for specific platform
175-
npm run build:linux
176-
npm run build:win
177-
npm run build:mac
240+
npm run build:linux # Linux x64
241+
npm run build:linux-arm # Linux ARM64 (Raspberry Pi 4/5)
242+
npm run build:linux-armv7 # Linux ARMv7 (Raspberry Pi 3)
243+
npm run build:win # Windows x64
244+
npm run build:mac # macOS x64
245+
npm run build:mac-arm # macOS ARM (Apple Silicon)
178246
```
179247

248+
<div align="center">
249+
<h2>Troubleshooting</h2>
250+
</div>
251+
252+
**"Cannot GET /" or blank page when accessing WebUI:**
253+
- If running from source: Make sure you ran `npm run build` before `npm start`
254+
- If using a pre-1.0.2 binary: Update to version 1.0.2 or later (fixes static file serving bug)
255+
256+
**"Permission denied" when running binary:**
257+
```bash
258+
chmod +x flashforge-webui-linux-*
259+
```
260+
261+
**Port already in use:**
262+
- Change the port in `data/config.json` or use `--webui-port=3001`
263+
264+
**Cannot connect to printer:**
265+
- Ensure your printer is on the same network as the device running WebUI
266+
- Check that the printer's IP address is correct
267+
- For legacy printers, ensure TCP port 8899 is accessible
268+
269+
**Selecting the correct binary for your platform:**
270+
- Windows: `flashforge-webui-win-x64.exe`
271+
- macOS Intel: `flashforge-webui-macos-x64`
272+
- macOS Apple Silicon: `flashforge-webui-macos-arm64`
273+
- Linux x64: `flashforge-webui-linux-x64`
274+
- Raspberry Pi (64-bit OS): `flashforge-webui-linux-arm64`
275+
- Raspberry Pi (32-bit OS): `flashforge-webui-linux-armv7`
276+
- Check your architecture with `uname -m` (x86_64 = x64, aarch64 = ARM64, armv7l = ARMv7)
277+
180278
<div align="center">
181279
<h2>License</h2>
182280
</div>

jest.config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/**
2+
* Jest configuration for FlashForgeWebUI
3+
*/
4+
5+
module.exports = {
6+
preset: 'ts-jest/presets/default-esm',
7+
testEnvironment: 'node',
8+
roots: ['<rootDir>/src'],
9+
testMatch: [
10+
'**/?(*.)+(spec|test).ts'
11+
],
12+
testPathIgnorePatterns: [
13+
'<rootDir>/src/__tests__/setup.ts'
14+
],
15+
transform: {
16+
'^.+\\.ts$': ['ts-jest', {
17+
useESM: true,
18+
}],
19+
},
20+
collectCoverageFrom: [
21+
'src/**/*.ts',
22+
'!src/**/*.d.ts',
23+
'!src/webui/static/**/*.ts',
24+
'!src/**/*.test.ts',
25+
'!src/**/*.spec.ts',
26+
'!src/__tests__/**',
27+
],
28+
coverageDirectory: 'coverage',
29+
coverageReporters: [
30+
'text',
31+
'lcov',
32+
'html'
33+
],
34+
moduleNameMapper: {
35+
'^@/(.*)$': '<rootDir>/src/$1',
36+
},
37+
moduleFileExtensions: ['ts', 'js', 'json'],
38+
verbose: true,
39+
testTimeout: 10000,
40+
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
41+
extensionsToTreatAsEsm: ['.ts'],
42+
};

0 commit comments

Comments
 (0)