just send sms
built in under 6h :)
curl -L "https://sms.problem.li/send?key=YOUR_KEY&to=0791234567&msg=Hello"
curl -L "https://sms.problem.li/up" # Health check- Per key: 7/min, 1000/day
- Per recipient: 7/min, 40/day
- Global: 5000/day
- Roaming and premium numbers are blocked
- max 70 Characters per Message
- ONLY GSM7 Characters
Internet → Caddy (443/HTTPS) → Flask (8080) → Serial → SIM7600E-H 4G HAT → SMS ↑ sms.problem.li → CNAME → sms-problemli.duckdns.org → Raspberry Pi IP
On Raspberry Pi 4:
-
mount the SIM7600E-H 4G HAT, connect the antenna to MAIN, set jumpers A+B to UART mode
-
set project
PROJECT=$(hostname) -
create Installation directory
sudo mkdir /opt/$PROJECT && sudo chown -cR pi /opt/$PROJECT
-
clone code
sudo apt install git cd /opt sudo git clone https://github.com/blemli/sms $PROJECT cd $PROJECT
-
add at least one api key
cp keys.dic.example keys.dic key=$(python3 -c "import secrets; print(secrets.token_hex(32))") op item create $key echo "problemli $key">>keys.dic
[!IMPORTANT]
Make sure to add every key to 1password
-
add duckdns token to .env
sudo apt install vim echo "DUCK_TOKEN=xxxx">>.env
-
run setup
./setup/setup.sh
Caution
Make sure roaming and premium numbers are blocked on the provider level
If the hat makes problems you can debug directly with:
minicom -D /dev/serial0
| Command | Description | Expected Response |
|---|---|---|
AT |
Basic test | OK |
AT+CPIN? |
SIM status | READY |
AT+CSQ |
Signal strength | 10-31 good, 99 = none |
AT+CREG? |
Network registration | 0,1 or 0,5 = registered |
AT+COPS? |
Carrier name | e.g. spusu |
AT+CMGF=1 |
Set SMS text mode | OK |
AT+CMGS="+41..." |
Send SMS, then type msg, end with Ctrl+Z | +CMGS: <id> |
Exit minicom: Ctrl+A then X
journalctl -t duckdns # all logs
journalctl -t duckdns -f # follow livesetup/update.shname=xyz
key=$(python3 -c "import secrets; print(secrets.token_hex(32))")
echo "$name $key">>keys.dic
sudo service sms restartImportant
make sure to save the key in 1password and send it only via kpaste
Rate limits are stored in memory. Restart the service to reset all limits:
sudo service sms restart- test what happens if provider rejects message
- allow for 160 chars now that all the weird characters are blocked?
- test foreign numbers in swiss network (should work)
- replace swiss.dic with prefixes.dic to make more universal
- remove blacklist since its blocked at provider level
- factor out all the modem code...
- don't lose the rate limits on service restart
- add json/headers support
- add bruno tests
- Load Balancing with multiple pis :)
- rebrand to smsli
- add dictionary to volume
- strip spaces from numbers?