How do we do it in python? Let’s see an example: If everything is going fine you will see an “OK” in response. The phone number can be the full one with the country code or the short one starting with zero. Now to send a SMS we should send the following command, notice that at then end of the message we hit ctrl + z: For now we will stick to text mode because it is easier to work with. So let’s go in it: There are two ways to do it – either in text mode either in PDU mode. Now we are ready to send a short message. You should see OK in ~ $ cu -l /dev/ttyUSB1 Now what you type is directly send to the modem. To open the modem type the following: “cu -l /dev/ttyUSB1”. After that you should see an empty screen. For testing purposes I use the cu program – cu – Call up another system. Fortunately there are internal leaked documents on the internet so I was able to find the ZTE command set by with Google. In reality it is not so straightforward to get a list of those commands since for 3g dongles there is no official documentation (at least for those I have). What this means is that while you establish connection using the /dev/gsmmodem the others are free and can be opened and used to send AT commands to the modem.īut what are AT commands? The AT (meaning ‘attention’) commands are simple instructions send to the modem over a serial link telling it what to do – dial a number, hang up, send message, etc. For more information: Wikipedia. In my case these are /dev/ttyUSB0, ttyUSB1 and ttyUSB2, with additional symbolic link /dev/gsmmodem pointing to ttyUSB2. Once you have the 3g dongle connected as a modem three new devices will appear under /dev.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |