Explore SMS module

shadowranger94

Junior Member
Joined
May 20, 2011
Messages
98
Reaction score
5
hey guys, not sure who are experience in hardware and software stuff. I am trying to trigger sms via httpclient call. Recently I bought a module called lilygo sim 7000g. However, i am unable to send sms. Was wondering if there any recommendation for me? can also be a router that allows SIM card to be inserted then I use httpclient call. No need to recommend me companies that provide sms gateway as this is just me exploring new ways when I am free. Thanks for reading until here.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
I'm not verse in particular to this device. But my last interaction with a SMSC is basically treating it like a modem. The instructions are basically ATDT commands https://en.wikipedia.org/wiki/Command_mode_and_Data_mode. Simply the SMSC is a data modem to you, just that it doesn't do voice, it just do data.

In Linux, you can use any tty utilities such as screen or modem application like mmcli to communicate with the device. Once physically connected to your system/host, the modem will most likely exist under /dev/tty*. First you need to be able to physically connect your system to the device, probably via the serial interface. Since these days we no longer have serial ports, you will need a USB to SERIAL adapter, such as https://www.startech.com/en-sg/cards-adapters/icusb232v2

I read in this example https://github.com/Xinyuan-LilyGO/L...er/examples/Serial2Example/Serial2Example.ino
Where the serial pins are
Code:
#define PIN_DTR     25
#define PIN_TX      27
#define PIN_RX      26
#define PWR_PIN     4
Refer to https://en.wikipedia.org/wiki/Serial_port on how you can physically link the device to your host via those serial pins
If you can telnet to the device, means you are good to go

Simply I wonder why you got this device. It's really for tinkers, not for the purpose of sending SMS from a general purpose system.
If you really want such kind of activity, it might be easier with this
https://sg.cytron.io/p-4g-3g-2g-gsm...q5Vv2Ul7veV8lzEgTNYhmfaH0M9T4GcEaAtkSEALw_wcB

At least the HAT will be connected to a linux system, exposed as a tty modem readily without any cabling.

:)
 
Last edited:

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
Just a demonstration to show you, when I connect the GSM HAT to my Linux VM running in my Mac OS X and using a simple tool to communicate with the GSM HAT sending SMS. It's meant to be a Raspberry PI HAT, but really it's a modem + GPS

Code:
root@ul2004lts:~# export d=`date`; mmcli -m 11 --messaging-create-sms="text='${d} - Hello HARDWAREZONE',number='+65XXXXXXXX'"
Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/5
root@ul2004lts:~# mmcli -s 5 --send
successfully sent the SMS

8eeqHLn.jpg


If you want to remotely trigger the SMS via any form of API, just provide those services and execute the command line once the request is received. It can be via HTTP(S) using a webserver or just simply socat with stunnel to provide SSL(HTTPS), or via remote SSH call, or even FTP if you so like it. Receive the request in any way as you deem fit and you can do anything with it after that. You can even use a message if you prefer. The options are endless, only limited by your imagination.

:)
 
Last edited:

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
This variant of the same thing might be even better for you
https://thepihut.com/products/sim7600g-h-4g-usb-dongle

Do your due diligence to ensure the channel of the radio frequency is compatible with those used in Singapore. This is important.

Worse case is you cannot connect, otherwise you may have limited channels available to you

Alternatively, you can get one of those LTE MIFi. Eg: https://www.tp-link.com/sg/home-networking/mifi/m7350/

Unfortunately I believe most of them don’t offer modem functionality. They basically operate standalone and provide a web interface for you to send SMS. Hence you will need to resort to reverse engineer the web interface either by using puppeteer or if you are savvy enough, use any HTTP client such as curl to perform the HTTP calls.

:)
 
Last edited:

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
Say if you own any TP-LINK MIFI say https://www.tp-link.com/sg/home-networking/mifi/m7650/

Here is a shell script that can help you to login the web interface and send sms to any recipient

Bash:
#!/usr/bin/env bash

PASSWD="yourpassword"
MSISDN="+6591234567"
MESSAGE="MESSAGE YOU WOULD LIKE TO SEND"
NONCE=`curl -s 'http://tplinkmifi.net/cgi-bin/auth_cgi' -H 'Cookie: check_cookie=check_cookie'  --data-raw '{"module":"authenticator","action":0}' | jq '.nonce' | xargs`
#echo $NONCE
DIGEST=`echo -n $PASSWD:$NONCE | md5`
#echo $DIGEST
TOKEN=`curl -s 'http://tplinkmifi.net/cgi-bin/auth_cgi' -H 'Cookie: check_cookie=check_cookie'  --data-raw "{\"module\":\"authenticator\",\"action\":1,\"digest\":\"$DIGEST\"}" | jq '.token' | xargs`
#echo $TOKEN
DATE=`date +"%Y,%M,%d,%H,%m,%S"`
curl 'http://tplinkmifi.net/cgi-bin/web_cgi' --data-raw "{\"token\":\"$TOKEN\",\"module\":\"message\",\"action\":3,\"sendMessage\":{\"to\":\"$MSISDN\",\"textContent\":\"$MESSAGE\",\"sendTime\":\"$DATE\"}}"

If you want to know how I did the reverse engineering.
e3ocYLN.png


Have fun.
:)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
Actually why do you want to continue to use SMS? Given the trend of the market today where it favours data over sms, and also sim-only plan with enormous amount of data vs the minuscule sms, you are better off sending emails or whatsapp messages or other IoT traffic such as MQTT. There are also other notifications solutions like ntfy, pushover. From a cost perspective, going sms doesn’t make much sense. From a connectivity perspective, it is not more reliable with sms either since it is a fire and forget messaging technology, and today in SG we don’t even have 2G anymore. It is at least 3G and it is more than enough to sustain short messages via data.

:)
 

shadowranger94

Junior Member
Joined
May 20, 2011
Messages
98
Reaction score
5
Well just curious and wanted to explore how software and hardware communicate. I am a web developer myself and I like to integrate stuff.

tried stuff like trigger rfid, relay using arduino from my web portal. Now want to try sms.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
Well just curious and wanted to explore how software and hardware communicate. I am a web developer myself and I like to integrate stuff.

tried stuff like trigger rfid, relay using arduino from my web portal. Now want to try sms.

If so, then you ought to be spending more time with raspberry pi and its hats. I have driven eink display, sms gateway, stepper motors, audio DACs, LCD display and touch panels with various different PIs, After all it is a linux system with GPIOs to integrate with the electronics space. Unless you need super low power and super small footprint and very predictable timings which perhaps a MCU make more senses, otherwise SBC is a much more vibrant bridge.

A raspberry PI with the GSM HAT would be a good setup for you to try out SMS and still integrate easily with the ethernet world.

:)
 
Last edited:

UnusedCalculator

Junior Member
Joined
Jul 11, 2021
Messages
38
Reaction score
3
I'm not verse in particular to this device. But my last interaction with a SMSC is basically treating it like a modem. The instructions are basically ATDT commands https://en.wikipedia.org/wiki/Command_mode_and_Data_mode. Simply the SMSC is a data modem to you, just that it doesn't do voice, it just do data.

In Linux, you can use any tty utilities such as screen or modem application like mmcli to communicate with the device. Once physically connected to your system/host, the modem will most likely exist under /dev/tty*. First you need to be able to physically connect your system to the device, probably via the serial interface. Since these days we no longer have serial ports, you will need a USB to SERIAL adapter, such as https://www.startech.com/en-sg/cards-adapters/icusb232v2

I read in this example https://github.com/Xinyuan-LilyGO/L...er/examples/Serial2Example/Serial2Example.ino
Where the serial pins are
Code:
#define PIN_DTR     25
#define PIN_TX      27
#define PIN_RX      26
#define PWR_PIN     4
Refer to https://en.wikipedia.org/wiki/Serial_port on how you can physically link the device to your host via those serial pins
If you can telnet to the device, means you are good to go

Simply I wonder why you got this device. It's really for tinkers, not for the purpose of sending SMS from a general purpose system.
If you really want such kind of activity, it might be easier with this
https://sg.cytron.io/p-4g-3g-2g-gsm...q5Vv2Ul7veV8lzEgTNYhmfaH0M9T4GcEaAtkSEALw_wcB

At least the HAT will be connected to a linux system, exposed as a tty modem readily without any cabling.

:)

Hello!
Was exploring how to setup an SMS Alert service. Found out I need to setup an SMS Gateway to an SMSC. But how do I get the SMSC for all the telco providers in SG? Is there like an application I'd need to go through or some fees to be paid etc etc? I came across CommzGate which states they have a direct connection to Singtel...but what does that mean?

Adding a sim card in the loop, or using Telegram Bots might be easier to achieve what I need, but i wanna explore this rabbit hole and understand how it all works, how scammers have been abusing it and not get caught etc etc.
 
Last edited:

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
Hello!
Was exploring how to setup an SMS Alert service. Found out I need to setup an SMS Gateway to an SMSC. But how do I get the SMSC for all the telco providers in SG? Is there like an application I'd need to go through or some fees to be paid etc etc? I came across CommzGate which states they have a direct connection to Singtel...but what does that mean?

Adding a sim card in the loop, or using Telegram Bots might be easier to achieve what I need, but i wanna explore this rabbit hole and understand how it all works, how scammers have been abusing it and not get caught etc etc.

I will answer you briefly first as I am outside. Gone are the days where you need a SMSC Or any device that is participating in the SMPP to reach out to any of your end/users via SMS. There are solution providers like what you have mentioned Commzgate to offer the SMS service for your application. Other players are like Clickatell, Twilio, SMSGlobal and more. I know Commzgate because it is a service provider locally in Singapore, however sending SMS today is not limited to having local SMSC. Telecos accept global SMSes from global telcos. Their SMSCs are peered to each other. Hence you can send your sms from almost(if not all) telecos from all over the world. At the end of the day, it is service reliability and cost of the service packages each provider provides.

Some providers will allow you to connect to them via SMPP but nowadays for convenience, they also provide HTTP/SMTP and other protocols for your application to send sms via their solution.
If you are just looking for way to send out SMS to your end users, this use case is simple, all SMS solution providers would cover this use case. If you need to also receive SMS, also know as 2-way SMS you will need to apply a short code (basically is a short number) to identify you or your business. Your end users mobile number are known as MSISDN, for your info.

Recently you will also need to apply for SMS SENDER ID by registering with IMDA (https://www.imda.gov.sg/resources/p...d-registration-to-be-required-by-january-2023) locally in Singapore if you would like an alias for your outgoing SMSes, or else they will be branded as Likely SCAM.

Sending SMS is like sending email nowadays, though not free, doesn’t require you to have a device or SIM card. You can even use AWS SNS to send sms if you like. Read up https://aws.amazon.com/sns/sms-pricing/

I hope I have answered your enquiry.
:)
 

UnusedCalculator

Junior Member
Joined
Jul 11, 2021
Messages
38
Reaction score
3
I will answer you briefly first as I am outside. Gone are the days where you need a SMSC Or any device that is participating in the SMPP to reach out to any of your end/users via SMS. There are solution providers like what you have mentioned Commzgate to offer the SMS service for your application. Other players are like Clickatell, Twilio, SMSGlobal and more. I know Commzgate because it is a service provider locally in Singapore, however sending SMS today is not limited to having local SMSC. Telecos accept global SMSes from global telcos. Their SMSCs are peered to each other. Hence you can send your sms from almost(if not all) telecos from all over the world. At the end of the day, it is service reliability and cost of the service packages each provider provides.

Some providers will allow you to connect to them via SMPP but nowadays for convenience, they also provide HTTP/SMTP and other protocols for your application to send sms via their solution.
If you are just looking for way to send out SMS to your end users, this use case is simple, all SMS solution providers would cover this use case. If you need to also receive SMS, also know as 2-way SMS you will need to apply a short code (basically is a short number) to identify you or your business. Your end users mobile number are known as MSISDN, for your info.

Recently you will also need to apply for SMS SENDER ID by registering with IMDA (https://www.imda.gov.sg/resources/p...d-registration-to-be-required-by-january-2023) locally in Singapore if you would like an alias for your outgoing SMSes, or else they will be branded as Likely SCAM.

Sending SMS is like sending email nowadays, though not free, doesn’t require you to have a device or SIM card. You can even use AWS SNS to send sms if you like. Read up https://aws.amazon.com/sns/sms-pricing/

I hope I have answered your enquiry.
:)
That has been insightful!

I will most likely go with an SMS Service. I just wanna notify myself and a few family member.

But I'm quite curious. How would I go about setting up a service/tech stack that mimics Commzgate... What would I need to connect with the Telcos?
 
Last edited:

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
That has been insightful!

I will most likely go with an SMS Service. I just wanna notify myself and a few family member.

But I'm quite curious. How would I go about setting up a service/tech stack that mimics Commzgate... What would I need to connect with the Telcos?

Sure go with any sms solution providers out there.

You also asked how to peer with the SMSC of telcos? I could be wrong, but to my knowledge the wouldnt peer with any individual out there. SMSC peering are for volume transactions between telcos and large enterprises. SMPP is the protocol at which the SMSC communicates. To my knowledge telcos will not peer with you. You simply just buy their service and use a SMS client to connect to their SMSC to send out sms, this is not the same as peering between enterprises.

:)
 
Last edited:

UnusedCalculator

Junior Member
Joined
Jul 11, 2021
Messages
38
Reaction score
3
Sure go with any sms solution providers out there.

You also asked how to peer with the SMSC of telcos? I could be wrong, but to my knowledge the wouldnt peer with any individual out there. SMSC peering are for volume transactions between telcos and large enterprises. SMPP is the protocol at which the SMSC communicates. To my knowledge telcos will not peer with you. You simply just buy their service and use a SMS client to connect to their SMSC to send out sms, this is not the same as peering between enterprises.

:)
I guess that's the end of the discussion then. You seem quite knowledgeable on this. Thanks for your input.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
I guess that's the end of the discussion then. You seem quite knowledgeable on this. Thanks for your input.

Well I have previously worked with several overseas telcos integrating value added solutions with their SMSC, and also was involved in writing a SMPP client to work with their SMSC, so got some experience about these stuffs.

Have fun.

:)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,300
By the way, if you just want to notify yourself and your family members, don’t bother with SMS. Ask Your family member to install either of the following tools.

https://pushover.net/
or
https://ntfy.sh/

This way you can send them notifications via the Internet. However it puzzled me, why not use Whatsapp?

I know SMS may sounds fun, but well it will lose its novelty pretty quickly in todays vibrant notifications ecosystem.

:)
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top