Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
480ea14a72 | ||
|
|
a1df57bb39 | ||
|
|
f08490122c | ||
|
|
0c18fc145d | ||
|
|
a4ce307d34 |
40
README.md
40
README.md
@@ -1,9 +1,8 @@
|
|||||||
# rtl-gopow
|
# rtl-gopow
|
||||||
Render tables from rtl_power to a nice heat map
|
Render tables from rtl_power to a nice heat map. Faster and easier to use than other tools, gopow does not require a scripting enviroment, dependencies or development enviroment to run. Just download the binary and execute. At the same time gopow offers 2-3.6 times the performance compared to script based tools, depending on input file.
|
||||||
Here is an render of rtl_power tool scanning 80-90 MHz during 2.5 hours moving in a car. .
|
|
||||||
|
|
||||||
# Availability
|
## Availability
|
||||||
Since Go is easy to cross compile, this tool can be easily distributed as a binary without any dependencies. You'll find it under Releases here on github. The following platforms are avalible as a ready to run binary file:
|
Since Go is easy to cross compile, this tool can be easily distributed as a binary without any dependencies. You'll find it under [Releases](https://github.com/dhogborg/rtl-gopow/releases) here on github. The following platforms are avalible as a ready to run binary file:
|
||||||
|
|
||||||
* OS X (x64)
|
* OS X (x64)
|
||||||
* Linux (x64)
|
* Linux (x64)
|
||||||
@@ -11,9 +10,37 @@ Since Go is easy to cross compile, this tool can be easily distributed as a bina
|
|||||||
* Linux (arm7)
|
* Linux (arm7)
|
||||||
* Windows (x64)
|
* Windows (x64)
|
||||||
|
|
||||||
|
https://github.com/dhogborg/rtl-gopow/releases
|
||||||
|
|
||||||
|
## Building
|
||||||
|
(only needed if making changes to the source, otherwise you can download a [release binary](https://github.com/dhogborg/rtl-gopow/releases))
|
||||||
|
|
||||||
|
### Install tooling
|
||||||
|
`make setup` will install [go-bindata](https://github.com/jteeuwen/go-bindata) which is needed to build the resources. Make sure $GOPATH/bin is in your $PATH so your shell can find the tool.
|
||||||
|
|
||||||
|
### Make resources
|
||||||
|
`make resources` will compile rtl-gopow/resources/ to rtl-gopow/internal/resources/resources.go. This file is disposable and will re-generate on every build.
|
||||||
|
|
||||||
|
### Make build
|
||||||
|
Every platform has it's own make command.
|
||||||
|
* `make build_darwin`
|
||||||
|
* `make build_linux`
|
||||||
|
* `make build_arm5`
|
||||||
|
* `make build_arm7`
|
||||||
|
* `make build_win`
|
||||||
|
|
||||||
|
All commands will compile a binary to rtl-gopow/build/gopow[.exe] and create a distributable zip file. For more info on cross compilation see [this document](http://dave.cheney.net/2013/07/09/an-introduction-to-cross-compilation-with-go-1-1).
|
||||||
|
|
||||||
|
`make all` will build all platforms and create zip files in rtl-gopow/build/ and then remove the executable files.
|
||||||
|
|
||||||
|
### go build/run
|
||||||
|
Before runnning `go build *.go` or `go run *.go` make sure the resources has been generated by `make resources`.
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
A render of a 600 MB csv file takes about 2 minutes on a 2,4 GHz Intel Core i5. There is still lots of room for improvement on that though. Memory usage is quite horrid.
|
A render of a 600 MB csv file takes about 2 minutes on a 2,4 GHz Intel Core i5. There is still lots of room for improvement on that though. Memory usage is quite horrid.
|
||||||
|
|
||||||
|
Compared to script based tools gopow will run more than 2x faster for smaller files, and more than 3x faster for bigger files.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
```
|
```
|
||||||
GLOBAL OPTIONS:
|
GLOBAL OPTIONS:
|
||||||
@@ -25,4 +52,7 @@ GLOBAL OPTIONS:
|
|||||||
--help, -h show help
|
--help, -h show help
|
||||||
--version, -v print the version
|
--version, -v print the version
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
Here is an render of rtl_power tool scanning 80-90 MHz during 2.5 hours moving in a car. .
|
||||||
2
gopow.go
2
gopow.go
@@ -14,7 +14,7 @@ func main() {
|
|||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "RTL GoPow"
|
app.Name = "RTL GoPow"
|
||||||
app.Usage = "Render a rtl_power CSV output as waterfall image"
|
app.Usage = "Render a rtl_power CSV output as waterfall image"
|
||||||
app.Version = "0.0.1"
|
app.Version = "0.0.2"
|
||||||
app.Author = "github.com/dhogborg"
|
app.Author = "github.com/dhogborg"
|
||||||
app.Email = "d@hogborg.se"
|
app.Email = "d@hogborg.se"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package gopow
|
package gopow
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -108,9 +109,9 @@ func (l *LineComplex) AddSamples(line *LineComplex) {
|
|||||||
|
|
||||||
func (l *LineComplex) HighSample() float64 {
|
func (l *LineComplex) HighSample() float64 {
|
||||||
|
|
||||||
high := float64(-99999)
|
high := float64(math.MaxFloat64 * -1)
|
||||||
for _, sample := range l.Samples {
|
for _, sample := range l.Samples {
|
||||||
if sample > high {
|
if sample > high && !math.IsInf(sample, 0) {
|
||||||
high = sample
|
high = sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,9 +120,10 @@ func (l *LineComplex) HighSample() float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *LineComplex) LowSample() float64 {
|
func (l *LineComplex) LowSample() float64 {
|
||||||
low := float64(99999)
|
|
||||||
|
low := float64(math.MaxFloat64)
|
||||||
for _, sample := range l.Samples {
|
for _, sample := range l.Samples {
|
||||||
if sample < low {
|
if sample < low && !math.IsInf(sample, 0) {
|
||||||
low = sample
|
low = sample
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package gopow
|
package gopow
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -72,14 +73,13 @@ func (t *TableComplex) parseBuffer(filebuffer []byte) []*LineComplex {
|
|||||||
t.Max = float64(math.MaxFloat64 * -1)
|
t.Max = float64(math.MaxFloat64 * -1)
|
||||||
t.Min = float64(math.MaxFloat64)
|
t.Min = float64(math.MaxFloat64)
|
||||||
|
|
||||||
block := string(filebuffer)
|
lines := bytes.Split(filebuffer, []byte("\n"))
|
||||||
lines := strings.Split(block, "\n")
|
|
||||||
|
|
||||||
table := map[string][]*LineComplex{}
|
table := map[string][]*LineComplex{}
|
||||||
|
|
||||||
for _, l := range lines {
|
for _, l := range lines {
|
||||||
|
|
||||||
cells := strings.Split(l, ",")
|
cells := strings.Split(string(l), ",")
|
||||||
line := NewLineComplex(cells)
|
line := NewLineComplex(cells)
|
||||||
|
|
||||||
if table[line.Hash] == nil {
|
if table[line.Hash] == nil {
|
||||||
@@ -176,7 +176,6 @@ func (t *TableComplex) IntegrateLines(lines []*LineComplex) *LineComplex {
|
|||||||
if i > 0 {
|
if i > 0 {
|
||||||
masterline.AddSamples(l)
|
masterline.AddSamples(l)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return masterline
|
return masterline
|
||||||
|
|||||||
Reference in New Issue
Block a user