Open Adam-Osibot opened 9 months ago
Device: 4G USB Modem Phone Number: 0459586164
Setup 4G USB Dongle Modem
apt install gammu gammu-smsd usb-modeswitch git
lsusb -returns Bus 001 Device 005: ID 12d1:1c05 HUAWEI HUAWEI Mobile. 12d1 is the vendor code for Huawei and the string after that (1c05 in my case) is the product ID.
sudo usb_modeswitch -v 12d1 -p 14db -M '55534243123456780000000000000011062000000100000000000000000000' -this changes the USB to modem mode.
Great, now let's create a config file with the following content and store it in /etc/gammurc
[gammu] device = /dev/ttyUSB0 name = Bob connection = at logfile = /var/log/gammu.log
[smsd] service = files logfile = syslog
debuglevel = 0
inboxpath = /var/spool/gammu/inbox/ outboxpath = /var/spool/gammu/outbox/ sentsmspath = /var/spool/gammu/sent/ errorsmspath = /var/spool/gammu/error/
Test if SMS is working: echo "some message" | gammu --sendsms TEXT 0424672585
Start daemon: gammu-smsd -d -c /etc/gammurc
If using daemon, test this way: gammu-smsd-inject TEXT 0424672585 -unicode -text "hello world from the daemon!"
I have not been able to get the modem to switch to "Modem Mode", the command might need tweaking to get it to work.
We need to add support for reading, sending & deleting SMS messages from a 4G USB Dongle Modem.
Possible Solutions: https://github.com/colins44/gsm-sms https://blog.haschek.at/2021/raspberry-pi-sms-gateway.html Use Gammu?
Create a python script that:
Sends an SMS message: sms.py send,0424672585,"Test Message Test"
Receive all SMS messages: sms.py receive, sms.txt
Delete all SMS messages: sms.py delete