Skip to content

Commit 0d85a3d

Browse files
committed
update server readme
1 parent 13fc82c commit 0d85a3d

1 file changed

Lines changed: 46 additions & 48 deletions

File tree

go-server/README.md

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1+
<div align="center">
2+
13
# CCU3 MUI Go Server
24

3-
Go implementation of the WebSocket server for the CCU3 MUI Add-on.
5+
[![Go](https://img.shields.io/badge/Go-00ADD8?style=for-the-badge&logo=go&logoColor=white)](https://golang.org/)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](../LICENSE)
7+
8+
**High-performance, static WebSocket server implementation for the CCU3 MUI Add-on.**
9+
10+
</div>
411

5-
## Why Go?
12+
---
13+
14+
## ⚡ Why Go?
615

716
| Feature | Node.js | Go |
817
|---------|---------|-----|
9-
| Binary Size | 71 MB | 5-10 MB |
10-
| RAM Usage | 30-50 MB | 5-15 MB |
11-
| Dependencies | GLIBC 2.24+ | None (static) |
12-
| Startup Time | 1-2 seconds | <100ms |
13-
| Platform Support | Limited by GLIBC | Universal |
14-
15-
## Features
16-
17-
**Identical functionality** to Node.js server:
18-
- WebSocket server for client connections
19-
- XML-RPC server for CCU event callbacks
20-
- XML-RPC clients for BidCos-RF and HmIP-RF
21-
- Rega script execution via HTTP
22-
- Device-based channel subscriptions
23-
- Event filtering and broadcasting
24-
- Basic authentication support
25-
- Node-RED compatibility (plain text Rega scripts)
26-
27-
## Building
18+
| **Binary Size** | 71 MB | **5-10 MB** |
19+
| **RAM Usage** | 30-50 MB | **5-15 MB** |
20+
| **Dependencies** | GLIBC 2.24+ | **None (static)** |
21+
| **Startup Time** | 1-2 seconds | **<100ms** |
22+
| **Platform Support** | Limited by GLIBC | **Universal** |
23+
24+
## 🏗️ Building
2825

2926
### Local Development
3027
```bash
@@ -38,16 +35,16 @@ make build-ccu3
3835
```
3936

4037
This creates a **statically linked** binary with no dependencies:
41-
- No Node.js runtime needed
42-
- No GLIBC version requirements
43-
- Runs on old Linux kernels (CCU3)
38+
- No Node.js runtime needed
39+
- No GLIBC version requirements
40+
- Runs on old Linux kernels (CCU3)
4441

4542
### Install to Addon
4643
```bash
4744
make install-addon
4845
```
4946

50-
## Binary Size Comparison
47+
## 📦 Binary Size Comparison
5148

5249
```bash
5350
make size
@@ -62,7 +59,7 @@ ccu-addon-mui-server-arm 7.2M (CCU3)
6259

6360
Compare to Node.js: **71 MB****~90% smaller!**
6461

65-
## Configuration
62+
## ⚙️ Configuration
6663

6764
### Using .env File
6865

@@ -94,11 +91,12 @@ DEBUG=false # Enable debug logging
9491
| `CALLBACK_HOST` | 127.0.0.1 | Callback IP for CCU |
9592
| `DEBUG` | false | Enable debug logging |
9693

97-
**Important for CALLBACK_HOST:**
98-
- When running on the CCU3: Use `127.0.0.1`
99-
- When running on a separate machine: Use the **actual IP** of that machine that the CCU3 can reach (e.g., `192.168.178.134`)
94+
> [!IMPORTANT]
95+
> **CALLBACK_HOST**:
96+
> - When running on the CCU3: Use `127.0.0.1`
97+
> - When running on a separate machine: Use the **actual IP** of that machine (e.g., `192.168.178.134`)
10098
101-
## Testing
99+
## 🧪 Testing
102100

103101
### Quick Local Testing
104102

@@ -109,9 +107,9 @@ chmod +x test-local.sh
109107
```
110108

111109
The script will:
112-
- Load settings from `.env` file if present
113-
- Build the local binary
114-
- Start the server with test configuration
110+
1. Load settings from `.env` file if present
111+
2. Build the local binary
112+
3. Start the server with test configuration
115113

116114
### Manual Testing
117115

@@ -120,21 +118,21 @@ Run on your development machine:
120118
CCU_HOST=192.168.178.111 DEBUG=true make run
121119
```
122120

123-
## Deployment to CCU3
121+
## 🚀 Deployment to CCU3
124122

125-
1. Build for ARM:
126-
```bash
127-
make build-ccu3
128-
```
123+
1. **Build for ARM**:
124+
```bash
125+
make build-ccu3
126+
```
129127

130-
2. Copy to CCU3:
131-
```bash
132-
scp ccu-addon-mui-server-arm root@ccu3-ip:/usr/local/addons/mui/server/
133-
```
128+
2. **Copy to CCU3**:
129+
```bash
130+
scp ccu-addon-mui-server-arm root@ccu3-ip:/usr/local/addons/mui/server/
131+
```
134132

135133
3. Update rc.d script to use Go binary instead of Node.js
136134

137-
## Project Structure
135+
## 📂 Project Structure
138136

139137
```
140138
go-server/
@@ -152,14 +150,14 @@ go-server/
152150
└── README.md # This file
153151
```
154152
155-
## Dependencies
153+
## 🧩 Dependencies
156154
157155
- `github.com/gorilla/websocket` - WebSocket implementation
158156
- `github.com/kolo/xmlrpc` - XML-RPC client/server
159157
160-
All dependencies are vendored into the static binary.
158+
*All dependencies are vendored into the static binary.*
161159
162-
## Cross-Compilation
160+
## 🛠️ Cross-Compilation
163161
164162
The Makefile uses these settings for CCU3:
165163
```bash
@@ -171,7 +169,7 @@ GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0
171169
- `-ldflags="-s -w"`: Strip debug info for smaller binary
172170
- `-tags netgo`: Pure Go DNS resolver (no libc)
173171

174-
## Advantages for CCU3
172+
## Advantages for CCU3
175173

176174
1. **No Node.js dependency** - CCU3 has limited storage
177175
2. **Works on old GLIBC** - CCU3 has Debian with GLIBC 2.24
@@ -180,7 +178,7 @@ GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0
180178
5. **Faster startup** - Better UX when addon starts
181179
6. **Single binary** - No node_modules, no complications
182180

183-
## Performance
181+
## 📈 Performance
184182

185183
Expected resource usage on CCU3:
186184
- **Memory**: ~8-12 MB (vs 40-60 MB Node.js)

0 commit comments

Comments
 (0)