Open Boseka opened 5 years ago
Similar to #101. Is this a laptop or desktop? And if a laptop, what model?
Also, can you run this and copy the output here:
package main
import (
"fmt"
"github.com/shirou/gopsutil/host"
)
func main() {
temperatures, err := host.SensorsTemperatures()
fmt.Println(temperatures)
fmt.Println(err)
}
Similar to #101. Is this a laptop or desktop? And if a laptop, what model?
It's a laptop: ASUS Vivobook 15 X542UN
lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 19.1 Tessa
Release: 19.1
Codename: tessa
I forgot to mention that everything was working perfectly when I first installed gotop, but after a while for some reason the temperatures widget became empty, I also didn't mention that the Disk Usage widget also doesn't work, i mean its there (not empty) the "Used" and "Free" sections show correct information but the "R/s" and "W/s" are always 0B, when i installed it everything was working perfectly !!!
Of course, I updated the gotop folder to the latest release by using "git pull origin master", I tried to remove it, and reinstall again from the source, but the problem is still there.
Here is 2 screenshots, one shows that everything was working fine, the other one i just took and you can see the empty temperature widget
Also, can you run this and copy the output here:
package main import ( "fmt" "github.com/shirou/gopsutil/host" ) func main() { temperatures, err := host.SensorsTemperatures() fmt.Println(temperatures) fmt.Println(err) }
I tried but it gives me these errors:
package: cannot open distribution file
./test: line 3: syntax error near unexpected token `newline'
./test: line 3: `import (
```'
`package: can't open config file /home/bahaa/.mailagent
./test: line 3: syntax error near unexpected token `newline'
./test: line 3: `import ('`
Oh, you have to copy that file into main.go
, and then run it with go run main.go
. Let me know if you still get issues after that.
Oh, you have to copy that file into
main.go
, and then run it withgo run main.go
. Let me know if you still get issues after that.
main.go:17:2: cannot find package "github.com/ProtonMail/go-appdir" in any of: /usr/lib/go-1.10/src/github.com/ProtonMail/go-appdir (from $GOROOT) /home/bahaa/go/src/github.com/ProtonMail/go-appdir (from $GOPATH) main.go:18:2: cannot find package "github.com/cjbassi/gotop/colorschemes" in any of: /usr/lib/go-1.10/src/github.com/cjbassi/gotop/colorschemes (from $GOROOT) /home/bahaa/go/src/github.com/cjbassi/gotop/colorschemes (from $GOPATH) main.go:19:2: cannot find package "github.com/cjbassi/gotop/src/logging" in any of: /usr/lib/go-1.10/src/github.com/cjbassi/gotop/src/logging (from $GOROOT) /home/bahaa/go/src/github.com/cjbassi/gotop/src/logging (from $GOPATH) main.go:20:2: cannot find package "github.com/cjbassi/gotop/src/widgets" in any of: /usr/lib/go-1.10/src/github.com/cjbassi/gotop/src/widgets (from $GOROOT) /home/bahaa/go/src/github.com/cjbassi/gotop/src/widgets (from $GOPATH) main.go:21:2: cannot find package "github.com/docopt/docopt.go" in any of: /usr/lib/go-1.10/src/github.com/docopt/docopt.go (from $GOROOT) /home/bahaa/go/src/github.com/docopt/docopt.go (from $GOPATH) main.go:22:2: cannot find package "github.com/gizak/termui" in any of: /usr/lib/go-1.10/src/github.com/gizak/termui (from $GOROOT) /home/bahaa/go/src/github.com/gizak/termui (from $GOPATH)
Here try:
go get github.com/cjbassi/test
go run github.com/cjbassi/test
go run github.com/cjbassi/test
pay attention that my previous answer was edited
go run github.com/cjbassi/test go run: no go files listed
Do you have a working GOPATH set up? What's your Go version? If you have go 1.11 then you can probably just clone that repo and run go run main.go
also. Or else navigate to your gopath and run the project directly.
Do you have a working GOPATH set up? What's your Go version? If you have go 1.11 then you can probably just clone that repo and run
go run main.go
also. Or navigate to your gopath and run the project directly, idk.
First of all I'm sorry but it's my first time working with golang, so I'm kind of don't know what exactly I'm doing.
My go version:
go version go1.10.4 linux/amd64
Ok i did the following:
export GOPATH=$HOME/go
cd ~/go/src/github.com/cjbassi/test
There I found 'main.go' file
I ran:
go run main.go
I got the following output:
[{"sensorKey":"acpitz_crit","sensorTemperature":103} {"sensorKey":"acpitz_input","sensorTemperature":34} {"sensorKey":"coretemp_packageid0_crit","sensorTemperature":100} {"sensorKey":"coretemp_packageid0_critalarm","sensorTemperature":0} {"sensorKey":"coretemp_packageid0_input","sensorTemperature":37} {"sensorKey":"coretemp_packageid0_max","sensorTemperature":100} {"sensorKey":"coretemp_core0_crit","sensorTemperature":100} {"sensorKey":"coretemp_core0_critalarm","sensorTemperature":0} {"sensorKey":"coretemp_core0_input","sensorTemperature":33} {"sensorKey":"coretemp_core0_max","sensorTemperature":100} {"sensorKey":"coretemp_core1_crit","sensorTemperature":100} {"sensorKey":"coretemp_core1_critalarm","sensorTemperature":0} {"sensorKey":"coretemp_core1_input","sensorTemperature":37} {"sensorKey":"coretemp_core1_max","sensorTemperature":100} {"sensorKey":"pch_skylake_input","sensorTemperature":30.5}] read /sys/class/hwmon/hwmon4/temp1_input: network is down
And I found this error in ~/.local.stat.gotop.errors.log
12:49:11 temp_other.go:16: failed to get sensors from gopsutil: read /sys/class/hwmon/hwmon4/temp1_input: network is down
I thought this might be helpful:
I also have gotop installed on Termux on my android tablet, the temperature widget is working there, and i got the following output after running the main.go file in the gotop directory after adding to it :
package main
import (
"fmt"
"github.com/shirou/gopsutil/host"
)
func main() {
temperatures, err := host.SensorsTemperatures()
fmt.Println(temperatures)
fmt.Println(err)
}
The output:
go: finding github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 go: finding github.com/pmezard/go-difflib v1.0.0 go: finding github.com/ProtonMail/go-appdir v0.0.0-20180220133335-7c788d1b45c6 go: finding github.com/mattn/go-runewidth v0.0.4 go: finding github.com/shirou/gopsutil v2.18.11+incompatible go: finding github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815 go: finding github.com/mitchellh/go-wordwrap v1.0.0 go: finding github.com/go-ole/go-ole v1.2.1 go: finding github.com/gizak/termui v0.0.0-20190124041613-958a28575d74 go: finding howett.net/plist v0.0.0-20181124034731-591f970eefbb go: finding github.com/stretchr/testify v1.2.2 go: finding github.com/DHowett/go-plist v0.0.0-20180729002649-fed556ad7290 go: finding github.com/davecgh/go-spew v1.1.1 go: finding github.com/distatus/battery v0.0.0-20170521010419-916919eb43bd go: finding github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 go: finding github.com/cjbassi/drawille-go v0.0.0-20180329221028-ad535d0f92cd go: finding github.com/nsf/termbox-go v0.0.0-20190104133558-0938b5187e61 go: finding github.com/kr/pretty v0.1.0 go: finding gopkg.in/yaml.v2 v2.2.1 go: finding github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 go: finding github.com/jessevdk/go-flags v1.4.0 go: github.com/cjbassi/drawille-go@v0.0.0-20180329221028-ad535d0f92cd: unknown revision ad535d0f92cd go: finding github.com/nsf/termbox-go v0.0.0-20180613055208-5c94acc5e6eb go: finding github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 go: finding golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc go: finding github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163 go: finding golang.org/x/sys v0.0.0-20190116161447-11f53e031339 go: finding github.com/mattn/go-runewidth v0.0.2 go: finding golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 go: error loading module requirements
I also ran the following commands as you asked but this time on termux with working temperature widget:
`go run github.com/cjbassi/test [{"sensorKey":"tsens_tz_sensor0_input","sensorTemperature":0.352} {"sensorKey":"tsens_tz_sensor9_input","sensorTemperature":0.419} {"sensorKey":"tsens_tz_sensor10_input","sensorTemperature":0.387} {"sensorKey":"tsens_tz_sensor11_input","sensorTemperature":0.39} {"sensorKey":"tsens_tz_sensor12_input","sensorTemperature":0.393} {"sensorKey":"tsens_tz_sensor13_input","sensorTemperature":0.358} {"sensorKey":"tsens_tz_sensor14_input","sensorTemperature":0.329} {"sensorKey":"tsens_tz_sensor15_input","sensorTemperature":0.345} {"sensorKey":"tsens_tz_sensor16_input","sensorTemperature":0.358} {"sensorKey":"tsens_tz_sensor17_input","sensorTemperature":0.355} {"sensorKey":"tsens_tz_sensor18_input","sensorTemperature":0.339} {"sensorKey":"tsens_tz_sensor1_input","sensorTemperature":0.381} {"sensorKey":"tsens_tz_sensor19_input","sensorTemperature":0.339} {"sensorKey":"tsens_tz_sensor20_input","sensorTemperature":0.342} {"sensorKey":"pm8994_tz_crit","sensorTemperature":145} {"sensorKey":"pm8994_tz_input","sensorTemperature":36.492} {"sensorKey":"pm8004_tz_crit","sensorTemperature":145} {"sensorKey":"pm8004_tz_input","sensorTemperature":37} {"sensorKey":"msm_therm_input","sensorTemperature":0.034} {"sensorKey":"emmc_therm_input","sensorTemperature":0.028} {"sensorKey":"pa_therm0_input","sensorTemperature":-0.04} {"sensorKey":"pa_therm1_input","sensorTemperature":0.028} {"sensorKey":"quiet_therm_input","sensorTemperature":-0.04} {"sensorKey":"xo_therm_buf_input","sensorTemperature":0.032} {"sensorKey":"tsens_tz_sensor2_input","sensorTemperature":0.358} {"sensorKey":"sm5705-fuelgauge_input","sensorTemperature":32} {"sensorKey":"DLMt_APC1_input","sensorTemperature":0} {"sensorKey":"LLM_cp00_input","sensorTemperature":0} {"sensorKey":"LLM_cp01_input","sensorTemperature":0} {"sensorKey":"LLM_cp10_input","sensorTemperature":0} {"sensorKey":"LLM_cp11_input","sensorTemperature":0} {"sensorKey":"LLM_m4m0_input","sensorTemperature":0} {"sensorKey":"LLM_l21-_input","sensorTemperature":0} {"sensorKey":"LLM_l20-_input","sensorTemperature":0} {"sensorKey":"tsens_tz_sensor3_input","sensorTemperature":0.374} {"sensorKey":"ac_input","sensorTemperature":29.3} {"sensorKey":"battery_input","sensorTemperature":28.4} {"sensorKey":"tsens_tz_sensor4_input","sensorTemperature":0.368} {"sensorKey":"tsens_tz_sensor5_input","sensorTemperature":0.365} {"sensorKey":"tsens_tz_sensor6_input","sensorTemperature":0.368} {"sensorKey":"tsens_tz_sensor7_input","sensorTemperature":0.381} {"sensorKey":"tsens_tz_sensor8_input","sensorTemperature":0.403}]
Thanks for all the info and I'm glad you got it working! And no worries about being new. I should've been more helpful actually. It's a little tricky to setup Go for the first time and I shouldn't expect that everyone has done that already.
So that actually clears a few things up for now. I'll check through this tomorrow and let you know what I come up with.
So this should be fixed now! Let me know if you get any more issues otherwise. And thanks for taking the time to setup Go and do all the testing.
Thanks for being responsive, and I'm glad to be part of this.
But unfortunately the problem is still there.
~/.locale/state/gotop/errors.log:
18:49:18 temp_other.go:16: failed to get sensors from gopsutil: read /sys/class/hwmon/hwmon4/temp1_input: network is down
go run main.go
[{"sensorKey":"acpitz_crit","sensorTemperature":103} {"sensorKey":"acpitz_input","sensorTemperature":38} {"sensorKey":"coretemp_packageid0_crit","sensorTemperature":100} {"sensorKey":"coretemp_packageid0_critalarm","sensorTemperature":0} {"sensorKey":"coretemp_packageid0_input","sensorTemperature":39} {"sensorKey":"coretemp_packageid0_max","sensorTemperature":100} {"sensorKey":"coretemp_core0_crit","sensorTemperature":100} {"sensorKey":"coretemp_core0_critalarm","sensorTemperature":0} {"sensorKey":"coretemp_core0_input","sensorTemperature":37} {"sensorKey":"coretemp_core0_max","sensorTemperature":100} {"sensorKey":"coretemp_core1_crit","sensorTemperature":100} {"sensorKey":"coretemp_core1_critalarm","sensorTemperature":0} {"sensorKey":"coretemp_core1_input","sensorTemperature":39} {"sensorKey":"coretemp_core1_max","sensorTemperature":100} {"sensorKey":"pch_skylake_input","sensorTemperature":34.5}]
read /sys/class/hwmon/hwmon4/temp1_input: network is down
Did you try running gotop from the master branch? I haven't released a new version yet so that's your only option for now.
Yes, I did. still no temperatures !!
So I noticed the error message you recently got is the same as before, but I changed that message when I fixed this. :D So maybe it was leftover? Or maybe gotop didn't update correctly. Can you tell me how you updated exactly? If you have your gopath set up then you should be able to do go get -u github.com/cjbassi/gotop
and the updated gotop binary should be in ~/go/bin/gotop
. Or maybe git clone
the repo and try go run main.go
.
go get -u github.com/cjbassi/gotop
works perfectly, thank you
Great job.
Yay! Glad its working :D Thanks again being responsive and helping with this.
This did not work for me.
I installed go, and tried the go get -u github.com/cjbassi/gotop
but still have no temperature charts
Running the go run github.com/cjbassi/test
gived me this error:
package github.com/cjbassi/test: cannot find package "github.com/cjbassi/test" in any of:
/usr/local/go/src/github.com/cjbassi/test (from $GOROOT)
/home/chiya/work/src/github.com/cjbassi/test (from $GOPATH)
I'm guessing more people will experience this same issue, and are wondering if there is a proper step-by-step on how to fix this?
So I fixed this issue on gotop's end, but it turns out that gopsutil has an issue on its end within the SensorsTemperatures
function here that is probably causing this issue for you still, I just forgot to reopen this.
Basically, SensorsTemperatures
iterates the filesystem and early returns on the first error it encounters instead of trying to continue onto the next file. So if an error is encountered in the first file, no temperatures are read/shown. Instead, it needs to return an array of errors and append any errors it finds and return that at the end.
I did some work on this here but I think I got stuck trying to test it and I've been pretty busy.
Having the same issue with gotop 4.0.0 on a Lenovo T480. Might get time to help out when I get vacation.
Hi @carlsmedstad -- this repository is archived. Current development is on xxxserxxx/gotop. Please see xxxserxxx/gotop/issues/16 for the current status of this ticket.
Thanks!
Required information:
gotop version (
gotop -v
): 2.0.0The output of
uname -a
: Linux XXX-X542UN 4.18.0-14-generic #15~18.04.1-Ubuntu SMP Mon Jan 14 11:09:26 UTC 2019 x86_64 x86_64 x86_64 GNU/LinuxTerminal shell (e.g. zsh or bash): bash
Terminal emulator (e.g. iTerm or gnome terminal): gnome terminal
Any relevenat hardware info: CPU: Intel i5-7200U, GPU: Intel HD Graphics 620, GPU: NVIDIA GeForce MX150
tmux version if using tmux:
Also please copy or attach the following file if it exists and contains logs:
~/.local/state/gotop/errors.log
~/Library/Logs/gotop/errors.log
~/.local/state/gotop/errors.log is EMPTY !! Installlation method: Prebuilt binaries