getumbrel / umbrel

A beautiful home server OS for self-hosting with an app store. Buy a pre-built Umbrel Home with umbrelOS, or install on a Raspberry Pi or any x86 system.
https://umbrel.com
Other
7.43k stars 533 forks source link

USB not recognized by Raspberry Pi while running CGminer, #1058

Open justh0dl opened 3 years ago

justh0dl commented 3 years ago

I wanted to use Umbrel alongside of CGminer so I can run a node and mine Bitcoin on the same Raspberry Pi. The intention was to use Umbrel and the node / lightning node, then ssh in to control cgminer via command line

The device used is the GekkoScience Compac F: https://bitcointalk.org/index.php?topic=5355470.msg58200639#msg58200639

In general, one should be able to use this version of CGminer to run most miners that are readily available to residential people.

In order to compile cgminer on umbrel, i logged in via ssh and used the following commands:

-- sudo apt-get update sudo apt-get upgrade -y

sudo apt-get install -y build-essential autoconf automake libtool pkg-config libcurl4-openssl-dev libudev-dev libusb-1.0-0-dev libncurses5-dev zlib1g-dev git

cd git clone https://github.com/kanoi/cgminer.git cd cgminer

CFLAGS="-O2 -march=native -fcommon" ./autogen.sh --enable-gekko --enable-icarus

sudo make install

After installing this, and using the official power supply i was able to get CGminer compiled to run, but it was not able to find any of the USB devices. Directly or thru the hub on any of the USB ports.

The hub had its own power supply.

All that comes up is a notice that says "No devices detected!" and "Waiting for USB hotplug devices or press q to quit"

Would anyone know how to be able to get this installed and be able to run both simultaneously?

Apologies if this was filed incorrectly.

thanks!

lukechilds commented 3 years ago

Wow awesome, excited to see people mining with Umbrel!

After installing this, it seems to have given me a synchronization issue with Bitcoin Core & there doesn't seem to be any connections.

I'm not sure why that would be but as far as I can see none of the commands you've provided would stop Bitcoin Core functioning.

I was able to get CGminer to run, but it was not able to find any of the USB devices. All that comes up is a notice that says "No devices detected!" and "Waiting for USB hotplug devices or press q to quit"

Again I'm not sure why that might be, we haven't tested Umbrel with mining hardware, I'd suggest searching for more general solutions related to Raspberry Pi hardware than specific to Umbrel, since I think you may be the first person running this harware combo on Umbrel.

One suggestion would be to make sure you're plugging the miner into a powered USB hub. The Pi isn't able to supply much power over it's USB ports and I'm sure the mining device is expecting to be able to draw a lot.

Please keep us posted on your progress, I'd love to know how you get on!

justh0dl commented 3 years ago

I actually think you are right. I actually reset everything post installation to do a fresh install without cgminer and ran into the same synchronization issue.

The long term goal is to be able to publish guides on how to mine with any Pi 4 + Umbrel as Umbrel by far has the best UI of any node projects out there and make it an the ultimate easy to use BTC device.

I should be able to mine with Wifi, run whirlpool BTC pay, the node and all that jazz since mining is such a simple process.

I did try the ssh re-validate the chain command to see if that fixes it (i changed the block and chain state folder to my copy of the Blockchain which i had already validated).

Any ideas on how to troubleshoot the sync issue?

I will try again with an external hub..i was testing directly on the Pi

lukechilds commented 3 years ago

Do you still have the miner plugged in? It could still be drawing too much power and causing instability.

Also are you using all the reccomended hardware on our website? Often unnoficialy power supplies or SSDs can cause stability issues.

Finally are you in a country that blocks access to Tor? The blockchain sync happens over the Tor network.

justh0dl commented 3 years ago

The miner is not plugged in. I was under the impression compiling cgminer caused the synchronization issue.

I am using the following ssd combo:

https://www.amazon.com/dp/B07MNFH1PX https://www.ebay.com/itm/384227269236

It was working fine prior to compiling cgminer so i don't think the SSD is the issue.

I reinstalled everything from scratch after cgminer failed but i did restore the previous wallet that was generated to save time on writing a new seed phrase.

I'm in the US which doesn't block tor as far as I know.

I will try it with the official power supply and a fresh install later today.

justh0dl commented 2 years ago

So update here, seems like using the official PSU or the latest update fixed the sync issue but i was not able to get the USB sticks identified and hashing. This did work on myNode though, not sure what's causing the issue but i would be happy to try again if you have any suggestions.

Note, when ssh-ing into the pi, i also installed tmux which allows you to run cgminer in the background

saxtron3000 commented 2 years ago

Amazed to stumble upon this project since it is EXACTLY what I have been planning for some time!

My Umbrel node and Gekko Science NewPac are both working well separately. I have been looking for someone who managed to get this working. Thanks for the TMUX tip, I'm sure it helps navigate and layer the scripts correctly.

I would have suggested that the USB read-error could have been the absence of the correct drivers? Looks like you got everything worked out.

Certainly motivating to hear it's possible.

It would be amazing if Umbrel would bring in CGMiner to their appstore!

Wombat76 commented 1 year ago

hey bro I had USB hotplug issue, its as simple as not enough power, check your cords also, it took me ages to fix but it was something so simple

erytheio commented 1 year ago

hey bro I had USB hotplug issue, its as simple as not enough power, check your cords also, it took me ages to fix but it was something so simple

Hey! How did you get it to work? Are you using Umbrel too? I have the same no devices detected issue, it cannot be a not enough power problem because I have the Gekko plugged in a powered USB hub, I managed to get cgminer working (it's detecting the new blocks).

If helps someone, I had the Bictcoin Node sync issue but I restarted the Raspberry and it works again :)

Pelepe commented 1 year ago

hey bro I had USB hotplug issue, its as simple as not enough power, check your cords also, it took me ages to fix but it was something so simple

Hey! How did you get it to work? Are you using Umbrel too? I have the same no devices detected issue, it cannot be a not enough power problem because I have the Gekko plugged in a powered USB hub, I managed to get cgminer working (it's detecting the new blocks).

If helps someone, I had the Bictcoin Node sync issue but I restarted the Raspberry and it works again :)

In my case, I can confirm that when running umbrel with an SSD for a btc node(no external power), if I connect an external-powered-usb-hub with a Compac F, I cannot get RaspberryPi to detect it. CGminer simply doesn't work ("No devices detected"). I tried the same configuration but disconnecting the SSD and everything works perfect.

I suppose it is a power instability issue as @lukechilds said above. I just got used to the idea I cannot get both projects to work on the same Raspberry Pi.