![]() (If you have USB modem you may need the usbmodeswitch package or something like it that can prepare the device to work as modem.) Sending manully using minicomįirst, install minicom - terminal for serial communication: # apt-get install usb-modeswitch Setting-up serial0 with.Let's send an SMS using USB 3G modem and Linux command line. You can send Minicom a command to quit or change parameters by typing control-A. Go to Serial port setup and change device to one that works for your modem. ![]() Now run minicom without arguments and try these commands: AT+CMGF=1 If you type text without sending a control-A, you will be sending commands into the TNC2 API. Run the minicom command with the option -con. So use the Minicom to send AT, if you lose a character, you can only send this item to you, then re-enter the command. The modem should send SMS "message" to the specificed number. The c specifies the color display and on tells minicom to display the interface in color. ![]() You can do the same by using standard linux commands too: # stty -F /dev/ttyUSB3 speed 9600 -brkint -icrnl ixoff -imaxbel -opost -onlcr -isig -icanon -echo -echoe minicom can be made to always run in color by modifying the /.bashrc file, setting the MINICOM environment variable by adding the lines shown below, and restarting your terminal session (or sourcing your. # echo -e "AT+CMGS=\"+123456789\"\r\n" > /dev/ttyUSB3 This is what I've tried: /bin/sh send sh send showifs send exit killall minicom My problem is that for some reason when I do this it doesn't give me the results of the prior commands sent like showifs So I suspect my syntax is wrong. What can easily be translated to sh-script. All data between computer and 3G modem are transfered through USB, so it looks like it's not necessary to set the speed and other options, but it is. One problem here is that SMS can be sent in two modes: text and so called PDU (binary), and text SMSs are flash by default in my 3G modem at least and I couldn't figure out how to force these flash messages to be saved into flash phone memory. So, here's a python script that send normal messages #!/usr/bin/pythonĬp = str(pdu_text_bin + pdu_text_bin) Remembers your default settings approach would be to use minicom it is. R > /dev/ttyUSB0 SEND COMMAND STRING TO SERIAL PORT sleep. The configuration files for minicom are located in /etc, with a name prefix of minirc.You can have several minicom configuration files, for different serial hardware on yourmachine. Honestly i cant remember where i've found this crap, but it works.] It translates the message and its options into binary PDU structure and sends it to the modem with usual input/output commands (so it needs stty too).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |