Bitcoin Forum
May 10, 2024, 06:07:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: basic cgminer commands via SSH: display miner status?  (Read 306 times)
DordOfLarkness (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
June 30, 2019, 05:02:25 PM
Last edit: July 01, 2019, 10:54:17 AM by frodocooper
 #1

Greetings.  I've been enjoying using cgminer with my Avalon 841.
While, yes, I can log into my Openwrt server via the web client, I've been preferring to start/stop the miner via SSH and a terminal window.  (Which I now have an automated command set up on my phone that I can even use Siri to start or stop the miner by just saying "miner stop" or "miner start". Kinda stupid, but so am I.)

One thing I haven't figured out is how to get the status of the miner via SSH.  Yes, I know I can get the info via the web client...even remotely.  I'm just curious if this is possible via SSH.

Available commands:

Code:
	start	Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if that fails)
enable Enable service autostart
disable Disable service autostart

I would think there would be a "status" command or something.  Looking in the readme, I find some neat options (-V to see the version and -n to see what's connected via USB) but nothing that tells me if it's running and what pool it's connected to...  I'm sure I'm missing something very basic...

Thanks!



Also noticing that -V and -n work when calling cgminer from the root directory:

Code:
root@OpenWrt:~# cgminer -V
cgminer 4.10.0

they don't work when calling them from /etc/init.d/cgminer

Code:
root@OpenWrt:~# /etc/init.d/cgminer -V
Syntax: /etc/init.d/cgminer [command]

Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if that fails)
enable Enable service autostart
disable Disable service autostart

Obviously, there are some extremely basic Linux/Openwrt concepts I'm missing here and I'm probably playing with fire somewhat haha.
1715364465
Hero Member
*
Offline Offline

Posts: 1715364465

View Profile Personal Message (Offline)

Ignore
1715364465
Reply with quote  #2

1715364465
Report to moderator
1715364465
Hero Member
*
Offline Offline

Posts: 1715364465

View Profile Personal Message (Offline)

Ignore
1715364465
Reply with quote  #2

1715364465
Report to moderator
1715364465
Hero Member
*
Offline Offline

Posts: 1715364465

View Profile Personal Message (Offline)

Ignore
1715364465
Reply with quote  #2

1715364465
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715364465
Hero Member
*
Offline Offline

Posts: 1715364465

View Profile Personal Message (Offline)

Ignore
1715364465
Reply with quote  #2

1715364465
Report to moderator
1715364465
Hero Member
*
Offline Offline

Posts: 1715364465

View Profile Personal Message (Offline)

Ignore
1715364465
Reply with quote  #2

1715364465
Report to moderator
Artemis3
Legendary
*
Offline Offline

Activity: 2030
Merit: 1563


CLEAN non GPL infringing code made in Rust lang


View Profile WWW
July 02, 2019, 11:07:12 PM
Last edit: July 03, 2019, 11:12:26 AM by frodocooper
Merited by frodocooper (3)
 #2

Indeed, what you are confusing is the script ("batch" in ms parlance) file to start the cgminer "service" (they are called "daemons" in *nix) with the actual cgminer binary. You ran the actual cgminer binary when you did that -V command option, so do that again with -h or --help to find out what commands cgminer accepts. Presumably that binary is located in /usr/bin, i don't have an avalon to find out, but you don't need the full path like you do when calling the script that calls cgminer, because the binary, as opposed to the script that calls it at boot, is in the system path already.

Do note that there is usually a cgminer instance running already, to stop it you would use that "service" script, like: /etc/init.d/cgminer stop then issue the commands to cgminer directly to see/test what options you want, once settled you could modify the starting script. BUT, cgminer also reads its own configuration file, which should be in /etc/cgminer.conf or similar.

You can read the actual documentation here,  but asic manufacturers often modify and add their own options which might not be shown there.

The developer is an active moderator in this board (-ck). I don't know the story but i think he got bored with it or something and its not maintained much lately.

██████
███████
███████
████████
BRAIINS OS+|AUTOTUNING
MINING FIRMWARE
|
Increase hashrate on your Bitcoin ASICs,
improve efficiency as much as 25%, and
get 0% pool fees on Braiins Pool
PassThePopcorn
Sr. Member
****
Offline Offline

Activity: 465
Merit: 309


View Profile
July 03, 2019, 01:48:36 PM
Last edit: July 04, 2019, 10:32:47 AM by frodocooper
Merited by frodocooper (3)
 #3

Hit cgminer-api for the Avalons.
So something like

Code:
cgminer-api stats

You can also read the cgminer repo to get some examples of connecting to the api without sshing in. These examples are "api-example.(language file)"

This repo is the Canaan Creative repo, they push it to the main repo Artemis3 posted but it's updated quicker on theirs.
https://github.com/Canaan-Creative/cgminer
DordOfLarkness (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
July 03, 2019, 05:20:12 PM
 #4

Great! Makes sense.    Thanks for the hot tips, the info, and the links.  Woo hoo!

I'll drop back in if I have further questions.

Really appreciate it!   Cheesy Cheesy Cheesy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!