rkharris12 / fpga_bitcoin_miner

48 stars 27 forks source link

Problems connecting to server pool #7

Open latemine opened 2 years ago

latemine commented 2 years ago

Hello, I'm having issues getting the python script to run. Any help would be greatly appreciated.

Command: python3 .\fpgaminer.py -i python -o stratum+tcp://stratum.slushpool.com:3333 -u usernameC -p password

Logs: [2021-12-14 00:43:58] [INFO] Starting server on stratum.slushpool.com:3333 [2021-12-14 00:44:27] [ERROR] ERROR: generator raised StopIteration [2021-12-14 00:44:31] [ERROR] ERROR: generator raised StopIteration [2021-12-14 00:44:35] [INFO] Found share: ['username', '2db89b7a34', '00000000', '61b83d50', '000006e9'] [2021-12-14 00:44:35] [INFO] Found share: ['username', '2db89b7a34', '00000000', '61b83d50', '0000070d'] [2021-12-14 00:44:39] [ERROR] ERROR: generator raised StopIteration [2021-12-14 00:44:39] [INFO] Share - Invalid Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\username\Desktop\Python_Projects\fpgaminer\fpgaminer.py", line 446, in _handle_incoming_rpc self.handle_reply(request = request, reply = reply) File "C:\Users\username\Desktop\Python_Projects\fpgaminer\fpgaminer.py", line 567, in handle_reply raise self.MinerWarning('Failed to accept submit', reply, request) main.Miner.MinerWarning: Mining Sate Error: Failed to accept submit

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64qbz5n2kfra8p0\lib\threading.py", line 973, in _bootstrap_inner self.run() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64qbz5n2kfra8p0\lib\threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "C:\Users\username\Desktop\Python_Projects\fpgaminer\fpgaminer.py", line 448, in _handle_incoming_rpc output = e.message AttributeError: 'MinerWarning' object has no attribute 'message'

Thanks,

rkharris12 commented 2 years ago

It looks like you are running on a Windows machine and using a different Python version. Did you already modify the script to remove the Pynq modules? I would probably try to create a virtual environment and use Python 3.6.5

latemine commented 2 years ago

FPGA:

Python:

Summary:

rkharris12 commented 2 years ago

You can try running the python script with the -P and -d flags to get some extra debug output.

latemine commented 2 years ago

I added the -P and -d flags and am running the"Python" implementation and I'm not sure it's working quite right. The miner never shows up as connected on slushpool and I get an error message when trying to use nicehash. It looks like it has to do with the "incoming_rpc" based on the exception error. Have you ever seen anything like this before.

Thanks,

Exception Error: Exception has occurred: AttributeError 'MinerWarning' object has no attribute 'message' File "C:\Users\Desktop\fpgaminer\fpgaminer.py", line 448, in _handle_incoming_rpc output = e.message

Log: Python 3.6.5 [2021-12-17 14:22:32] [DEBUG] Using sha256d library 'python' [2021-12-17 14:22:32] [INFO] Starting server on sha256.usa-west.nicehash.com:3334 [2021-12-17 14:22:32] JSON-RPC Server < {"id": 1, "method": "mining.subscribe", "params": ["FPGAMiner/0.1"]}

[2021-12-17 14:22:32] JSON-RPC Server > {"id":1,"error":null,"result":[["mining.notify",""],"051c420db5",7]} [2021-12-17 14:22:32] [DEBUG] Subscribed: subscription_id= [2021-12-17 14:22:32] JSON-RPC Server < {"id": 2, "method": "mining.authorize", "params": ["", ""]}

[2021-12-17 14:22:32] JSON-RPC Server > {"id":2,"result":true,"error":null} [2021-12-17 14:22:32] [DEBUG] Authorized: worker_name= [2021-12-17 14:22:32] JSON-RPC Server > {"id":null,"method":"mining.set_difficulty","params":[65418.999477]} [2021-12-17 14:22:32] [DEBUG] Change difficulty: difficulty=65418.999477 [2021-12-17 14:22:32] JSON-RPC Server > {"id":null,"method":"mining.notify","params":["00000000e0ada4f5","5aa62051b4eaea4ecc79ccdd1dd295772c0d9ac50000930c0000000000000000","02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff29034fe70a0474f1bc612f53424943727970746f2e636f6d20506f6f6c2f","ffffffff02d28ec42500000000160014eb585e955f9bff43defa43f2596782a929843f6f0000000000000000266a24aa21a9ede5b92978b0cdec80112e28f81fa81b750cc2d32a96235f37341d511638245ec700000000",["cd6bcbf4d697c85f2091863457eb3d3e4b83d96626c41512eec2b5bc910813a2","722eea59a89d0535eb04a6b38dc514218fb2996356f9268fefa4099260b2634b","73749ba785a188d8566716648dc68b965bb037070f22c25dfe29d839085ec53c","00f2b36af86b4785f270333758dfbd50b329c9a69f85aca9807a3ccaec92b688","cf89721900bc13203b099b74c72f9e84225e9f7ca6a1626bde8c12ba5dd3fbbd","b6d462ddb57aabd59bf1dcde12377504f789db2559b31981e3545986cf722360","d081a320abd9bfcf8b260c01ff60c88b9cf89e3e25423941377df329d31ef3af","e126c1afea74cf6584e08df30f9d62967019470475814e91d4e08d4e1d2ad5cc","6a70d698423a175904a89e1946ff14a5bfd47bc35ce89281eeefcefc36e62a4f","41807ec3e0e7301aafedec75588a4b9011092c082054285b09c5fbcd333188ba","e1252d05bd1ea4d5a4ece7edfbd727b6ee4f0afff4682fb454f4dce8331369c3"],"20000004","170ba21f","61bcf172",true]} [2021-12-17 14:22:32] [DEBUG] New job: job_id=00000000e0ada4f5 [2021-12-17 14:23:02] JSON-RPC Server > {"id":null,"method":"mining.notify","params":["00000000e0ada4f6","5aa62051b4eaea4ecc79ccdd1dd295772c0d9ac50000930c0000000000000000","02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff29034fe70a049cf1bc612f53424943727970746f2e636f6d20506f6f6c2f","ffffffff0260b8cc2500000000160014eb585e955f9bff43defa43f2596782a929843f6f0000000000000000266a24aa21a9ed9eb01032822090445aad07fb424584cb2ff3478ca12f64cc970b5760896d240d00000000",["cd6bcbf4d697c85f2091863457eb3d3e4b83d96626c41512eec2b5bc910813a2","302cf7cdd9e29f5c10dbf1467f7d69d87d6392b0636c07e24557f450293b04c6","a50e239f71408cc20f3faec18473d21c3d008f057dbe7e6b3763255c56a18151","402dddf24360d611a46fb115d8d311f6d49c7b98cb4b70263b9e81d3fb4cb1d8","dc60ba75796e33d21af283f13272a69c3404b57b59ed3dd805f99cc652bcc40c","57da856af5ac0107aa22e03b5e08eef129b69c61a41cf0952eefc8aee642cdf6","8c34f021adea6cf445a4641dc2740b9595bc934f8c14fce5bf9e829f8fa329b1","aed511441b9e1a01e49a2916b89589ce0679e85c0e833f10439a893761d8cc2c","568b54eb1f9ff2dd33d487c1123a4d3fc5c2ee001869da7570d1d3c034953513","2af5033d95656a698d8caefcb83d932f4ab0366cf62866b2437e7183f5790af3","a96408856ddacedcd253db4cddb8073a9633886090e11e942ed9d6fc6669ad51"],"20000004","170ba21f","61bcf196",false]} [2021-12-17 14:23:02] [INFO] Hashrate: 155.229043 hashes/s [2021-12-17 14:23:02] [DEBUG] New job: job_id=00000000e0ada4f6 [2021-12-17 14:23:32] JSON-RPC Server > {"id":null,"method":"mining.notify","params":["00000000e0ada4f7","5aa62051b4eaea4ecc79ccdd1dd295772c0d9ac50000930c0000000000000000","02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff29034fe70a04c4f1bc612f53424943727970746f2e636f6d20506f6f6c2f","ffffffff029312d32500000000160014eb585e955f9bff43defa43f2596782a929843f6f0000000000000000266a24aa21a9edbb00dc8649ccd4dc8a0c75bd1a0f38ce35b9d133c7acfd0167338f4fb74e697300000000",["cd6bcbf4d697c85f2091863457eb3d3e4b83d96626c41512eec2b5bc910813a2","302cf7cdd9e29f5c10dbf1467f7d69d87d6392b0636c07e24557f450293b04c6","a50e239f71408cc20f3faec18473d21c3d008f057dbe7e6b3763255c56a18151","402dddf24360d611a46fb115d8d311f6d49c7b98cb4b70263b9e81d3fb4cb1d8","00ecaba33bec4d43844a2d711a0c1035fc1cfb0d4d883ee3023fd7af9acee5a3","ae53da40b3908347cba1f53bf2ff9181ae27f46e96af84ef62bba1e1a26af0c5","f4a2563fc3b73a7b2084738f9d2c585e22f70450f5760b9e9a940b6d2d5d4952","7b419c042b5ae7be4b916730648b5072e62023e2c6da7487d28ee868bcc48857","14ddced2591b43fff70ec3501855a1c2a5a270d202fd26fd60cab1a127d8ae41","f2555ddce84e65f1e5564bb6c95c7db40b12538d4589913b5407f94d380c3005","7424dcd5bf450d9c7bd73709a23426fa219caaecb31c554dd595570ff1c01d7b"],"20000004","170ba21f","61bcf1be",false]} [2021-12-17 14:23:32] [DEBUG] New job: job_id=00000000e0ada4f7 [2021-12-17 14:23:32] [INFO] Hashrate: 153.941464 hashes/s [2021-12-17 14:23:42] JSON-RPC Server > {"id":0,"method":"client.reconnect","params":[]}

rkharris12 commented 2 years ago

I have not seen this error before, but I think the problem is that a case for what to do for the "client.reconnect" method is not defined in the handle_reply() function in the python script. Does this error occur on slushpool too?

latemine commented 2 years ago

Yes, if you run in -python mode it will connect to either pool for a short period of time but eventually error out due to the highlighted portion of the code.

def_handle_incoming_rpc(self): try: request = None with self._lock: if 'id' in reply and reply['id'] in self._requests: request = self._requests[reply['id']] self.handle_reply(request = request, reply = reply) except self.RequestReplyWarning as e: output = e.message if e.request: output += '\n ' + e.request output += '\n ' + e.reply log(output, LEVEL_ERROR)

rkharris12 commented 2 years ago

I think that confirms my suspicion about a case for what to do for the "client.reconnect" method not being defined in the handle_reply() function in the python script. The script tries to execute handle_reply() but fails and issues a warning that is logged in the except block.

Does this happen with just the python implementation, or the other implementations too? I suspect since the hashrate is so low the server thinks something is wrong and tries to reconnect.

If it does happen for the other implementations, I might look into adding a case for handling a client.reconnect request.