The Navigatrix has been updated. The new website can be found at navigatrix.net.




Post new topic Reply to topic  [ 16 posts ] 
Author Message
 Post subject: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
Hello, nx-ers!

I am using a 3G modem to connect to the internet, and in order to recharge my account i have to send a text message to the number 7010, with the 14 digit number from the recharge-card. For over a year now after every 100 megabytes used, I have to remove the 3G stick, extract the sim card, put the sim card into a cell phone, send the text message, then wait for the confirmation message, then take the sim card back to the 3G modem, before i can continue using the net. The sim card and the connectors start to show signs of extensive wear, not to mention the wear and tear on my nerves :)
Is there any way of sending a text message directly from navigatrix?
A couple of times during the startup-procedure i have seen something like a SMS daemon loading, so I hope there is an easier way of doing this recharge than the process presently employed.
Any ideas?

Thanks, Adrian


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 04 Nov 2010, 20:51
Posts: 1062
Yo, Adrian, take a look at http://osxdaily.com/2014/03/12/send-sms-text-message-from-command-line/

I didn't look into the details, but we already have curl


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 04 Nov 2010, 20:51
Posts: 1062
Try from the horse's mouth

http://textbelt.com/
Quote:
moe@StinkPad:~$ curl http://textbelt.com/text -d number=011614XXXXXXXX -d "message=This is a text message sent via the command line"
{
"success": false,
"message": "Invalid phone number."
}
moe@StinkPad:~$ curl http://textbelt.com/intl -d number=011614XXXXXXXX -d "message=This is a text message sent via the command line"
{
"success": true
}
moe@StinkPad:~$


It said there was success, but 5 minutes in I'm still waiting and there is no mechanism to receive.


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?
Site Admin

Joined: 05 Nov 2010, 01:00
Posts: 185
To send a SMS with the 3G USB Modem you can also use the command gsmsendsms. Its already within navigatrix and can be accessed from the terminal. Its also possible to send USSD codes with the command gsm-ussd.


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
Hello, moe and all lurkers!
In my understandig this curl with textbelt doesn`t use the gsm part of the moden, it just uses the internet connection to send the message to texbelt and texbelt will send the required text onto the desired cell phone. This will not work in my case, because the recharge request have to arrive from the same sim card as being recharged.
I am looking towards a little software which acceses the gsm part and sends an sms from there, without connecting to the net at all.
I have found a software already in navigatrix, called gsmsendsms
http://manpages.ubuntu.com/manpages/tru ... sms.8.html
Apparently using it is as easy as typing

echo "SMS Test Message!" | gsmsendsms -d /dev/ttyUSB0 -b 19200 +6891212

Into the command line, but for me it always returns:
gsmsendsms[ERROR]: ME/TA error 'invalid PDU mode parameter' (code 304)

Does gsmsendsms works for any of you nx-ers outthere?
by the way my gsm modem is a huawei 153


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
oops, david I did not see your answer, I was typing while you posted it..
So does gsmsmssend work for you?
How do you determine which /dev/ttyUSBx it is mounted to?
mine always returns
gsmsendsms[ERROR]: ME/TA error 'invalid PDU mode parameter' (code 304)

thanks for the help


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 04 Nov 2010, 20:51
Posts: 1062
You guys and your new fangled ways....

You can see where things go by dmesg | grep ttyUSB, if it's a attached there and not ttyACM, for example.

You can see where my hocky puck gps is attached
Quote:
moe@StinkPad:~$ dmesg | grep ttyUSB
[ 5.375843] usb 2-1.1: pl2303 converter now attached to ttyUSB0
[ 5.419680] usb 2-1.4: Qualcomm USB modem converter now attached to ttyUSB1
[ 21.548372] pps pps0: source "/dev/ttyUSB0" added
[17953.223155] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[50733.645575] usb 2-1.1: pl2303 converter now attached to ttyUSB0
[50734.695564] pps pps0: source "/dev/ttyUSB0" added
[57604.471669] pps pps0: source "/dev/ttyUSB0" added
[57604.471788] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
moe@StinkPad:~$


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
for me dmesg | grep ttyUSB returns 3 results:

nx@navigatrix:~$ dmesg | grep ttyUSB
[ 16.583187] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 16.583505] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 16.584671] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 394.411402] option1 ttyUSB0: option_instat_callback: error -108
[ 394.411615] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 394.413051] option1 ttyUSB1: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.413076] option1 ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.417545] option1 ttyUSB1: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.417783] option1 ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.421798] option1 ttyUSB1: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.422034] option1 ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.426053] option1 ttyUSB1: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.426286] option1 ttyUSB2: usb_wwan_indat_callback: resubmit read urb failed. (-19)
[ 394.432402] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 394.435404] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[ 411.549528] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB0
[ 411.553697] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB1
[ 411.553973] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB2

If i try echo "SMS Test Message!" | gsmsendsms -d /dev/ttyUSB0 +689mynumber
it returns
gsmsendsms[ERROR]: ME/TA error 'invalid PDU mode parameter' (code 304)

on the other ports ttyUSB1 and ttyUSB2 it returns
gsmsendsms[ERROR]: clearing DTR failed (errno: 32/Broken pipe)

So i think it is connecyted to the right port, but I don`t know what is the PDU mode parameter, what it should be or how do i make it right ...

adrian


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 04 Nov 2010, 20:51
Posts: 1062
It's ttyUSB0. The others are possible memory devices such as a setup for a micro flash card, and the software is having no luck at all trying to talk to it.

I've got a 3G stick somewhere, I'll take a look tonight. A quick look said something about message length, but we'll see what that means.


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 04 Nov 2010, 20:51
Posts: 1062
I too had three USB devices show up with the 3G modem.

Interestingly, my devices enumerated in reverse order to yours.

Not so intereting is I got the same error as you.

It's on a back burner for me Adrian, but I might run into an intelligent person this week.


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
Yes, thank you, Moe...
I also tried to seek more info, but I did not succeed... standing by :)

Adrian


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?
Site Admin

Joined: 05 Nov 2010, 01:00
Posts: 185
Thats how i send an sms messages to number 123:

gsmsendsms -d /dev/gsmmodem 123 "Message"

And thats how i send a ussd code to check my balance for example:

gsm-ussd -m /dev/ttyUSB2 *103#


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 04 Nov 2010, 20:51
Posts: 1062
I'm not generating /dev/gsmmodem, unless you're using 'gsmmodem' as a placeholder.

Wading through http://www.developershome.com/sms/smsLinux.asp now....


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
Hello, Moe!

I think i did not get the last part of your reply. what is placeholder?

I tried the code, but it returns gsmsendsms[ERROR]: opening device '/dev/gsmmodem' (errno: 2/No such file or directory)

I dont have a dev/gsmmodem...
How do I generate it? Should i mount ttyUSB0 to dev/gsmmodem somehow?
thanks


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?
Site Admin

Joined: 05 Nov 2010, 01:00
Posts: 185
You have to replace gsmmodem with ttyUSB0 or 1 or 2 or wherever you have yours


Top
   
 
 Post subject: Re: Send a text message using the 3G modem?

Joined: 21 May 2013, 14:53
Posts: 93
Ok, thanx. It is on dev/ttyUSB0 in my case. But after 2 seconds it still returns an error message:

gsmsendsms[ERROR]: ME/TA error 'invalid PDU mode parameter' (code 304)

Any ideas ??


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 


Search for:

Credits © 2010 - 2024