Author

Topic: basic cgminer commands via SSH: display miner status? (Read 335 times)

newbie
Activity: 10
Merit: 0
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
sr. member
Activity: 463
Merit: 309
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
legendary
Activity: 2030
Merit: 1569
CLEAN non GPL infringing code made in Rust lang
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.
newbie
Activity: 10
Merit: 0
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.
Jump to: