Pages:
Author

Topic: Display your cgminer Stats on a small LCD Display (cgminerLCDStats) - page 2. (Read 10649 times)

legendary
Activity: 1795
Merit: 1208
This is not OK.
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.
legendary
Activity: 1795
Merit: 1208
This is not OK.
Took a little work, but got it running on my router:

sr. member
Activity: 294
Merit: 250
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 Smiley 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 Wink

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.
hero member
Activity: 651
Merit: 501
My PGP Key: 92C7689C
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.
legendary
Activity: 1795
Merit: 1208
This is not OK.
Awesome! Just wish I had a spare USB port free. Would look great sitting on my router Smiley
sr. member
Activity: 1316
Merit: 253
Sugars.zone | DatingFi - Earn for Posting


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.

sr. member
Activity: 294
Merit: 250
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.
sr. member
Activity: 336
Merit: 250
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.
sr. member
Activity: 1316
Merit: 253
Sugars.zone | DatingFi - Earn for Posting

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.
full member
Activity: 158
Merit: 100
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
sr. member
Activity: 434
Merit: 250
Pretty sweet, thanks for sharing.
sr. member
Activity: 336
Merit: 250
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?
sr. member
Activity: 294
Merit: 250
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.
sr. member
Activity: 336
Merit: 250
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!
sr. member
Activity: 294
Merit: 250
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.
full member
Activity: 158
Merit: 100
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 ?
sr. member
Activity: 294
Merit: 250
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.
hero member
Activity: 651
Merit: 501
My PGP Key: 92C7689C
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.
sr. member
Activity: 336
Merit: 250
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.  Angry

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.
sr. member
Activity: 294
Merit: 250
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.  Angry

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)
Pages:
Jump to: