Skip to content

Conversation

@raydoom
Copy link

@raydoom raydoom commented May 13, 2024

[root@rl8-18 asus]# python3.11 ShowRouterInfo.py
{
"uptime":"Mon, 13 May 2024 09:44:45 +0800(64882 secs since boot)"
}

"Mon, 13 May 2024 09:44:45 +0800
64882
{"since":""Mon, 13 May 2024 09:44:45 +0800", "uptime":"64882"}
Traceback (most recent call last):
File "/root/asus/ShowRouterInfo.py", line 5, in
print("Uptime : " + str(ri.get_uptime()))
^^^^^^^^^^^^^^^
File "/root/asus/RouterInfo.py", line 78, in get_uptime
return json.loads('{' + '"since":"{}", "uptime":"{}"'.format(since, up) + '}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 12 (char 11)

raydoom added 3 commits May 13, 2024 09:41
[root@rl8-18 asus]# python3.11 ShowRouterInfo.py
{
"uptime":"Mon, 13 May 2024 09:28:43 +0800(63921 secs since boot)"
}

Traceback (most recent call last):
  File "/root/asus/ShowRouterInfo.py", line 5, in <module>
    print("Uptime    : " + str(ri.get_uptime()))
                               ^^^^^^^^^^^^^^^
  File "/root/asus/RouterInfo.py", line 75, in get_uptime
    return json.loads('{' + '"since":"{}", "uptime":"{}"'.format(since, up) + '}')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 12 (char 11)
@raydoom raydoom closed this May 13, 2024
@raydoom raydoom reopened this May 13, 2024
@raydoom
Copy link
Author

raydoom commented May 13, 2024

CPUTemp : {'cpu_temperature': '64.568'}

@raydoom raydoom changed the title Fix Uptime json error Fix Uptime json error and add cpu temperature May 13, 2024
@raydoom
Copy link
Author

raydoom commented May 13, 2024

My device is ZenWiFi_XD4_Pro

@raydoom
Copy link
Author

raydoom commented May 13, 2024

image

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

Successfully merging this pull request may close these issues.

1 participant