Bitcoin Forum

Bitcoin => Hardware => Topic started by: cardcomm on September 27, 2013, 02:10:47 AM



Title: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on September 27, 2013, 02:10:47 AM
Hi Everyone,

I like to take a minute to introduce a new monitor app for cgminer. This simple script will get data from the cgminer API and display mining statistics on a small LCD screen attached to your computer or Raspberry Pi. It's a great addition to most unix based mining setups, and includes a handy MtGox ticker and clock display as well. It's been verified to work with most Linux distributions, Apple OS X, and as I said, works great on the Pi.

The project website is here:
http://cardcomm.github.io/cgminerLCDStats/

The code can be downloaded here:
https://github.com/cardcomm/cgminerLCDStats

Here is a screen shot of the display in action:
https://raw.github.com/cardcomm/cgminerLCDStats/master/lcd_and_pi-small.jpg


You can order the specific LCD screen needed for this app from the ColdTears Electronics ebay store:
(Note that I am IN NO WAY connected with ColdTears electronics, nor am I endorsing this ebay seller. I've personally ordered and received two units, and I know several others have purchased them as well.)
http://www.ebay.com/itm/USB-2-8-TFT-LCD-module-LCD-sys-info-display-temperature-fan-AIDA64-LCD-Smartie-/121004607232?pt=LH_DefaultDomain_0&hash=item1c2c6fc700

I first heard of this display in a post on the MinePeon forum. There are quite a few posts in that thread discussing the LCD display and this project.
BTW, the code to support the LCD display is rolled in to the current release of MinePeon.
https://bitcointalk.org/index.php?topic=137934.msg2844656#msg2844656


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on September 28, 2013, 04:23:50 PM
A little bump to make sure everyone gets a chance to see this...


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Trongersoll on September 28, 2013, 07:05:07 PM
that is pretty sweet. :)


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Zeek_W on September 29, 2013, 04:33:33 AM
Does it need to be connected directly to the Pi and not via USB hub? I'm having issues getting it to be seen when running the  sudo python2 cgminerLCDStats.py" command.  >:(


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: CaptainAK on September 29, 2013, 04:57:42 AM
Just ordered one. Can't wait to get it going. :)


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Beastlymac on September 29, 2013, 05:04:33 AM
In the title.
"Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)"
Should be
"Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)"

Just a heads up.


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: 18RATTT on September 29, 2013, 03:12:29 PM
good stuff


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 02, 2013, 02:05:16 AM
In the title.
"Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)"
Should be
"Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)"

Just a heads up.

LOL! Thanks. I can't tell you how many times I've made that typo :/


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 02, 2013, 02:09:15 AM
Does it need to be connected directly to the Pi and not via USB hub? I'm having issues getting it to be seen when running the  sudo python2 cgminerLCDStats.py" command.  >:(

No, it should work fine when connected to a hub. I've seen a number of these units with defective USB cables, unfortunately. They tend to fit very loosely at the connection near the display. Does the Display work for any of the demos?

What specific error are you getting? I'm assuming one about "not being able to claim the device". It's usually either a bad USB cable, or not running the script as root. (that does not seem to be you problem)


Title: Re: Display your gcminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Zeek_W on October 02, 2013, 03:33:37 AM
Does it need to be connected directly to the Pi and not via USB hub? I'm having issues getting it to be seen when running the  sudo python2 cgminerLCDStats.py" command.  >:(

No, it should work fine when connected to a hub. I've seen a number of these units with defective USB cables, unfortunately. They tend to fit very loosely at the connection near the display. Does the Display work for any of the demos?

What specific error are you getting? I'm assuming one about "not being able to claim the device". It's usually either a bad USB cable, or not running the script as root. (that does not seem to be you problem)

It powers up, but using the command lsusb doesn't bring it up.

Next time I am back home, I will try another USB cable and actually try it with the default software. Will get back to you.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: salfter on October 08, 2013, 03:40:55 PM
This display would be perfect for the GPU/ASIC rig I just spun up...will probably have to roll my own software to poll two cgminer instances and two CryptoSwitcher instances, but the pointer to a suitable display is useful info.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 08, 2013, 06:19:39 PM
This display would be perfect for the GPU/ASIC rig I just spun up...will probably have to roll my own software to poll two cgminer instances and two CryptoSwitcher instances, but the pointer to a suitable display is useful info.

The Python code should be a good starting point for that. It already supports being pointed to an arbitrary cgminer instance. You would just have to add code to poll the two separately.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ktbken on October 10, 2013, 06:47:57 PM
Hi im  trying to get this screen to work with bfgminer but i think there is some difference between it and cgminer and a it just hangs at what looks like getting the api info anyone have any idea what need changing ?


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 11, 2013, 05:28:57 PM
Hi im  trying to get this screen to work with bfgminer but i think there is some difference between it and cgminer and a it just hangs at what looks like getting the api info anyone have any idea what need changing ?

Hi,

I haven't tested with bfgminer at all, and I'm not very familiar with it. I  think the API is similar, so it may work. You'll need to make sure bfgminer is listening for API call. I think you need something like this in the bfgminer config file:

"api-listen" : true,
"api-port" : "4028",

I hope this helps. Let me know if you get it working, or if I can be of further help.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Zeek_W on October 12, 2013, 03:27:42 AM
Turns out the one I got was a dud, the USB connecter is broken and only receives power, no data. Time to open it up and see what I can see!

EDIT: working now. Just hit the USB connector with my rework station and all is working.

Cheers for a great little script OP!


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 12, 2013, 05:51:22 AM
Turns out the one I got was a dud, the USB connecter is broken and only receives power, no data. Time to open it up and see what I can see!

EDIT: working now. Just hit the USB connector with my rework station and all is working.

Cheers for a great little script OP!

Sweet! Congrats on the repair.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Zeek_W on October 12, 2013, 08:29:03 AM
Turns out the one I got was a dud, the USB connecter is broken and only receives power, no data. Time to open it up and see what I can see!

EDIT: working now. Just hit the USB connector with my rework station and all is working.

Cheers for a great little script OP!

Sweet! Congrats on the repair.

I'm kinda noobie to Linux - but I have a question:

I use SSH to access my rPi and I can get it running easily. However - is there a way so i can still sudo screen -r on cgminer so I can monitor the miner when I am on my other computer?

Any way around this?


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cowandtea on October 12, 2013, 01:50:08 PM
Pretty sweet, thanks for sharing.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ktbken on October 12, 2013, 09:50:44 PM
Hi im  trying to get this screen to work with bfgminer but i think there is some difference between it and cgminer and a it just hangs at what looks like getting the api info anyone have any idea what need changing ?

Hi,

I haven't tested with bfgminer at all, and I'm not very familiar with it. I  think the API is similar, so it may work. You'll need to make sure bfgminer is listening for API call. I think you need something like this in the bfgminer config file:

"api-listen" : true,
"api-port" : "4028",

I hope this helps. Let me know if you get it working, or if I can be of further help.

Implemented a quick dirty fix which gets it working with bfgminer

changed CgminerRPCClient.py

Code:
# loop until a zero byte indicates we got all the data
            data = ""
            while True:
                buffer = s.recv(65535)
                if '\x00' in buffer:
                    data += buffer # keep the buffer and bail from the loop - we got all t$
                    break # zero found, so we must have all the data TODO break in loop is$
                else:
                    data += buffer # No zero found yet, append current buffer to data and $

            s.close() # close the socket

To

 # loop until a zero byte indicates we got all the data
            data = ""
            while True:
                buffer = s.recv(65535)
                if buffer:
                    data += buffer # keep the buffer and bail from the loop - we got all t$
                 # zero found, so we must have all the data TODO break in loop is ugly    $
                else:
                      s.close() # close the socket
                break


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: southerngentuk on October 17, 2013, 10:47:02 PM

Implemented a quick dirty fix which gets it working with bfgminer

changed CgminerRPCClient.py



Your my Hero. This Works for BFGMiner. I now at last have a stable Minepeon Build.

How to get the screen to run on boot?

Edit  : found the answer on minepeon forums

All is right with the world once again.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Zeek_W on October 18, 2013, 08:45:10 AM
Turns out the one I got was a dud, the USB connecter is broken and only receives power, no data. Time to open it up and see what I can see!

EDIT: working now. Just hit the USB connector with my rework station and all is working.

Cheers for a great little script OP!

Sweet! Congrats on the repair.

I'm kinda noobie to Linux - but I have a question:

I use SSH to access my rPi and I can get it running easily. However - is there a way so i can still sudo screen -r on cgminer so I can monitor the miner when I am on my other computer?

Any way around this?

I answered this myself - I'm an idiot. Just duplicated the session in putty and entered the cgminerLCDStats.py command.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 21, 2013, 11:17:10 PM
Hi im  trying to get this screen to work with bfgminer but i think there is some difference between it and cgminer and a it just hangs at what looks like getting the api info anyone have any idea what need changing ?

Hi,

I haven't tested with bfgminer at all, and I'm not very familiar with it. I  think the API is similar, so it may work. You'll need to make sure bfgminer is listening for API call. I think you need something like this in the bfgminer config file:

"api-listen" : true,
"api-port" : "4028",

I hope this helps. Let me know if you get it working, or if I can be of further help.

Implemented a quick dirty fix which gets it working with bfgminer

changed CgminerRPCClient.py

Code:
# loop until a zero byte indicates we got all the data
            data = ""
            while True:
                buffer = s.recv(65535)
                if '\x00' in buffer:
                    data += buffer # keep the buffer and bail from the loop - we got all t$
                    break # zero found, so we must have all the data TODO break in loop is$
                else:
                    data += buffer # No zero found yet, append current buffer to data and $

            s.close() # close the socket

To

 # loop until a zero byte indicates we got all the data
            data = ""
            while True:
                buffer = s.recv(65535)
                if buffer:
                    data += buffer # keep the buffer and bail from the loop - we got all t$
                 # zero found, so we must have all the data TODO break in loop is ugly    $
                else:
                      s.close() # close the socket
                break

Sweet. glad you got it working. I really need to take the time and examine the exact differences between the API's.

Sorry I've been away from the thread a while. I'm glad y'all got your problems sorted. Yeah, opening a new putty window works well to run the script. That's usually what I do. Or you could have it auto start.

southerngentuk - Glad you discovered how to set it up to auto start. I'm been meaning to add a tutorial for that, but it varies for different Linux flavors. Maybe I'll do one that covers the versions I know.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: southerngentuk on October 22, 2013, 01:16:21 AM


Sweet. glad you got it working. I really need to take the time and examine the exact differences between the API's.

Sorry I've been away from the thread a while. I'm glad y'all got your problems sorted. Yeah, opening a new putty window works well to run the script. That's usually what I do. Or you could have it auto start.

southerngentuk - Glad you discovered how to set it up to auto start. I'm been meaning to add a tutorial for that, but it varies for different Linux flavors. Maybe I'll do one that covers the versions I know.
Thank you for this great project.

Maybe add a link to the git pointing to  mineforemans forum. That seems to have a lot of good information also.



Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: P_Shep on October 22, 2013, 12:06:47 PM
Awesome! Just wish I had a spare USB port free. Would look great sitting on my router :)


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: salfter on October 26, 2013, 07:12:11 PM
My display arrived early this week.  I have it monitoring both cgminer instances with this quick-and-dirty shell script that just alternates between the two:

Code:
#!/bin/sh
while [ 1 == 1 ]
do
  python cgminerLCDStats.py -d 15 &
  sleep 10
  kill $(ps auxw | grep cgminerLCDStats.py | grep -v grep | awk '{print $2}') 
  python cgminerLCDStats.py -d 15 -p 4029 &
  sleep 10
  kill $(ps auxw | grep cgminerLCDStats.py | grep -v grep | awk '{print $2}') 
done

Port 4028 (the default) is an scrypt mining instance with a Radeon 6870 and a Radeon 7750.  Port 4029 is an SHA-256 mining instance with a couple of BFL Jalapeņos.  Every 10 seconds, it reads one and displays it.  The running instance is then killed and the other one is started.

The only real downside is that the display is cleared once every 10 seconds.  I'm also not sure that more information (as from two miners at once) could be displayed without some lower-level mucking around in the display software to make the text smaller.  Perhaps rendering text (in a smaller font) to an image and uploading that to the display would work.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on October 29, 2013, 03:41:53 AM
My display arrived early this week.  I have it monitoring both cgminer instances with this quick-and-dirty shell script that just alternates between the two:

Code:
#!/bin/sh
while [ 1 == 1 ]
do
  python cgminerLCDStats.py -d 15 &
  sleep 10
  kill $(ps auxw | grep cgminerLCDStats.py | grep -v grep | awk '{print $2}') 
  python cgminerLCDStats.py -d 15 -p 4029 &
  sleep 10
  kill $(ps auxw | grep cgminerLCDStats.py | grep -v grep | awk '{print $2}') 
done

Port 4028 (the default) is an scrypt mining instance with a Radeon 6870 and a Radeon 7750.  Port 4029 is an SHA-256 mining instance with a couple of BFL Jalapeņos.  Every 10 seconds, it reads one and displays it.  The running instance is then killed and the other one is started.

The only real downside is that the display is cleared once every 10 seconds.  I'm also not sure that more information (as from two miners at once) could be displayed without some lower-level mucking around in the display software to make the text smaller.  Perhaps rendering text (in a smaller font) to an image and uploading that to the display would work.

Very, VERY cool :) It's nice to see people getting some use out of this!

Yeah, the text size isn't something you can set, at least with the library code I've looked at. As you say, the next best bet would be to render up an image in the background and then display it. Kinda old school style ;)

As for the screen blanking every time it's restarted - you could try commenting out line 341 in cgminerLCDStats.py:
  #   display.clear_lines(TextLines.ALL, BackgroundColours.BLACK)

Not sure that will work as expected, but it's worth a try.

Thanks for sharing your tip for monitoring multiple instances. I'll try and add that to the readme.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: P_Shep on November 19, 2013, 07:46:11 PM
Took a little work, but got it running on my router:

https://i.imgur.com/q7fnSSF.jpg (http://imgur.com/q7fnSSF)


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: P_Shep on November 20, 2013, 10:00:00 AM
Noticed that you're using 'stats' just to get the elapsed time... It's a HUGE transfer and elapsed time is already available in the 'summary' data.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: skleven on November 20, 2013, 10:25:56 AM
Is there any chance of getting this to work in windows??


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: P_Shep on November 20, 2013, 07:09:30 PM
Mixed mine up a bit.
Changed the format of the uptime
Split the hash rate and blocks found and added colour (red if hash rate too low)
Added temp (displays highest temp) with colour (green -> yellow -> red)
Added colour to MtGOX text too.

https://i.imgur.com/SWWCmwk.jpg (http://imgur.com/SWWCmwk)


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Rohks on November 22, 2013, 10:32:43 PM
Looks awesome! I think I might order one of those LCDs and see if I can get it up and running for myself. Great work


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: cardcomm on November 23, 2013, 12:02:22 AM
This is really sweet guys! I'm SO please y'all are finding a use for my little script, and making so many cool changes to it.

This has been a long tough today - it means a lot to check this thread and see people getting use from my small effort. Awesome!

BTW, that router hack is extra cool! I love this forum :)


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Vertiayn on November 24, 2013, 04:40:31 PM
Is there any chance of getting this to work in windows??

I actually wrote a Windows version similar to this a few months back. Runs on Windows 7, 8 and 8.1 currently for BFGminer and CGminer.

If there's an interest in it, I'll upload the code to Github.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: skleven on December 20, 2013, 12:56:31 AM
Would be awsome. :) Have one of these displays collecting dust, and would be fun to actualy use it too. I have never in my life touched linux, and wont try either.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ct1aic on March 10, 2014, 05:51:33 PM
With the end of MtGox, is there a new version of cgminerLCDStats that could get the price of the BTC at other exchange?

Many thanks in advance.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: alleopathy on March 13, 2014, 02:39:17 AM
Is that possible only tour recommended LCD display?
I've other 320*240 resolution one.
 ???
Thanks for your great info.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: Suave on March 13, 2014, 03:01:57 AM
This is cool. How did I not see this months ago?


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: wolf_miner on March 13, 2014, 06:59:09 PM
Hi, my display is on the way....  ;D was shipped from HK yesterday but i have to wait 20~30 days before it will be in my hand  :'( .



Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: yslyung on April 03, 2014, 04:57:47 PM
total noob on *nix ! but i still ordered the display & a Rpi. many questions to be asked for sure when both of them arrives. currently running on windows. can it work on windows ? yeah also the mtgox"ed" ticker, how to change that to other exchanges ?

awesome scrypt & idea. thx for sharing  8)


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: yslyung on April 14, 2014, 05:55:00 AM
display arrived. managed to get it installed but then the display works & switches to a screen that says "error check miner [error 5] input/output"
running on minepeon 0.2.4.4 cgminer 3.12.3 mining on OSM boards.
installed using this guide : http://minepeon.com/forums/viewtopic.php?f=23&t=636


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: yslyung on April 14, 2014, 07:32:08 AM
display arrived. managed to get it installed but then the display works & switches to a screen that says "error check miner [error 5] input/output"
running on minepeon 0.2.4.4 cgminer 3.12.3 mining on OSM boards.
installed using this guide : http://minepeon.com/forums/viewtopic.php?f=23&t=636

i think i may have "fixed" the problem !

plugged the usb cable from display directly to rpi usb & it works pretty normal now.

many thx to OP & the community that wrote & contributed to this.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ManeBjorn on April 14, 2014, 08:27:36 AM
This would be a great addition to the Dragon Miners that come without the LCD's.  Has anyone tried to add one to them?


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: yslyung on April 14, 2014, 08:34:29 AM
This would be a great addition to the Dragon Miners that come without the LCD's.  Has anyone tried to add one to them?

hey mane,

been seeing your post on the threads i read lol .... yeah i think some dragon miners dont have lcd. i think as long as it is runnin on a rpi it "should" work. grab 1 & try it out.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ManeBjorn on April 14, 2014, 08:45:05 AM
HI,
Thanks I do get around on here I think.
I have a Dragon at my house right now I am testing for a review on CCN.  My article list is here.  http://www.cryptocoinsnews.com/author/scott-fargo/ (http://www.cryptocoinsnews.com/author/scott-fargo/)
I will see if I can get one of these in time to test on it.
That will be interesting.
It does run cgminer 3.9+

This would be a great addition to the Dragon Miners that come without the LCD's.  Has anyone tried to add one to them?

hey mane,

been seeing your post on the threads i read lol .... yeah i think some dragon miners dont have lcd. i think as long as it is runnin on a rpi it "should" work. grab 1 & try it out.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ManeBjorn on April 14, 2014, 09:04:24 AM
I had $13 in ebay credit so I got one ordered.
I am looking forward to this.

This would be a great addition to the Dragon Miners that come without the LCD's.  Has anyone tried to add one to them?

hey mane,

been seeing your post on the threads i read lol .... yeah i think some dragon miners dont have lcd. i think as long as it is runnin on a rpi it "should" work. grab 1 & try it out.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ct1aic on May 08, 2014, 03:33:56 PM
With the end of MtGox, is there a new version of cgminerLCDStats that could get the price of the BTC at other exchange?

Many thanks in advance.
Any news about this?


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: yslyung on May 08, 2014, 04:15:34 PM
With the end of MtGox, is there a new version of cgminerLCDStats that could get the price of the BTC at other exchange?

Many thanks in advance.
Any news about this?

mine is displaying bitstamp. do a search on minepeon forums. i got mine there.


Title: Re: Display your cgminer Stats on a small LCD Display (cgminerLCDStats)
Post by: ct1aic on May 08, 2014, 05:27:51 PM
With the end of MtGox, is there a new version of cgminerLCDStats that could get the price of the BTC at other exchange?

Many thanks in advance.
Any news about this?

mine is displaying bitstamp. do a search on minepeon forums. i got mine there.
Many thanks, yslyung.