hercule115 / TPLink-Archer

Tool to get TPLink Archer router configuration
11 stars 4 forks source link

error running script #1

Open fachinformatiker opened 3 years ago

fachinformatiker commented 3 years ago

Would you mind sharing your config with us? I can't get your script running, so that I can generate a config.

running archer.py gives me an error:

pszalewicz@Patricks-MacBook-Pro TPLink-Archer % python3 archer.py
Traceback (most recent call last): File "archer.py", line 901, in main() File "archer.py", line 787, in main args = parse_argv() File "archer.py", line 748, in parse_argv help="TP-Link Archer router IP address/name (default to %s)" % config.ROUTER_HOSTNAME) AttributeError: module 'config' has no attribute 'ROUTER_HOSTNAME'

maybe you have an Idea what that error is popping up.

Thanks in advance.

hercule115 commented 3 years ago

Hi,

Your config.py config file (automagically generated) should looks like this:

~/MyDrive/Tools/TPLink-Archer: cat config.py

Mandatory parameters

VERBOSE = True

DEBUG = True

NOIP_HOSTNAME = 'foobar.mydomain.com'

NOIP_AUTH = 'J2pvZSc6J2RhbHRvbic='

ROUTER_HOSTNAME = '192.168.1.1'

ROUTER_AUTH = 'J2FkbWluJzonYWRtaW4n'

Optional parameters (may be null)

IPADDR_FILE = ''

NOIP_OTHER_HOSTS = ''

LOGFILE = ''

It seems like you are missing the ROUTER_HOSTNAME parameter (at least). It should contain the IP addr (local) of your router.

Hope this helps,

Le jeu. 14 oct. 2021 à 22:16, Patrick Szalewicz @.***> a écrit :

Would you mind sharing your config with us? I can't get your script running, so that I can generate a config.

running archer.py gives me an error:

@.*** TPLink-Archer % python3 archer.py Traceback (most recent call last): File "archer.py", line 901, in main() File "archer.py", line 787, in main args = parse_argv() File "archer.py", line 748, in parse_argv help="TP-Link Archer router IP address/name (default to %s)" % config.ROUTER_HOSTNAME) AttributeError: module 'config' has no attribute 'ROUTER_HOSTNAME'

maybe you have an Idea what that error is popping up.

Thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hercule115/TPLink-Archer/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBHQKZKPZRI3IJALM6QOFTUG43DBANCNFSM5GAPFBEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

fachinformatiker commented 3 years ago
    Hi, Thank you very much.I will give it a try later today.Have a nice dayPatrick 

 From: hercule115 @.***>Sent: Friday, October 15, 2021 11:16 AMTo: hercule115/TPLink-ArcherCc: Patrick Szalewicz; AuthorSubject: Re: [hercule115/TPLink-Archer] error running script (#1) 

Hi,

Your config.py config file (automagically generated) should looks like this:

~/MyDrive/Tools/TPLink-Archer: cat config.py

Mandatory parameters

VERBOSE = True

DEBUG = True

NOIP_HOSTNAME = 'foobar.mydomain.com'

NOIP_AUTH = 'J2pvZSc6J2RhbHRvbic='

ROUTER_HOSTNAME = '192.168.1.1'

ROUTER_AUTH = 'J2FkbWluJzonYWRtaW4n'

Optional parameters (may be null)

IPADDR_FILE = ''

NOIP_OTHER_HOSTS = ''

LOGFILE = ''

It seems like you are missing the ROUTER_HOSTNAME parameter (at least). It

should contain the IP addr (local) of your router.

Hope this helps,

Le jeu. 14 oct. 2021 à 22:16, Patrick Szalewicz @.***>

a écrit :

Would you mind sharing your config with us?

I can't get your script running, so that I can generate a config.

running archer.py gives me an error:

@.*** TPLink-Archer % python3 archer.py

Traceback (most recent call last):

File "archer.py", line 901, in

main()

File "archer.py", line 787, in main

args = parse_argv()

File "archer.py", line 748, in parse_argv

help="TP-Link Archer router IP address/name (default to %s)" %

config.ROUTER_HOSTNAME)

AttributeError: module 'config' has no attribute 'ROUTER_HOSTNAME'

maybe you have an Idea what that error is popping up.

Thanks in advance.

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/hercule115/TPLink-Archer/issues/1, or unsubscribe

https://github.com/notifications/unsubscribe-auth/AIBHQKZKPZRI3IJALM6QOFTUG43DBANCNFSM5GAPFBEA

.

Triage notifications on the go with GitHub Mobile for iOS

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

fachinformatiker commented 3 years ago

I had to run it on Debian, because on macOS I still get the error.

Now I could generate the config but it wasn't complete (had to look up in your code what I needed) but now I get the error, that it couldn't find the token, hmm

getParm(): GET(): http://192.168.0.1/cgi/getParm?_=1634320338689 Traceback (most recent call last): File "/opt/TPLink-Archer/archer.py", line 901, in main() File "/opt/TPLink-Archer/archer.py", line 838, in main archerConfig = archer.getConfig() File "/opt/TPLink-Archer/archer.py", line 373, in getConfig self._baseLogin() File "/opt/TPLink-Archer/archer.py", line 457, in _baseLogin self.getParm(qstring) File "/opt/TPLink-Archer/archer.py", line 249, in getParm h['TokenID'] = self.token AttributeError: 'Archer' object has no attribute 'token'

any idea?

hercule115 commented 3 years ago

Are you sure you have provided the correct credentials? I have reproduced your issue with a wrong config file.

Could you try to run: python3 archerUpdateDDNSRecord.py -i -v

It should dump the router configuration on the terminal.

Le ven. 15 oct. 2021 à 19:54, Patrick Szalewicz @.***> a écrit :

I had to run it on Debian, because on macOS I still get the error.

Now I could generate the config but it wasn't complete (had to look up in your code what I needed) but now I get the error, that it couldn't find the token, hmm

getParm(): GET(): http://192.168.0.1/cgi/getParm?_=1634320338689 Traceback (most recent call last): File "/opt/TPLink-Archer/archer.py", line 901, in main() File "/opt/TPLink-Archer/archer.py", line 838, in main archerConfig = archer.getConfig() File "/opt/TPLink-Archer/archer.py", line 373, in getConfig self._baseLogin() File "/opt/TPLink-Archer/archer.py", line 457, in _baseLogin self.getParm(qstring) File "/opt/TPLink-Archer/archer.py", line 249, in getParm h['TokenID'] = self.token AttributeError: 'Archer' object has no attribute 'token'

any idea?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hercule115/TPLink-Archer/issues/1#issuecomment-944488237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBHQK456OUA7JV3WKYGDFDUHBTE5ANCNFSM5GAPFBEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

fachinformatiker commented 3 years ago

the strange thing is, that I only get one of the two IPs I'm behind CGNAT but on the webinterface it shows the correct one. hmm

hercule115 commented 3 years ago

Hi, Could you elaborate a little bit pls? It seems like you made some progress and got some output. Right?

Do you mind sharing with me the output (removing any secret info of course) and a screen dump of the main page of the web intf? Thanks Didier

Le mar. 2 nov. 2021 à 17:45, Patrick Szalewicz @.***> a écrit :

the strange thing is, that I only get one of the two IPs I'm behind CGNAT but on the webinterface it shows the correct one. hmm

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hercule115/TPLink-Archer/issues/1#issuecomment-957606497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBHQK7DG3YTRANDK6EA7ATUJ7TOVANCNFSM5GAPFBEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tomboul commented 2 years ago

Hi, I try to use your script, but i dont know how ?

I only need to read the same external ip given in the main page of my tplink MR600 with a cron in php and send it in my web site to put a good link . I dont have "noip" account

I read this topic because i have the same error as fatchinformatiker, but i get no config.py file

You have to give argument while executing archer.py ?

And i also execute archerUpdateDDNSRecord.sh but the image "mypython38:1.1" dont exists i use python 3.9

tomboul commented 2 years ago

Sorry, i understand my problem, i have to learn how to use docker !!

hercule115 commented 2 years ago

Good to know you solved the issue. I don't have access to my TPLink-Archer router right now so it's hard for me to provide good support. However If you can share your thoughts/issues I'll do my best to help you. Rgds, Didier

Le lun. 28 févr. 2022 à 11:13, Thomas @.***> a écrit :

Sorry, i understand my problem, i have to learn how to use docker !!

— Reply to this email directly, view it on GitHub https://github.com/hercule115/TPLink-Archer/issues/1#issuecomment-1053955761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBHQK63R5HIPHPD6UXTUCLU5MOBFANCNFSM5GAPFBEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

tomboul commented 2 years ago

Thank You Didier

I managed to get the public ip address and also statistics from config info Currently I execute direct in python3.9 without docker, did you used a Dockerfile ?

I'm curious but how did you get all the information about fetching Tplink Archer configuration with _configInfoCgiGdprRqst array ?

if you don't have time to answer, it doesn't matter, you really did a great job !!

hercule115 commented 2 years ago

Hi, I did not used any docker file but running it direct from a shell.

No magic it’s simply reverse engineering to get the various requests to dump out the router config ;)

Nice to hear you like it. BR DIdier

On Thu 3 Mar 2022 at 18:13, Thomas @.***> wrote:

Thank You Didier

I managed to get the public ip address and also statistics from config info Currently I execute direct in python3.9 without docker, did you used a Dockerfile ?

I'm curious but how did you get all the information about fetching Tplink Archer configuration with _configInfoCgiGdprRqst array ?

if you don't have time to answer, it doesn't matter, you really did a great job !!

— Reply to this email directly, view it on GitHub https://github.com/hercule115/TPLink-Archer/issues/1#issuecomment-1058081717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBHQKYCIB2TEKLSUXPVUCLU6DCHLANCNFSM5GAPFBEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>