Git Product home page Git Product logo

hilink-sms-resender's Introduction

1 3

HiLink-SMS-Resender

Periodically resends SMS from HiLink modem to your Telegram private channel

tl;dr

docker run -d -e HILINK_API_URL='192.168.8.1' \
-e HILINK_USER='admin' \
-e HILINK_PASS='admin' \
-e TG_SMS_CHAN_ID='-1001405916609' \
-e TG_BOT_TKN='1130291944:AAEs_Q9dqVk55KtVZ_StKn06wMxP0fKG9VQ' \
--name hlsms wmw9/hilink-sms-resender && docker logs hlsms -f

Replace environment variables with your tokens

Prerequisites

  • GSM USB Modem with HiLink firmware. Working and tested on Huawei e8372h
  • SIM-card that can receive SMS. Mobile data (LTE/3G) is not needed.
  • usb_modeswitch installed. Your GSM USB modem should be connect in Ethernet mode
  • Private Telegram channel for SMS and Telegram Bot
  • Raspberry Pi (optional)

Getting started

There are a few ways to get started.

  1. Create your own Telegram private channel and get Channel ID by forwarding any message to @myidbot
  2. Create your own bot and get bot token using @BotFather
  3. Add your bot to channel as administrator and give him "Post messages" permission.

Compile from source

You'll need golang installed

git clone https://github.com/wMw9/hilink-sms-resender.git
cd hilink-sms-resender

Edit and set your environment variables by adding these lines to ~/.bashrc

vi ~/.bashrc
# add these lines at the end of ~/.basrc file
export HILINK_API_URL="192.168.8.1"
export HILINK_USER="admin"
export HILINK_PASS="admin"
export TG_SMS_CHAN_ID="-1241505916610" # Your Telegram Channel ID from @myidbot
export TG_BOT_TKN="12345678901:FFEs_Q9dqVkd5KtfZ_ztKnf6wM1P0gaKGhV1" # Your bot token from @botfather
  1. Update ENVs by running exec bash or . ~/.bashrc
  2. Check if your ENVs are set by export or echo $HILINK_API_URL
  3. Compile from source go build *.go -o hilink-sms-resender
  4. Make sure your modem is connected properly, up and running ping 192.168.8.1 or whatever your IP of modem is
  5. You are good to go. Run ./hilink-sms-resender, you should see message saying [*] HiLink SMS Resender started.

docker-compose

  1. git clone https://github.com/wMw9/hilink-sms-resender.git && cd hilink-sms-resender
  2. docker-compose up --build -d && docker-compose logs -f
version: '3'
services:
  hlsms:
    image: wmw9/hilink-sms-resender
    #build: .
    restart: on-failure
    networks:
      - backend
    env_file:
      - ./.env
networks:
  backend:
    driver: bridge

Motivation

I've been using Apple devices for years now, they have great ecosystem. If you have iPhone and MacBook connected using one iCloud account, all your incoming SMS also popup in macOS via notification center. So you don't really need to pickup your phone to read that activation code your bank just sent you to confirm payment. This is really comfy. Also I use multiple SIM-cards and phones for security reasons like 2-factor authentication. Since I recently build myself a new Ryzen PC and now using Windows 10, I miss that feature. Luckily, I had old Huawei e8372 LTE USB modem lying around and this little project was born.

Author

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.