Code Monkey home page Code Monkey logo

Comments (26)

UpstreamData avatar UpstreamData commented on July 24, 2024

I believe I fixed this exact issue earlier, I was having a similar issue. Try with v0.36.0.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

Before I wrote the message above, I did update to v.036.0 but also at the same time T19 became functioning, so I wasnt 100% if updating or T19 becoming responsive was the solution.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

Had an issue again, seems that script was get heavily delayed, and because its ran every minute, bottlenecks and then whats written to the server gets delayed by 10-15 minutes. T19 BOS+ was causing it, here is the error

/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py:98 in _get_ssh_connection
[WARNING][06/25/23 04:54:09](root) - Connection refused: BOSMiner T19: 172.16.1.200
/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py:98 in _get_ssh_connection
[WARNING][06/25/23 04:54:24](root) - Connection refused: BOSMiner T19: 172.16.1.200

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

There's only a few places _get_ssh_connection can be called, one of them is get_fw_version. Ssh has a tendency to cause issues and be pretty slow, so if you don't absolutely need fw_version it would just remove it from your list of data_to_get when calling get_data.

Not sure why it take so long for it to realize it's refusing connection, and that will be tough to troubleshoot because replicating that specific case is pretty tough. I'll see what I can do though, maybe wrap it in a wait_for and have it timeout, but this can lead to a bunch of issues with canceling tasks inside tasks, so I'll see. Might be a fair bit of work.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

I am experiencing this right now with a another T19 or S19 BOS+ miner, the miner in the gui says Ubus error: Command failed: Request timed out when trying to log in through gui. I removed fw_ver from datapoints in my script, this part

data = await asyncio.gather(*[m.get_data(data_to_get = [
                "mac",
                "model",
                "api_ver",
                "fw_ver",
                "hashrate",

but script still hanging

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

Forgot MAC address, and it is forced to go through ssh, try removing that one? If it's that, I'll remove references to send_ssh_command where possible and try to get graphql info on some of that, or maybe query luci or something...

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

It was s19 BOS+, it unfroze just right now, so it ll have to wait until next freeze to try the mac address. Pity. But the whole thing lasted just over 2h and although data was collected it was at irregular intervals and live ish status updates wont possible

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

Seems like I should just try to remove as much of the ssh command stuff as possible.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

How does btctools get this info? It returns mac and everything and very fast too.

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

They're querying LUCI, see source here - https://github.com/btccom/libbtctools/blob/master/src/lua/scripts/scanner/BosHttpLuci.lua

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

I set up LUCI querying, and get_mac now runs off of that. See if 0.36.1 works any better for you?

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

Ok converting to it now, thank you

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

There was a bug, seems like later version of BOS+ only respond if you set BTCTools as your user agent header, it should be fixed in 0.36.2

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

ok, updated

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

t19 hung again, the every minute script stopped working because it gives the following error (t19 hang screenshotted)

200
[{"macaddr":"00xx"}]
200
[{"macaddr":"ecxx"}]
200
[{"macaddr":"14xx"}]
200
[{"macaddr":"a4xx"}]
200
[{"macaddr":"f4:xx"}]
Traceback (most recent call last):
  File "/home/sf/pyasic/production.py", line 65, in <module>
    asyncio.run(scan_and_get_data())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/sf/pyasic/production.py", line 28, in scan_and_get_data
    data = await asyncio.gather(*[m.get_data(data_to_get = [
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py", line 497, in get_data
    gathered_data = await self._get_data(allow_warning, data_to_get=data_to_get)
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py", line 416, in _get_data
    web_command_data = await self.web.multicommand(
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/web/bosminer.py", line 91, in multicommand
    data = dict(**luci_data, **gql_data)
TypeError: dict() argument after ** must be a mapping, not NoneType
Screenshot 2023-06-30 at 04 14 31

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

and if I remove "mac" from my get_data then I get error

Traceback (most recent call last):
  File "/home/sf/pyasic/production.py", line 64, in <module>
    asyncio.run(scan_and_get_data())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/sf/pyasic/production.py", line 28, in scan_and_get_data
    data = await asyncio.gather(*[m.get_data(data_to_get = [
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py", line 497, in get_data
    gathered_data = await self._get_data(allow_warning, data_to_get=data_to_get)
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py", line 416, in _get_data
    web_command_data = await self.web.multicommand(
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/web/bosminer.py", line 91, in multicommand
    data = dict(**luci_data, **gql_data)
TypeError: dict() argument after ** must be a mapping, not NoneType

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

I tried to release new versions yesterday, but working on a laptop I don't usually use, it didn't push my tags to publish the releases. Can you try and see if it raises that error in 0.36.7?

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

Great stuff, I updated, I ll let you know, thank you.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

Looks like didnt work, I have no data at night for about 2h, coincided with a bos+ going offline. I was sleeping so couldnt check what was happening

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

happening again, here is the error

Traceback (most recent call last):
  File "/home/sf/pyasic/production_print_only.py", line 62, in <module>
    asyncio.run(scan_and_get_data())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/sf/pyasic/production_print_only.py", line 28, in scan_and_get_data
    data = await asyncio.gather(*[m.get_data(data_to_get = [
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py", line 547, in get_data
    gathered_data = await self._get_data(allow_warning, data_to_get=data_to_get)
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/base.py", line 500, in _get_data
    miner_data[data_name] = await function(**args_to_send)
  File "/home/sf/.local/lib/python3.9/site-packages/pyasic/miners/backends/bosminer.py", line 1041, in get_fault_light
    data = (
AttributeError: 'NoneType' object has no attribute 'strip'

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

Fixed that one in 0.36.10. That's ssh related, but should only pause for 10 seconds, and its happeneing when checking fault_light status, which you can just remove from the list.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

ah ok I was running 0.36.9 when I got that error, updated and I ll keep monitoring

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

one t19 bos+ is hanging, script is giving the following error

Traceback (most recent call last):
  File "/home/sf/pyasic/production_print_only.py", line 62, in <module>
    asyncio.run(scan_and_get_data())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/sf/pyasic/production_print_only.py", line 49, in scan_and_get_data
    print(item)
NameError: name 'item' is not defined

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

That one appears to be in your script, not sure why it's happening but you might have a bad variable name or something.

from pyasic.

gav1111 avatar gav1111 commented on July 24, 2024

you are right, the for loop was commented out when cycling through each item in the data array. ok we wait again for the next hang

from pyasic.

UpstreamData avatar UpstreamData commented on July 24, 2024

I'm going to close this for now, it's pretty old at this point so I assume it's working as intended. Let me know if anything changes 👍

from pyasic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.