Monday, April 29, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2068  / 2 Years ago, wed, june 29, 2022, 11:51:34

Okay, bear with me on this. I'm using a program called BFGminer, which hopefully you know is a bitcoin mining program. Anyway. It updates every second a few lines that look like this:



DEVICE 0: xxxx
DEVICE 1: xxxx


This is just the basics of what I am concerned about. I need a way to view these few lines from a terminal window if possible. The only issue that I have is that I can not seem to get grep to update the pipe I have coming into it.



I have the command running on another machine, and that machine also has a screen with BFGminer running.



So to access BFGminer's window, I am running a script to



ssh [email protected] screen -R


This gets me to the screen, but I have to press ctrl+A, then D to detach it so it will continue to run.



If I run



ssh [email protected] screen -R | grep "^ DEV"


I can view all devices connected. Good so far. However, it does not update every few seconds like I need it to...



EDITED: figured out what to do. See answer.


More From » command-line

 Answers
5
ssh [email protected] ./RPC.sh


RPC.sh contains:



cd /opt/bfgminer/
while : ; do clear && ./bfgminer-rpc && sleep 5; done;


Looks like: http://pastebin.com/wrTb18TL



Does a good enough job. It just doesn't have all the info I need. I'll make a new question later for trying to analyze the data if I can't figure it out.



Thanks everyone for the ideas :)



EXPLANATION:
turns out bfgminer has a RPC (Remote procedure call) feature. All you need to do is add a flag when you start bfgminer. "--enable-api"



I haven't figured out how to tidy up the output yet using grep. But at least this will update properly with some of the needed information.


[#30033] Wednesday, June 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
socelebrate

Total Points: 274
Total Questions: 123
Total Answers: 124

Location: Saint Helena
Member since Mon, Jan 16, 2023
1 Year ago
;