All Projects → plewin → tp-link-modem-router

plewin / tp-link-modem-router

Licence: GPL-3.0 license
Goodies for TP-Link modem routers

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to tp-link-modem-router

archer-t2u-plus-linux
TP-Link Archer T2U Plus / AC600 High Gain USB Wifi Adapter Review & Driver installation Guide for various platforms.
Stars: ✭ 87 (+97.73%)
Mutual labels:  tp-link, archer
beboptwo4g
4G/LTE softmod for the Parrot Bebop 2
Stars: ✭ 50 (+13.64%)
Mutual labels:  lte
nrf9160
LTE 4G link on nRF9160-DK (ARM Cortex-M33)
Stars: ✭ 20 (-54.55%)
Mutual labels:  lte
pindo-cli
A simple Command Line Interface that allows you to authenticate with the Pindo API.
Stars: ✭ 32 (-27.27%)
Mutual labels:  sms-gateway
blazor-adminlte
This project adapts ADMINLTE 3 so the components can be used from dotnet core Blazor / Server / Web Assembly
Stars: ✭ 182 (+313.64%)
Mutual labels:  lte
rssd
Rohde & Schwarz SCPI Driver (in Python)
Stars: ✭ 25 (-43.18%)
Mutual labels:  lte
srsRAN
Open source SDR 4G/5G software suite from Software Radio Systems (SRS)
Stars: ✭ 2,759 (+6170.45%)
Mutual labels:  lte
Home-Assistant
Home-Assistant-Config
Stars: ✭ 186 (+322.73%)
Mutual labels:  tp-link
cht-gateway
Android SMS gateway app for CHT Applications
Stars: ✭ 60 (+36.36%)
Mutual labels:  sms-gateway
Srslte
Open source SDR 4G/5G software suite from Software Radio Systems (SRS)
Stars: ✭ 2,418 (+5395.45%)
Mutual labels:  lte
Awesome Cellular Hacking
Awesome-Cellular-Hacking
Stars: ✭ 1,827 (+4052.27%)
Mutual labels:  lte
bts-ce
Boda Telecom Suite Community Edition (BTS-CE) - An open source vendor and technology agnostic telecommunication network management platform
Stars: ✭ 28 (-36.36%)
Mutual labels:  lte
monster
MONSTeR is a framework built around the LTE system toolbox available in Matlab
Stars: ✭ 21 (-52.27%)
Mutual labels:  lte
NetworkMode-Enabler
A simple Xposed module which adds "3G only", "4G only", "4G/3G"(for compatible devices) options to the network modes setting
Stars: ✭ 14 (-68.18%)
Mutual labels:  lte
ngic-rtc
NGIC-RTC is Control User Plane Separated (CUPS) architecture 3GPP TS23501 based implementation of EPC Service and Packet Gateway functions (SGW, PGW)
Stars: ✭ 54 (+22.73%)
Mutual labels:  lte
ergw
erGW - Erlang implementations of GGSN or P-GW
Stars: ✭ 72 (+63.64%)
Mutual labels:  lte
HamLTE
4G LTE software radio implementation for radio amateurs
Stars: ✭ 33 (-25%)
Mutual labels:  lte
Kalkun
Open Source Web based SMS Manager
Stars: ✭ 186 (+322.73%)
Mutual labels:  sms-gateway
go-pfcp
PFCP(Packet Forwarding Control Protocol) implementation in Golang.
Stars: ✭ 90 (+104.55%)
Mutual labels:  lte
bts-ce-lite
BTS-CE-Lite (Boda-Lite) is a cross platform vendor and technology agnostic telecommunication network management desktop application
Stars: ✭ 24 (-45.45%)
Mutual labels:  lte

Goodies for Archer LTE routers

Features

Implemented

  • Easy to use script to send SMS
  • Easy to use script to receive SMS
  • REST API bridge for managing and sending SMS
  • SMTP to SMS gateway

Installation and requirements

You need nodejs and yarn. Install them first.

# clone this repository and execute to install required dependencies
yarn install

Usage

Limitations and warnings

  • Bridge API is subject to change without warnings.
  • Special characters work but careful how you escape them in your shell command.
  • Script and API must be in the same network of the router (IP is verified by the router's backend).
  • You should avoid connecting to the router web UI while using these tools because it might cause unexpected behaviors.
  • Time and timezone must be configured on router for accurate received SMS times.

Send SMS command

# example passing all arguments as command line args
./sms-send.js --url="http://192.168.1.1" --login="admin" --password="myrouterpassword" "0612345678" "my text message"

# returns 0 on success, 1 on error
# pipe output to /dev/null if you do not want debug output

# you can also hardcode the credentials in the file or in the default config file : config.json
./sms-send.js 0612345678 "my text message"

# it is possible to supply your own config file using the --config arg
./sms-send.js --config="/tmp/config.json" 0612345678 "my text message"

# sample config file (config.json) for sms-send.js
{
    "url": "http://192.168.1.1",
    "login": "admin",
    "password": "myrouterpassword"
}

REST API Bridge

# Start API bridge, using local config.json
./api-bridge.js

# Using custom config.json file
./api-bridge.js --config=/tmp/config.json

# Sample config.json file
{
    "url": "http://192.168.1.1",
    "login": "admin",
    "password": "myrouterpassword",
    "api_listen_host": "127.0.0.1",
    "api_listen_port": 3000,
    "api_users": { "apiuser": "pleasechangeme" }
}

# Explore API on http://127.0.0.1:3000

# Sample queries
# ==============
# List received SMS
curl --user apiuser:pleasechangeme -X GET "http://127.0.0.1:3000/api/v1/sms/inbox" -H  "accept: application/json"

# Sending SMS application/x-www-form-urlencoded style
curl --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"

# Sending SMS application/json style
curl --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"

Receive SMS with SMS cat

# Example piping new SMS to command to your own command process_incoming_sms
./sms-cat.js --config=/tmp/config.json | \
    jq -c 'select(.message|contains("Received SMS")) | .sms' | \
    jq -c --raw-output 'select(.from=="+33123456789") .content' | \
    while read smsContent; do ./process_incoming_sms "$smsContent"; done

# Sample config file for sms-cat.js
{
    "api_client_url": "http://localhost:3000",
    "api_client_login": "apiuser",
    "api_client_password": "pleasechangeme",
    "api_client_polling_delay": 5000
}

SMTP to SMS Gateway

# Start listening for emails
./smtp-gateway.js --config=/tmp/config.json

# Sample config file for smtp-gateway.js
{
    "sms_gateway_url": "http://localhost:3000",
    "sms_gateway_login": "apiuser",
    "sms_gateway_password": "pleasechangeme",
    "sms_gateway_domain": "smtp2sms.local",
    "sms_gateway_listen_host": "127.0.0.1",
    "sms_gateway_listen_port": 1025
}
# SMTP Example
curl -vv smtp://127.0.0.1:1025 --mail-rcpt [email protected] --upload-file <(echo && echo -n "Hello world from curl")
*   Trying 127.0.0.1:1025...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 1025 (#0)
< 220 dom0 ESMTP SMTP gateway for SMS API
> EHLO 11
< 250-dom0 Nice to meet you, [127.0.0.1]
< 250-PIPELINING
< 250-8BITMIME
< 250-SMTPUTF8
< 250-AUTH LOGIN PLAIN
< 250 STARTTLS
> MAIL FROM:<>
< 250 Accepted
> RCPT TO:<[email protected]>
< 250 Accepted
> DATA
< 354 End data with <CR><LF>.<CR><LF>
} [26 bytes data]
< 250 OK: message queued
100    26    0     0    0    26      0     49 --:--:-- --:--:-- --:--:--    49
* Connection #0 to host 127.0.0.1 left intact

Supported models

  • TP-Link Archer MR200 v5
    • Firmware Version : ‪1.2.0 0.9.1 v0001.0 Build 210120 Rel.67320n
  • TP-Link Archer MR600
  • TP-Link TL-MR6400 v5
    • Firmware Version : 1.1.0 0.9.1 v0001.0 Build 200511 Rel.43036n

Common errors

HTTP 403 while sending SMS or using API bridge : 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.

Development and debugging the router's protocol

To 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. All traffic will be logged in plain text in the console.

$.Iencryptor.AESDecrypt_backup = $.Iencryptor.AESDecrypt;
$.Iencryptor.AESEncrypt_backup = $.Iencryptor.AESEncrypt;
$.Iencryptor.AESDecrypt = function(data) {
	let decrypted = $.Iencryptor.AESDecrypt_backup(data);
	console.log("RECV:\n" + decrypted);
	return decrypted;
}
$.Iencryptor.AESEncrypt = function(data) {
	console.log("SEND:\n" + data);
	return $.Iencryptor.AESEncrypt_backup(data);
}

Alternatives and projects of interest

I can offer no guarantees about the following projects

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].