-
-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement LocalServer. A simple http server that collects and plots i…
…Spindel data. (#632) * Implement LocalServer. A simple http server written in Golang that collects and plots iSpindel data on local network. * Filter non alpha numerical characters from filename.
- Loading branch information
1 parent
31e785e
commit 15dbec6
Showing
7 changed files
with
998 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Local Server | ||
|
||
This server collects and plot data for iSpindel on LAN. | ||
|
||
Since this simple server uses HTTP, do NOT expose it to the public network! | ||
|
||
It can be run simply with `Golang` build environment installed via `go run .` | ||
|
||
An optional `-p` flag can be used to specify the port to run on (Default is `8080`). | ||
|
||
E.g. `go run . -p 9000` | ||
|
||
Configure the iSpindel with the following settings: | ||
|
||
* Method: HTTP | ||
* Host: your local server IP | ||
* Port: port you are running on (default 8080) | ||
* Path: /data | ||
|
||
You can run this in a tmux, or as a service. | ||
|
||
Data collected are saved as `.csv` under `.../LocalServer/data/<ispindel_name>.csv`. | ||
Therefore changing the device name would start a new save file. | ||
|
||
Author: kaihuang201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
timestamp,gravity,angle,temperature,temp_units,battery,interval,name,ID,RSSI,token | ||
2025-02-11 18:59:19,1.05,74.48,27.81,C,4.10,1800,SpinHydro,6548473,-56, | ||
2025-02-11 19:28:30,1.051,74.099,28.188,C,4.098,1800,SpinHydro,6548473,-50, | ||
2025-02-11 19:57:40,1.046,73.517,28.312,C,4.098,1800,SpinHydro,6548473,-50, | ||
2025-02-11 20:26:50,1.046,73.513,28.312,C,4.098,1800,SpinHydro,6548473,-49, | ||
2025-02-11 20:55:58,1.044,73.378,28.375,C,4.098,1800,SpinHydro,6548473,-49, | ||
2025-02-11 21:25:08,1.043,73.142,28.375,C,4.098,1800,SpinHydro,6548473,-47, |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module testserver | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 | ||
github.com/fatih/color v1.13.0 // indirect | ||
github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkHBuFDA6DUhhse0IGJ7T5bemHyNILUjvOq4= | ||
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w= | ||
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= | ||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= | ||
github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519 h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s= | ||
github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= | ||
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= | ||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= | ||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= | ||
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= | ||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= | ||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= | ||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
Oops, something went wrong.