Looking for hardware to send SMS with

Hi,

I’m currently using an old USB GSM modem that I access with AT commands in Java but I’m looking for a replacement and saw multiple recommendations for MikroTik, to be exact: For the LtAP mini LTE kit.

It’s in my price range and I like that it’s got its own power supply but I’m a bit confused about how to use it. I found this page in the documentation, which talks about connecting a modem to a RouterOS device and then using commands. The LTE kit is a 2-in-1 (modem+RouterOS device), right?

My setup: A Windows 11 PC running a Java app that sends SMS every now and then. In my current version I open a COM port to the USB modem, send a bunch of AT commands and wait for the reply every time.

How would I connect the LTE kit to my PC? Can I access it the same way through Java (important: with Windows!), possibly even with AT commands?

Yep, check its block diagram:

The device has also a serial port, but cannot say if it can be used directly with AT commands.

Good to know, thanks!

How do you send SMS with it if you don’t use AT commands? It sounds like there’s some kind of OS and my guess is that you access it like a regular router (with an IP address) and send SMS on that website. Is it possible to do this with code (e.g. Java) too?

I think you can use like the rest api(see REST link) to this command(see SMS link), to send the sms via java if you have some programming knowledge.

There are also this sites, that have lots of scripting and rest api.

https://tangentsoft.com/mikrotik/index

Yes, the normal way would be to use RouterOS commands (or API), what I have no idea if the modem can be accessed (directly) from the serial also.

Very likely it is possible, but if it is, it will be tricky, see:

As you have tested java solution, isn't it better to invest in simple RaspberryPi to connect your GSM modem or GSM hat?

Thanks for the suggestion, using the REST API would be fine (even though it requires changing my existing code). So basically: You connect the LTE kit device to a LAN switch with a LAN cable and you can then access it via its IP like a regular router/modem, as long as your PC is within the same network?

Is AT-CHAT a console for AT commands?

I know that the kit has got a serial port, so that would of course be the easiest solution (if a serial→USB-A cable works) because I would only have to change the port number. I’ve already got working code that sends SMS with my old modem, which is as easy as simply sending e.g. “AT+CPIN=yourpin” through the library to unlock the SIM card but this relies on the modem to actually show up as COM port, which regular modern LTE modems apparently do not.

I don’t understand, what’s the RaspberryPi for? My old USB modem is currently plugged into the USB port of my PC and I access it through its COM port but modern models apparently don’t expose that.

Mikrotik does not offer built-in Java support so you have to create/debug new method to send SMS for your service. Instead of that you can run your Java module on a small Pi + GSM hat attached or connect your old tested GSM dongle.
Whole solution would fit in a small case, not much bigger than GSM enabled Miktoik's ones.

I see. What OS would you install on the Raspberry Pi and how would you access it? I need a way to send the SMS infos (text, phone number,…) to it but also to receive replies (in case of errors). This is pretty easy with my current setup because it’s just a single Java app but sadly I can’t use it for new USB modems because they don’t expose their COM port in Windows.

https://www.raspberrypi.com/software/

Full flagged OS based on Debian.

Ah, the default one, thanks!

I found an old German tutorial that describes how to send SMS with Raspberry Pi, which doesn’t look too hard to set up (it uses a USB modem, not a hat) but I don’t understand how you access all of that from the outside. I think, a solution that I can use directly from my existing Java program would be best.

The name "gammu" recalled old good&golden Nokia's times.
Have to dig out my old Watcom's C module to send SMSes module with Nokia phone. :slight_smile:

Yes, the Mikrotik LtAP mini LTE kit works a bit differently from your regular USB GSM modem. It is basically a router with a built in LTE modem, so instead of connecting directly via COM port and AT commands, you will communicate with it over the network.

If your Java app depends on AT commands, you will need to adapt it. either use Mikrotik’s API or send commands through SSH/Telnet sessions. It is a solid, more reliable setup, just bit different from your current approach.

The LTE kit has a serial port (RS 232) and this might be a long shot because I don’t know much about how this works but does this expose a COM port and could I use a serial to usb adapter cable to access it directly (and send AT commands)?

Are you talking about the REST API patrikg linked?

The RS232 port on the LtAP mini doesn’t expose the internal LTE modem directly for AT commands — it’s mainly for console access to the RouterOS itself. Even if you connect it with a serial-to-USB adapter, you’ll still be interfacing with RouterOS, not the modem.

If your goal is to send AT commands directly, that won’t work the same way as a regular GSM modem. In that case, using the REST API (as patrikg mentioned) or the RouterOS scripting/API approach would be the way to go for SMS handling.

Okay, that’s a pity.

This one uses HTTP’s “GET”,… commands and afaik you can use these with “HttpURLConnection” in Java.

But what version is this one?

I’m currently testing the kit:

There’s a Java library here but it hasn’t been updated to the latest changes in routerOS yet, so you either have to clone the fix yourself (not merged with the main branch yet) or, if you only want to send SMS, you only need the sending/receiving functions of the Util class (“ApiConnectionImpl.java” shows how to log in). It seems pretty straight-forward, especially since the commands translate pretty much to how you would access these things in the web interface. It almost seems too easy tbh, you only call /login (already tested and working) + /tool sms send and sometimes the other command to delete old messages (haven’t found the correct command for that again yet - not sure if you have to do that even when receiving is disabled). Maybe also a log out (is there an auto-logout timer or does it stay logged in indefinitely?). Is that really it?

What I did notice: In “Tools/SMS” there are two options for the type: “Serial” and “LTE Interface”. The latter is probably what’s usually used when a SIM card is inserted in the kit but the former uses either the “serial0” or “usb2” interface. I’m guessing that “usb2” would be used to access a USB modem that is plugged into the modem but what would you connect to the serial port to send SMS with?