anselal / antminer-monitor

Cryptocurrency ASIC mining hardware monitor using a simple web interface
GNU General Public License v3.0
228 stars 145 forks source link

Added miner S9 with OC #127

Closed gddrx closed 4 years ago

gddrx commented 6 years ago

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2309, in call

def __call__(self, environ, start_response):
    """The WSGI server calls the Flask application object as the
    WSGI application. This calls :meth:`wsgi_app` which can be
    wrapped to applying middleware."""
    return self.wsgi_app(environ, start_response)

def __repr__(self):
    return '<%s %r>' % (
        self.__class__.__name__,
        self.name,

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2295, in wsgi_app try: ctx.push() response = self.full_dispatch_request() except Exception as e: error = e response = self.handle_exception(e) except: error = sys.exc_info()[1] raise return response(environ, start_response) finally: File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1741, in handle_exception

if we want to repropagate the exception, we can attempt to

        # raise it with the whole traceback in case we can do that
        # (the function was actually called from the except part)
        # otherwise, we just raise the error again
        if exc_value is e:
            reraise(exc_type, exc_value, tb)
        else:
            raise e

    self.log_exception((exc_type, exc_value, tb))
    if handler is None:

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2292, in wsgi_app ctx = self.request_context(environ) error = None try: try: ctx.push() response = self.full_dispatch_request() except Exception as e: error = e response = self.handle_exception(e) except: error = sys.exc_info()[1] File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1815, in full_dispatch_request request_started.send(self) rv = self.preprocess_request() if rv is None: rv = self.dispatch_request() except Exception as e: rv = self.handle_user_exception(e) return self.finalize_request(rv)

def finalize_request(self, rv, from_error_handler=False):
    """Given the return value from a view function this finalizes
    the request by converting it into a response and invoking the

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1718, in handle_user_exception return self.handle_http_exception(e)

    handler = self._find_error_handler(e)

    if handler is None:
        reraise(exc_type, exc_value, tb)
    return handler(e)

def handle_exception(self, e):
    """Default exception handling that kicks in when an exception
    occurs that is not caught.  In debug mode the exception will

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1813, in full_dispatch_request self.try_trigger_before_first_request_functions() try: request_started.send(self) rv = self.preprocess_request() if rv is None: rv = self.dispatch_request() except Exception as e: rv = self.handle_user_exception(e) return self.finalize_request(rv)

def finalize_request(self, rv, from_error_handler=False):

File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1799, in dispatch_request

request came with the OPTIONS method, reply automatically

    if getattr(rule, 'provide_automatic_options', False) \
       and req.method == 'OPTIONS':
        return self.make_default_options_response()
    # otherwise dispatch to the handler for that endpoint
    return self.view_functions[rule.endpoint](**req.view_args)

def full_dispatch_request(self):
    """Dispatches the request and on top of that performs request
    pre and postprocessing as well as HTTP exception catching and
    error handling.

File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 261, in decorated_view return func(*args, kwargs) elif current_app.login_manager._login_disabled: return func(*args, *kwargs) elif not current_user.is_authenticated: return current_app.login_manager.unauthorized() return func(args, kwargs) return decorated_view

def fresh_login_required(func): ''' File "/home/pi/antminermon/antminermonitor/blueprints/asicminer/views/antminer.py", line 93, in miners

errors = False
miner_errors = {}

for miner in miners:
    miner_stats = get_stats(miner.ip)
    # if miner not accessible
    if miner_stats['STATUS'][0]['STATUS'] == 'error':
        errors = True
        inactive_miners.append(miner)
    else:

File "/home/pi/antminermon/lib/pycgminer.py", line 111, in get_stats return dict(output)

def get_stats(ip): cgminer = CgminerAPI(host=ip) output = cgminer.stats() output.update({"IP": ip}) return dict(output)

if name == 'main': File "/home/pi/antminermon/lib/pycgminer.py", line 90, in out

cgminer.summary()

    """

    def out(arg=None):
        return self.command(attr, arg)

    return out

def get_summary(ip): File "/home/pi/antminermon/lib/pycgminer.py", line 62, in command return dict({'STATUS': [{'STATUS': 'error', 'description': e}]}) else:

the null byte makes json decoding unhappy

        # also add a comma on the output of the `stats` command by
        # replacing '}{' with '},{'
        return json.loads(received[:-1].replace('}{', '},{'))
    finally:
        # sock.shutdown(socket.SHUT_RDWR)
        sock.close()

def _receive(self, sock, size=4096):

File "/usr/lib/python2.7/json/init.py", line 338, in loads

"""
if (cls is None and encoding is None and object_hook is None and
        parse_int is None and parse_float is None and
        parse_constant is None and object_pairs_hook is None and not kw):
    return _default_decoder.decode(s)
if cls is None:
    cls = JSONDecoder
if object_hook is not None:
    kw['object_hook'] = object_hook
if object_pairs_hook is not None:

File "/usr/lib/python2.7/json/decoder.py", line 366, in decode def decode(self, s, _w=WHITESPACE.match): """Return the Python representation of s (a str or unicode instance containing a JSON document)

    """
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    end = _w(s, end).end()
    if end != len(s):
        raise ValueError(errmsg("Extra data", s, end, len(s)))
    return obj

File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode This can be used to decode a JSON document from a string that may have extraneous data at the end.

    """
    try:
        obj, end = self.scan_once(s, idx)
    except StopIteration:
        raise ValueError("No JSON object could be decoded")
    return obj, end

ValueError: Invalid control character at: line 1 column 219 (char 218)

anselal commented 6 years ago

No clue what this all means. It seems that the response from the miner is not in JSON.

anselal commented 6 years ago

Sorry about the last comment. Is this a new S9 or an older one ?

anselal commented 5 years ago

This is an old issue. Can you share some info here or shall I close it ?

anselal commented 4 years ago

Closing due to inactivity. Feel free to reopen