Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially supported miner found #451

Open
Ben-in-Chicago opened this issue Dec 20, 2024 · 17 comments
Open

Partially supported miner found #451

Ben-in-Chicago opened this issue Dec 20, 2024 · 17 comments

Comments

@Ben-in-Chicago
Copy link

Version of the custom_component

1.1.18

Configuration

Add your logs here.

Describe the bug

Assuming because Braiins is not open-sourced, but reporting the issue regardless since it was suggested by the log.

Debug log

This error originated from a custom integration.

Logger: py.warnings
Source: custom_components/miner/config_flow.py:59
integration: HASS-miner (documentation, issues)
First occurred: 10:45:25 (1 occurrences)
Last logged: 10:45:25

/usr/local/lib/python3.13/site-packages/pyasic/miners/factory.py:869: UserWarning: Partially supported miner found: Braiins Mini Miner BMM 101, please open an issue with miner data and this model on GitHub (https://github.com/UpstreamData/pyasic/issues). warnings.warn(

image

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 20, 2024

I should be able to add this, just not sure what the chip count will be. I'll figure it out shortly.

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 23, 2024

Should be mostly done in v1.1.19, but it will log a missing chip count for that miner...

@Ben-in-Chicago
Copy link
Author

Thanks, Brett!

@Ben-in-Chicago
Copy link
Author

Hi! I am seeing this now. Do you want me to open a new issue?

This error originated from a custom integration.

Logger: custom_components.miner.coordinator
Source: custom_components/miner/coordinator.py:91
integration: HASS-miner (documentation, issues)
First occurred: 16:40:28 (33 occurrences)
Last logged: 17:16:04

LUCI web command failed: command=admin/network/iface_status/lan, code=401
Traceback (most recent call last):
  File "/config/custom_components/miner/coordinator.py", line 91, in _async_update_data
    miner_data = await self.miner.get_data(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<13 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 535, in get_data
    gathered_data = await self._get_data(
                    ^^^^^^^^^^^^^^^^^^^^^
        allow_warning=allow_warning, include=include, exclude=exclude
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyasic/miners/base.py", line 460, in _get_data
    await asyncio.gather(rpc_command_task, web_command_task)
  File "/usr/local/lib/python3.13/site-packages/pyasic/web/braiins_os/bosminer.py", line 67, in multicommand
    data[command] = await self.send_command(
                    ^^^^^^^^^^^^^^^^^^^^^^^^
        command, ignore_errors=ignore_errors
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pyasic/web/braiins_os/bosminer.py", line 54, in send_command
    raise APIError(
        f"LUCI web command failed: command={command}, code={data.status_code}"
    )
pyasic.errors.APIError: LUCI web command failed: command=admin/network/iface_status/lan, code=401


image

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

Let me take a look. It's a bit weird that is happening, I think those commands should only work on like S9s, I may have used the wrong backend?

@Ben-in-Chicago
Copy link
Author

I'm unsure, but happy to help however I can. Happy Holidays!

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

Seems like it isn't identifying properly? What is the model showing up in the device info tab as?

image

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

FYI if you have the ability, what I need is the result of the devdetails command. If you don't know how to do that, I can send a bash script or powershell script depending if youre on windows or linux.

@Ben-in-Chicago
Copy link
Author

Seems like it isn't identifying properly? What is the model showing up in the device info tab as?

image

I'm not even getting that far. Tried adding it again:

image

...and seeing this in the logs now as well:

image

@Ben-in-Chicago
Copy link
Author

FYI if you have the ability, what I need is the result of the devdetails command. If you don't know how to do that, I can send a bash script or powershell script depending if youre on windows or linux.

I am on Windows right now. My HA is running on the HA Green pre-built product.

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

Yeah its not identifying. Sec.

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

To use this, make a new text file, paste this data in, and change the "server" variable at the top to match the IP of your miner. Once that's done, change the file extension of the file to .ps1 (if you cant see this, its in file explore top menu, view, then a checkbox that says file name extensions, then you can rename the file). Right click, select "Run with powershell", then send the result in a text file here.

$server = "192.168.1.5"
$port = 4028
$commands = @("devdetails")

try {
    foreach ($cmd in $commands) {
        $client = New-Object System.Net.Sockets.TcpClient
        $client.Connect($server, $port)

        $stream = $client.GetStream()

        $command = '{"command": "' + $cmd + '"}'
        $writer = [System.Text.Encoding]::UTF8.GetBytes($command)

        $stream.Write($writer, 0, $writer.Length)
        $stream.Flush()

        # Read response
        $reader = New-Object System.IO.StreamReader($stream)
        $response = $reader.ReadToEnd()
        $reader.Close()

        # Display the response
        Write-Host "Response for command '$cmd':"
        Write-Host "-------------------------------------------------------------------------------------"
        Write-Host $response
        Write-Host ""


        # Clear the stream for the next command
        $stream.Flush()
        # Close the connection
        $client.Close()
    }

    # Wait for a key press
    Read-Host "Press Enter to exit..."
}
catch {
    Write-Host "An error occurred: $_"
    Read-Host "Press Enter to exit..."
}

@Ben-in-Chicago
Copy link
Author

To use this, make a new text file, paste this data in, and change the "server" variable at the top to match the IP of your miner. Once that's done, change the file extension of the file to .ps1 (if you cant see this, its in file explore top menu, view, then a checkbox that says file name extensions, then you can rename the file). Right click, select "Run with powershell", then send the result in a text file here.

$server = "192.168.1.5"
$port = 4028
$commands = @("devdetails")

try {
    foreach ($cmd in $commands) {
        $client = New-Object System.Net.Sockets.TcpClient
        $client.Connect($server, $port)

        $stream = $client.GetStream()

        $command = '{"command": "' + $cmd + '"}'
        $writer = [System.Text.Encoding]::UTF8.GetBytes($command)

        $stream.Write($writer, 0, $writer.Length)
        $stream.Flush()

        # Read response
        $reader = New-Object System.IO.StreamReader($stream)
        $response = $reader.ReadToEnd()
        $reader.Close()

        # Display the response
        Write-Host "Response for command '$cmd':"
        Write-Host "-------------------------------------------------------------------------------------"
        Write-Host $response
        Write-Host ""


        # Clear the stream for the next command
        $stream.Flush()
        # Close the connection
        $client.Close()
    }

    # Wait for a key press
    Read-Host "Press Enter to exit..."
}
catch {
    Write-Host "An error occurred: $_"
    Read-Host "Press Enter to exit..."
}

Sorry where am I saving this text file?

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

You might not have to put it into a text file, I just need the result for that.

If you're talking about creating rhetorical file itself, it's for windows, you can put it wherever in your system as long as you can find it.

@Ben-in-Chicago
Copy link
Author

You might not have to put it into a text file, I just need the result for that.

If you're talking about creating rhetorical file itself, it's for windows, you can put it wherever in your system as long as you can find it.

When I click "run with PowerShell", I can see the PowerShell open, then I see red font display, then the PowerShell window closes abruptly. Unable to read the text or see any output file.

@b-rowan
Copy link
Collaborator

b-rowan commented Dec 24, 2024

Try this? Make sure you update the IP.

$server = "192.168.1.5"
$port = 4028
$commands = @("devs", "stats", "devdetails", "version")

try {
    foreach ($cmd in $commands) {
        $client = New-Object System.Net.Sockets.TcpClient
        $client.Connect($server, $port)

        $stream = $client.GetStream()

        $command = '{"command": "' + $cmd + '"}'
        $writer = [System.Text.Encoding]::UTF8.GetBytes($command)

        $stream.Write($writer, 0, $writer.Length)
        $stream.Flush()

        # Read response
        $reader = New-Object System.IO.StreamReader($stream)
        $response = $reader.ReadToEnd()
        $reader.Close()

        # Display the response
        Write-Host "Response for command '$cmd':"
        Write-Host "-------------------------------------------------------------------------------------"
        Write-Host $response
        Write-Host ""


        # Clear the stream for the next command
        $stream.Flush()
        # Close the connection
        $client.Close()
    }

    # Wait for a key press
    Read-Host "Press Enter to exit..."
}
catch {
    Write-Host "An error occurred: $_"
    Read-Host "Press Enter to exit..."
}

@Ben-in-Chicago
Copy link
Author

Try this? Make sure you update the IP.

$server = "192.168.1.5"
$port = 4028
$commands = @("devs", "stats", "devdetails", "version")

try {
    foreach ($cmd in $commands) {
        $client = New-Object System.Net.Sockets.TcpClient
        $client.Connect($server, $port)

        $stream = $client.GetStream()

        $command = '{"command": "' + $cmd + '"}'
        $writer = [System.Text.Encoding]::UTF8.GetBytes($command)

        $stream.Write($writer, 0, $writer.Length)
        $stream.Flush()

        # Read response
        $reader = New-Object System.IO.StreamReader($stream)
        $response = $reader.ReadToEnd()
        $reader.Close()

        # Display the response
        Write-Host "Response for command '$cmd':"
        Write-Host "-------------------------------------------------------------------------------------"
        Write-Host $response
        Write-Host ""


        # Clear the stream for the next command
        $stream.Flush()
        # Close the connection
        $client.Close()
    }

    # Wait for a key press
    Read-Host "Press Enter to exit..."
}
catch {
    Write-Host "An error occurred: $_"
    Read-Host "Press Enter to exit..."
}

Same result. I am updating the IP address with and without the quotes. Even tried one of the IP addresses for the 'working' miner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants