Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Temperature widget is not working ( not showing anything) !!! #103

Open
Boseka opened this issue Feb 2, 2019 · 22 comments
Open

Temperature widget is not working ( not showing anything) !!! #103

Boseka opened this issue Feb 2, 2019 · 22 comments
Labels
bug Something isn't working

Comments

@Boseka
Copy link

Boseka commented Feb 2, 2019

Required information:

  • gotop version (gotop -v): 2.0.0

  • The output of uname -a: Linux XXX-X542UN 4.18.0-14-generic Additional custom widgets #15~18.04.1-Ubuntu SMP Mon Jan 14 11:09:26 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

  • Terminal 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:

  • Linux: ~/.local/state/gotop/errors.log
  • OSX: ~/Library/Logs/gotop/errors.log

~/.local/state/gotop/errors.log is EMPTY !!
Installlation method: Prebuilt binaries

@cjbassi cjbassi added the bug Something isn't working label Feb 2, 2019
@cjbassi
Copy link
Owner

cjbassi commented Feb 2, 2019

Similar to #101. Is this a laptop or desktop? And if a laptop, what model?

@cjbassi
Copy link
Owner

cjbassi commented Feb 2, 2019

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)
}

@Boseka
Copy link
Author

Boseka commented Feb 2, 2019

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

screenshot from 2018-11-18 17-55-19
screenshot from 2019-02-02 16-53-50

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 ('`

@cjbassi
Copy link
Owner

cjbassi commented Feb 2, 2019

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.

@Boseka
Copy link
Author

Boseka commented Feb 3, 2019

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.

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)

@cjbassi
Copy link
Owner

cjbassi commented Feb 3, 2019

Here try:

go get github.com/cjbassi/test
go run github.com/cjbassi/test

@Boseka
Copy link
Author

Boseka commented Feb 3, 2019

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

@cjbassi
Copy link
Owner

cjbassi commented Feb 3, 2019

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.

@cjbassi
Copy link
Owner

cjbassi commented Feb 3, 2019

Or use this binary:
test.zip

@Boseka
Copy link
Author

Boseka commented Feb 3, 2019

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}] <nil>

@cjbassi
Copy link
Owner

cjbassi commented Feb 3, 2019

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.

@cjbassi
Copy link
Owner

cjbassi commented Feb 4, 2019

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.

@cjbassi cjbassi closed this as completed Feb 4, 2019
cjbassi added a commit that referenced this issue Feb 4, 2019
Sometimes a temperature sensor file in `/sys/class/hwmon/hwmon*/temp*_*` fill return 'ENETDOWN: Network is down' when being read for some reason, which gopsutil propogates up to gotop. gopsutil still returns a slice of valid temperatures when it errors, so we can render those instead of ignoring the return value.
cjbassi added a commit that referenced this issue Feb 4, 2019
Sometimes a temperature sensor file in `/sys/class/hwmon/hwmon*/temp*_*` will return 'ENETDOWN: Network is down' when being read for some reason, which gopsutil propogates up to gotop. gopsutil still returns a slice of valid temperatures when it errors, so we can render those instead of ignoring the return value.
@Boseka
Copy link
Author

Boseka commented Feb 4, 2019

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

@cjbassi
Copy link
Owner

cjbassi commented Feb 4, 2019

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.

@Boseka
Copy link
Author

Boseka commented Feb 5, 2019

Yes, I did. still no temperatures !!

screenshot from 2019-02-05 13-27-35

@cjbassi
Copy link
Owner

cjbassi commented Feb 5, 2019

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.

@Boseka
Copy link
Author

Boseka commented Feb 5, 2019

go get -u github.com/cjbassi/gotop

works perfectly, thank you

Great job.

screenshot from 2019-02-05 21-42-02

@cjbassi
Copy link
Owner

cjbassi commented Feb 5, 2019

Yay! Glad its working :D Thanks again being responsive and helping with this.

cjbassi added a commit to cjbassi/gopsutil that referenced this issue Feb 5, 2019
- SensorsTemperatures now returns a slice of errors
- Previously, the function would return as soon as an error occured, but now we can continue to process the rest of the sensors even if an error occurs with one. Sometimes one sensor interface will be misbehaving but the rest will provide valid data.
- cjbassi/gotop#101, cjbassi/gotop#103
@Aadniz
Copy link

Aadniz commented Apr 30, 2019

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?

@cjbassi
Copy link
Owner

cjbassi commented Apr 30, 2019

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.

@cjbassi cjbassi reopened this Apr 30, 2019
@carlsmedstad
Copy link

Having the same issue with gotop 4.0.0 on a Lenovo T480. Might get time to help out when I get vacation.

@xxxserxxx
Copy link

Hi @carlsmedstad -- this repository is archived. Current development is on xxxserxxx/gotop. Please see xxxserxxx/issues/16 for the current status of this ticket.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants