|
Forum Index : Microcontroller and PC projects : Send text messages with your MM...
| Author | Message | ||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
My 2p Fully worked up solution using Wifi to act as IP gateway to the mobile network. 3G from the start using cheap M590 module from ebay. This is the "public" version of the unit, mine has evolved a bit with extra commands etc. but provides a two-way text gateway with HTTP interface. This has been working solidly for around 2 years now. Novel inclusion is the mains relay to switch mains power for global on/off/bounce capability... I used that for a dodgy internet router. http://www.fruitoftheshed.com/MMBasic.Micromite-SMS-Text-Gateway.ashx |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
I've just looked at that link, and that is one beautifully written article, Captain. I love all the arrows and coloured boxes to highlight different things that are going on. Nice work. Had not seen that one before, as I don't frequent fruit-of-the-shed. I probably should more often. Smoke makes things work. When the smoke gets out, it stops! |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
praise indeed. I wish I had your skills with board layup - it would have genuinely been a thing of beauty FotS is a repository to get the MMBasic library more ediatble and alive plus spaces for other stuff. Anything I do (except commissions) I add for the benefit of shedders everywhere. All the old MMBasic library is in there too and it's all searchable. The task of keeping the library now falls to everyone rather than a single person - it relieves the chore and many hands and all that... there are some familiar faces contributing |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
This post is as much for the forums use, as it is mine. The AT command set for the 3G modem is 622 pages long! That is the full AT command set. The SMS only command-set is still thirteen pages long, and not THAT easy to read due to it being somewhat Engrish. Anyhoo, to setup one of these modems for text messaging, you need to take two important steps. Assuming that you have the modem on-line both to the 3G network and a COM port to talk to it, then you need to: 1) AT+CMGF=1 - Put modem into text messaging mode 2) AT+CNMI=1,2 - Route any new messages received, directly to the COM port Reboot the modem, and the new settings will be saved. These two settings are important. It took me ages of reading to work out how the CNMI command works, as it is not that clear in the manuals. Google is your friend here, and there are several other resources about AT commands. Send a message with AT+CMGS="123456789"<cr> <text message> <Ctrl-Z> The number in quotes is the cell-phone number to send to. Any received text message back to the modem will be routed directly to the COM port, and with the MM's lovely com-port buffers, all you have to do is check if there is anything in the buffer and act accordingly. ![]() Number blurred for privacy. Other useful text messaging commands: AT+CSQ - Signal Quality in RSSI,BIT-ERROR. 31,99 is maximum. AT+CREG? - Network Registration. 0,1 means successful. AT+COPS? - Operator Selection. Shows name of network you are currently connected to. AT+IPREX - Set permanent baud-rate. All standard rates from 300-baud to 4Mb are supported. Now, on to the next bit of this project...... Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
Scratching my head all day today, I could not work out why I could talk to this thing with a PC COM port, but NOT the MM no matter what I did.... I finally managed to work out that this cased-up version has a FULL COM port, in that ALL the pins are used. So if you are missing DTR, CTS, RI, DSR and DCD, then the modem won't talk. It took hours of scratching my head before I twigged that might be the case. It works when directly connected to the PC, as the PC's COM port will have all those handshaking lines and will take care of all that in the background for me I expect. When I put it back on the PC COM port and sent it a text message, that one along with about three others that never arrived before were all sent to the PC. That will be cos the DTR line is being used as a minimum. I tried to hot-wire a permanant DTR line to the module, but that did not work, so it obviously wants the other pins too. If you look at the image of the guts of this unit I posted further up this page, you will clearly see that ALL eight lines to the DB9 are routed via some kind of 232-TTL level shifter..... I have purchased another module to play with, more suited for embedding in products. Link to new module I will play with next. ![]() This one is based on the newer SIM7600, and is the SA variant for Australia, New Zealand and South America. Should work in NZ and Australia right out of the box. Supports 3G, 4G(LTE) and GPS as well. U.FL connectors for all three types. So, this one supports more modern networks, is only 40mm square, and has a simple three-wire serial connection on it. Whatever needs to be hard-wired for the handshaking will be done on the PCB with this one I expect. The experimentation continues...... Smoke makes things work. When the smoke gets out, it stops! |
||||
| Azure Guru Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Normally to ignore hardware handshaking and assert control you would connect (for a DB9 RS232 connector) 3 pins together on one link and 2 pins on antoehr link: Pin 1 DCD to Pin 6 DSR and to Pin 4 DTR; Pin 7 RTS to Pin 8 CTS. Pin 2 is RXD and Pin 3 is TXD, Pin 5 is GND and Pin 9 is RI. Usually enables data to flow so you can just send and receive on the data lines. What chip is U1 on the bottom of the PCB. All of the serial port pins appear to go there. There might also be an issue with the voltage levels for RS232 vs Serial TTL. It looks like you might be able to easily bypass that chip and just connect serial TTL from the MM to the other side of that chips connections. |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
A very old thread... What's the thinking on GSM etc modules/chips to use nowadays (3G/4G/etc)? John |
||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
I'm a Click fan |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3481 |
I'm currently looking at sim7000g: liligo PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
@ Tinnie - I had never seen those Click modules before, and they look interesting and reasonably priced also, so I might get one of those to play with. They also have nice additional features such as mic/headphone socket and 3v3/5v logic selection, which is a nice feature allowing direct connection to pretty much anything without needing any intermediate level-shifting. ![]() One thing I HAVE worked out playing with various modules, is NEVER buy more then ONE until you can prove they will work in your country on your cellphone network(s). Never believe the sales blubs saying they will, always trial a unit first. You're pretty safe these days with the quad-band ones though, cos they DO seem to work pretty much anywhere. The earlier models that were specific to 2G or 3G or 4G, you had to be very careful that you got one that worked in a band being used in your country, AND you had to be careful that it supported the network protocol in use or the module would just sit there and do nothing, not connect, and have cost you money for nothing. The beauty of the latest quad-band based modules, is that they all seem to also be multi-protocol, so they generally will work anywhere in the world, so long as you have a valid and activated SIM card inserted, which takes away all of the pain of trying to work out if the earlier modules will work in your country - so there's that! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
ADDITIONAL: I found the link to the latest FULLY ENCLOSED unit I tried, and here it is. This unit is only $19.50 + P&P. ![]() Dual-band though, so not a quad one, so not guaranteed to work in your country. It DID work for me just fine here in Kiwi-Land using the Vodafone/2degrees network. I also binned the supplied plug-pack/wall-wart thing, as for this price with that included, it is likely a horrible unit, so throw that away and use a local approved power-pack instead. You don't want a $20 unit, setting fire to your house or other building due to use of a crappy power-supply. Extra notes for NZ members reading this: It will NOT work on the Spark/Telecom network, as they don't run any GSM bands of any kind any more, so you MUST use Vodafone or 2degrees(which uses the Vodafone network), but that is no real pain. Both Spark and Vodafone(and by extension, 2degrees) have a good selection of plans from very cheap, to monthly rates, and all of them seem to be perfectly reliable. "The Warehouse" mobile phones and SIM's also work on the Vodafone network, so you should be able to use these SIM's also. Smoke makes things work. When the smoke gets out, it stops! |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
What are the names for the networks if not GSM? John |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
Vodafone run GSM bands on 900MHz and 1.8GHz. Spark(Telecom) run UMTS(Universal Mobile Telecommunications System, 3G) on 850MHz, 900MHz, 1.8GHz and 2.1GHz and also LTE(Long Term Evolution, 4G) on 700MHz, 1.8GHz, 2.3GHz, and 2.6GHz. Source I can't find anything on what NZ is using 5G protocol wise(as we have only just started on 5G rollout), but it will no doubt be one of the standards on 3.5GHz, such as 5G-NR(new radio) or 5G-RAT(radio access technology). Edited 2022-10-28 19:59 by Grogster Smoke makes things work. When the smoke gets out, it stops! |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
Aha. Thanks. John |
||||
| Hans Senior Member Joined: 18/10/2022 Location: CanadaPosts: 117 |
Hello All; You might find this PCMag artical interesting; https://www.pcmag.com/news/cdma-vs-gsm-whats-the-difference#:~:text=But%20in%202022%2C%20it's%20absolutely,Opens%20in%20a%20new%20window). Life is about constant change. Happy to be retired. Hans .... |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3481 |
Good article. Bottom line (at least in North America)--don't expect 2G or 3G to work or continue to work, switch to LTE (4G) for SMS messaging from microcomputers. I don't know how true this is for the rest of the world, but I expect that the continuing optimization of bandwidth usage (for certain characteristics) will dictate the loss of 2G and 3G coverage. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
Thanks. John |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9759 |
Yes, good article. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |