{"id":21250309,"url":"https://github.com/plewin/tp-link-modem-router","last_synced_at":"2025-07-11T00:31:32.417Z","repository":{"id":40930680,"uuid":"282622223","full_name":"plewin/tp-link-modem-router","owner":"plewin","description":"Goodies for TP-Link modem routers","archived":false,"fork":false,"pushed_at":"2023-02-11T20:58:45.000Z","size":232,"stargazers_count":51,"open_issues_count":13,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-04-01T04:00:43.427Z","etag":null,"topics":["archer","lte","mr600","mr6400","sms-gateway","tp-link"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plewin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-26T10:01:10.000Z","updated_at":"2023-02-19T13:20:24.000Z","dependencies_parsed_at":"2023-01-28T10:30:50.478Z","dependency_job_id":null,"html_url":"https://github.com/plewin/tp-link-modem-router","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plewin%2Ftp-link-modem-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plewin%2Ftp-link-modem-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plewin%2Ftp-link-modem-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plewin%2Ftp-link-modem-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plewin","download_url":"https://codeload.github.com/plewin/tp-link-modem-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225664149,"owners_count":17504444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archer","lte","mr600","mr6400","sms-gateway","tp-link"],"created_at":"2024-11-21T03:16:52.460Z","updated_at":"2024-11-21T03:16:52.991Z","avatar_url":"https://github.com/plewin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goodies for Archer LTE routers\n\n## Features\n\n### Implemented\n\n* Easy to use script to send SMS\n* Easy to use script to receive SMS\n* REST API bridge for managing and sending SMS\n* SMTP to SMS gateway\n\n## Installation and requirements\n\nYou need `nodejs` and `yarn`. Install them first.\n\n```bash\n# clone this repository and execute to install required dependencies\nyarn install\n``` \n\n## Usage\n\n### Limitations and warnings\n\n* Bridge API is subject to change without warnings.\n* Special characters work but careful how you escape them in your shell command.\n* Script and API must be in the same network of the router (IP is verified by the router's backend).\n* You should avoid connecting to the router web UI while using these tools because it might cause unexpected behaviors.\n* Time and timezone must be configured on router for accurate received SMS times.\n\n### Send SMS command\n\n```bash\n# example passing all arguments as command line args\n./sms-send.js --url=\"http://192.168.1.1\" --login=\"admin\" --password=\"myrouterpassword\" \"0612345678\" \"my text message\"\n\n# returns 0 on success, 1 on error\n# pipe output to /dev/null if you do not want debug output\n\n# you can also hardcode the credentials in the file or in the default config file : config.json\n./sms-send.js 0612345678 \"my text message\"\n\n# it is possible to supply your own config file using the --config arg\n./sms-send.js --config=\"/tmp/config.json\" 0612345678 \"my text message\"\n\n# sample config file (config.json) for sms-send.js\n{\n    \"url\": \"http://192.168.1.1\",\n    \"login\": \"admin\",\n    \"password\": \"myrouterpassword\"\n}\n\n```\n\n### REST API Bridge\n\n```bash\n# Start API bridge, using local config.json\n./api-bridge.js\n\n# Using custom config.json file\n./api-bridge.js --config=/tmp/config.json\n\n# Sample config.json file\n{\n    \"url\": \"http://192.168.1.1\",\n    \"login\": \"admin\",\n    \"password\": \"myrouterpassword\",\n    \"api_listen_host\": \"127.0.0.1\",\n    \"api_listen_port\": 3000,\n    \"api_users\": { \"apiuser\": \"pleasechangeme\" }\n}\n\n# Explore API on http://127.0.0.1:3000\n\n# Sample queries\n# ==============\n# List received SMS\ncurl --user apiuser:pleasechangeme -X GET \"http://127.0.0.1:3000/api/v1/sms/inbox\" -H  \"accept: application/json\"\n\n# Sending SMS application/x-www-form-urlencoded style\ncurl --user apiuser:pleasechangeme -d to=0123456789 -d content=test1 -X POST \"http://127.0.0.1:3000/api/v1/sms/outbox\" -H  \"accept: application/json\"\n\n# Sending SMS application/json style\ncurl --user apiuser:pleasechangeme -d '{\"to\":\"0123456789\", \"content\":\"test2\"}' -H 'Content-Type: application/json' -X POST \"http://127.0.0.1:3000/api/v1/sms/outbox\" -H  \"accept: application/json\"\n```\n\n### Receive SMS with SMS cat\n\n```bash\n# Example piping new SMS to command to your own command process_incoming_sms\n./sms-cat.js --config=/tmp/config.json | \\\n    jq -c 'select(.message|contains(\"Received SMS\")) | .sms' | \\\n    jq -c --raw-output 'select(.from==\"+33123456789\") .content' | \\\n    while read smsContent; do ./process_incoming_sms \"$smsContent\"; done\n\n# Sample config file for sms-cat.js\n{\n    \"api_client_url\": \"http://localhost:3000\",\n    \"api_client_login\": \"apiuser\",\n    \"api_client_password\": \"pleasechangeme\",\n    \"api_client_polling_delay\": 5000\n}\n```\n\n### SMTP to SMS Gateway\n\n```bash\n# Start listening for emails\n./smtp-gateway.js --config=/tmp/config.json\n\n# Sample config file for smtp-gateway.js\n{\n    \"sms_gateway_url\": \"http://localhost:3000\",\n    \"sms_gateway_login\": \"apiuser\",\n    \"sms_gateway_password\": \"pleasechangeme\",\n    \"sms_gateway_domain\": \"smtp2sms.local\",\n    \"sms_gateway_listen_host\": \"127.0.0.1\",\n    \"sms_gateway_listen_port\": 1025\n}\n```\n\n```bash\n# SMTP Example\ncurl -vv smtp://127.0.0.1:1025 --mail-rcpt 123456789@smtp2sms.local --upload-file \u003c(echo \u0026\u0026 echo -n \"Hello world from curl\")\n```\n\n```\n*   Trying 127.0.0.1:1025...\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 1025 (#0)\n\u003c 220 dom0 ESMTP SMTP gateway for SMS API\n\u003e EHLO 11\n\u003c 250-dom0 Nice to meet you, [127.0.0.1]\n\u003c 250-PIPELINING\n\u003c 250-8BITMIME\n\u003c 250-SMTPUTF8\n\u003c 250-AUTH LOGIN PLAIN\n\u003c 250 STARTTLS\n\u003e MAIL FROM:\u003c\u003e\n\u003c 250 Accepted\n\u003e RCPT TO:\u003c123456789@smtp2sms.local\u003e\n\u003c 250 Accepted\n\u003e DATA\n\u003c 354 End data with \u003cCR\u003e\u003cLF\u003e.\u003cCR\u003e\u003cLF\u003e\n} [26 bytes data]\n\u003c 250 OK: message queued\n100    26    0     0    0    26      0     49 --:--:-- --:--:-- --:--:--    49\n* Connection #0 to host 127.0.0.1 left intact\n```\n\n## Supported models\n\n* TP-Link Archer MR200 v5\n    * Firmware Version : ‪1.2.0 0.9.1 v0001.0 Build 210120 Rel.67320n\n* TP-Link Archer MR600\n* TP-Link TL-MR6400 v5\n    * Firmware Version : 1.1.0 0.9.1 v0001.0 Build 200511 Rel.43036n\n\n## Common errors\n\nHTTP 403 while sending SMS or using API bridge\n: You might want to double-check that the password supplied is correct and that you call the script from the same network/subnet as the router.\n\n## Development and debugging the router's protocol\n\nTo debug the interaction between your browser and the router, first log in on the router UI and then paste this code in the developer console of your browser.\nAll traffic will be logged in plain text in the console.\n\n```javascript\n$.Iencryptor.AESDecrypt_backup = $.Iencryptor.AESDecrypt;\n$.Iencryptor.AESEncrypt_backup = $.Iencryptor.AESEncrypt;\n$.Iencryptor.AESDecrypt = function(data) {\n\tlet decrypted = $.Iencryptor.AESDecrypt_backup(data);\n\tconsole.log(\"RECV:\\n\" + decrypted);\n\treturn decrypted;\n}\n$.Iencryptor.AESEncrypt = function(data) {\n\tconsole.log(\"SEND:\\n\" + data);\n\treturn $.Iencryptor.AESEncrypt_backup(data);\n}\n```\n\n### Alternatives and projects of interest\n\nI can offer no guarantees about the following projects\n\n* https://github.com/hercule115/TPLink-Archer\n  * Python command line tool to dump MR600 router config and update dynamic DNS\n* https://github.com/jeedom/plugin-tplinksms\n  * Plugin for Jeedom that provides an UI\n* https://github.com/mehmetbeyHZ/tp-link-m7200-api\n  * PHP library for TP-Link M7000 range of products\n* https://github.com/McMlok/DomoticzToRouterSmsBot\n* https://github.com/jonscheiding/tplink-vpn-ddns\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplewin%2Ftp-link-modem-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplewin%2Ftp-link-modem-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplewin%2Ftp-link-modem-router/lists"}