How to Stop CGMiner from Taking Serial Ports?

12 replies 344 views
mr_ch4dMember
Posts: 48 · Reputation: 41
#1Nov 13, 2019, 05:00 AM
Anyone figured out how to stop CGMiner from taking over the serial ports? I'm trying to use /dev/ttyUSB0 for another app, but CGMiner grabs it every time.
2 Reply Quote Share
pr0to88Member
Posts: 1222 · Reputation: 235
#2Nov 13, 2019, 11:04 AM
Try launching the other app first. Get it running, then fire up CGMiner and add the USB devices. If the other app is already active, maybe CGMiner will just step over those ports.
1 Reply Quote Share
wallet_vaultFull Member
Posts: 321 · Reputation: 431
#3Nov 15, 2019, 07:16 PM
You could check this guide from cgminer.info about command-line arguments. If that doesn't help, how about running CGMiner under a different user?
0 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#4Nov 15, 2019, 10:49 PM
Thanks for the suggestion! I did that and it still closes all other serial apps when CGMiner kicks in. Just super annoying because those ports work fine without it.
2 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#5Nov 16, 2019, 03:00 AM
Hey, I appreciate the tips. I'm gonna give that a shot and see if it makes a difference. Fingers crossed!
2 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#6Nov 16, 2019, 04:17 AM
You nailed it! Once I found out what ports the miners were using, setting the command like usb 1:11,1:8,1:5,1:14 helped it run without snagging the other serial ports.
3 Reply Quote Share
planktonHero Member
Posts: 1284 · Reputation: 2049
#7Nov 17, 2019, 05:36 AM
Awesome you figured it out! Are you on Kano's updated version of CGMiner? If not, there's a link in my profile. Also, Sidehack has a new Smart Hub that could be useful.
4 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#8Nov 17, 2019, 11:33 AM
Yep, I'm on Kano's 4.12.1. It’s been solid for me except for that port issue, but all good now.
2 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#9Nov 17, 2019, 04:54 PM
For those interested, I put together a shell script that lists USB devices with matching IDs and launches CGMiner with those devices specified. Just place it in the CGMiner folder as cgstart.sh.
0 Reply Quote Share
wallet_vaultFull Member
Posts: 321 · Reputation: 431
#10Nov 17, 2019, 10:41 PM
Nice script! That’s gonna save a lot of time. A couple thoughts though. Maybe make the sleep command longer since CGMiner clears the screen? Also, could you loop it for multiple devices?
4 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#11Nov 18, 2019, 03:36 AM
Hey, I initially set the sleep for 15 seconds while I was debugging. It's easy to adjust. The script checks all USB devices, so new ones will show up when you run it.
1 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#12Nov 18, 2019, 04:22 AM
I updated the code so now it also shows unused devices. Output looks pretty neat!
2 Reply Quote Share
mr_ch4dMember
Posts: 48 · Reputation: 41
#13Nov 18, 2019, 06:54 AM
Just for kicks, I added an old antminer U2. It shows as a CP2102 USB to UART Bridge Controller and identifies correctly. Here’s how the output looks now.
6 Reply Quote Share

Related topics