Skip to content

Commit e8d35d0

Browse files
authored
Merge pull request #4 from soulteary/docs/update-docs
docs: update docs
2 parents ce54f11 + cd09f59 commit e8d35d0

File tree

3 files changed

+187
-3
lines changed

3 files changed

+187
-3
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
<program> Copyright (C) <year> <name of author>
655+
CAN-FINDER Copyright (C) 2025 LinkerBot,Ltd.
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.

README.md

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,93 @@
1-
# can-finder
2-
Find CAN devices in the network
1+
# CAN Finder Project Description
2+
3+
[中文文档](./README_zhCN.md)
4+
5+
## Project Overview
6+
7+
**CAN Finder** is a network device auto-discovery and management tool specifically designed for LinkerHand devices. The tool listens for UDP broadcasts from devices, displays their essential information in real-time, such as device name, IP address, MAC address, model, and version information, and pushes updates to the frontend via the WebSocket protocol.
8+
9+
## Features
10+
11+
* **Real-Time Device Discovery**: Listens to UDP broadcast data to discover CAN devices in real-time.
12+
* **Web Interface Display**: Provides an intuitive web interface to show detailed device information, including first discovery time and last active time.
13+
* **WebSocket Communication**: Uses WebSocket to update device status in real-time without manual refresh.
14+
15+
## System Architecture
16+
17+
CAN Finder consists of two main components:
18+
19+
1. **Backend Service**: Written in Go, using the Gin web framework to provide HTTP services, WebSocket services, and UDP broadcast listening.
20+
2. **Frontend Display Page**: Built with native HTML and JavaScript, communicating with the backend in real-time through WebSockets.
21+
22+
## Technology Stack
23+
24+
* Go Language
25+
* Gin Framework
26+
* WebSocket (Gorilla)
27+
* HTML and JavaScript
28+
* UDP Broadcast Protocol
29+
30+
## Usage
31+
32+
### Installation and Execution
33+
34+
```shell
35+
go build -o can-finder
36+
./can-finder --http-port 6200 --udp-port 9999
37+
```
38+
39+
### Accessing the Web Interface
40+
41+
After starting the service, access it through a browser at:
42+
43+
```
44+
http://localhost:6200
45+
```
46+
47+
This will allow real-time monitoring of CAN device discovery.
48+
49+
## Project Structure
50+
51+
```
52+
can-finder/
53+
├── main.go # Backend core program, handling UDP broadcasts and HTTP/WebSocket requests
54+
└── public
55+
└── index.html # Frontend display page
56+
```
57+
58+
## Configuration Details
59+
60+
* Default HTTP server listening port: `6200` (modifiable via command-line parameters)
61+
* Default UDP broadcast listening port: `9999` (modifiable via command-line parameters)
62+
63+
## Example Webpage Display
64+
65+
The frontend display page updates device information in real-time, including:
66+
67+
* Device Name
68+
* IP Address
69+
* MAC Address
70+
* Device Model
71+
* Software Version (linked to GitHub Release page)
72+
* First Discovery Time
73+
* Last Active Time
74+
75+
## Error Handling and Logging
76+
77+
The backend service provides detailed logs to quickly diagnose device discovery and communication issues.
78+
79+
## Dependencies
80+
81+
* github.com/gin-gonic/gin
82+
* github.com/gorilla/websocket
83+
* github.com/soulteary/gin-static
84+
85+
Use `go mod tidy` for automatic dependency management.
86+
87+
## License
88+
89+
This project uses the GPL-3.0 license.
90+
91+
---
92+
93+
Contributions are welcome! Feel free to submit code, raise issues, or open pull requests to help us continuously optimize and enhance CAN Finder!

README_zhCN.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# CAN Finder 项目说明
2+
3+
[English](./README.md)
4+
5+
## 项目概述
6+
7+
**CAN Finder** 是一款专为灵心巧手设备设计的网络设备自动发现和管理工具。该项目通过监听设备发送的 UDP 广播,实时展示设备的基本信息,包括设备名、IP 地址、MAC 地址、设备型号和版本信息,并通过 WebSocket 协议向前端实时推送更新。
8+
9+
## 功能特性
10+
11+
* **实时设备发现**:通过监听 UDP 广播数据,实时发现网络中的 CAN 设备。
12+
* **Web 界面展示**:通过友好的 Web 界面直观展示设备详细信息,包含首次发现和最后活跃时间。
13+
* **WebSocket 通信**:利用 WebSocket 协议实时更新设备状态,无需手动刷新。
14+
15+
## 系统架构
16+
17+
CAN Finder 由两个主要部分组成:
18+
19+
1. **后端服务**:采用 Go 语言编写,使用 Gin Web 框架提供 HTTP 服务、WebSocket 服务和 UDP 广播监听。
20+
2. **前端展示页面**:采用原生 HTML 和 JavaScript 构建,通过 WebSocket 与后端实时交互。
21+
22+
## 技术栈
23+
24+
* Go 语言
25+
* Gin 框架
26+
* WebSocket (Gorilla)
27+
* HTML 和 JavaScript
28+
* UDP 广播协议
29+
30+
## 使用方法
31+
32+
### 安装运行
33+
34+
```shell
35+
go build -o can-finder
36+
./can-finder --http-port 6200 --udp-port 9999
37+
```
38+
39+
### 访问 Web 界面
40+
41+
启动服务后,通过浏览器访问:
42+
43+
```
44+
http://localhost:6200
45+
```
46+
47+
即可实时查看 CAN 设备的发现情况。
48+
49+
## 项目结构
50+
51+
```
52+
can-finder/
53+
├── main.go # 后端核心程序,处理UDP广播及HTTP/WebSocket请求
54+
└── public
55+
└── index.html # 前端展示页面
56+
```
57+
58+
## 配置说明
59+
60+
* HTTP 服务默认监听端口:`6200`(可通过命令行参数修改)
61+
* UDP 广播监听默认端口:`9999`(可通过命令行参数修改)
62+
63+
## 示例页面展示
64+
65+
前端展示页面实时更新设备信息,包括:
66+
67+
* 设备名
68+
* IP 地址
69+
* MAC 地址
70+
* 设备型号
71+
* 软件版本(链接至 GitHub Release 页面)
72+
* 首次发现时间
73+
* 最后活跃时间
74+
75+
## 错误处理与日志
76+
77+
后端服务提供丰富的日志信息,以快速排查设备发现及通信相关问题。
78+
79+
## 项目依赖
80+
81+
* github.com/gin-gonic/gin
82+
* github.com/gorilla/websocket
83+
* github.com/soulteary/gin-static
84+
85+
使用 `go mod tidy` 自动管理依赖。
86+
87+
## License
88+
89+
本项目采用 GPL-3.0 license。
90+
91+
---
92+
93+
欢迎贡献代码、提出 Issue 或提交 PR,帮助我们不断优化和完善 CAN Finder!

0 commit comments

Comments
 (0)