Direct Communication Between GSM IoT Device and Mobile App Without Server or Broker

Hello everyone,

I’m working on a GSM-based IoT project where I want to directly communicate between a GSM module-based IoT device and a mobile app without using any servers, brokers, or third-party cloud services due to cost constraints. I’m specifically looking for a free solution to facilitate direct communication.

Project Details:

Hardware: The device uses an ATmega328P microcontroller and a GSM module. It controls a motor on and off and measures current, with data and command functionalities.
Mobile App: The app is built using Flutter and should ideally establish a direct link with the GSM module for functions like motor control, current readings, registration, and deregistration.

Challenges:

  1. Dynamic IP Issue: Every time the GSM module connects to the network, it’s assigned a new IP address, which is unpredictable. This makes it challenging for the app to locate and connect with the device reliably.
  2. DDNS and NAT: While Dynamic DNS (DDNS) seemed like a potential solution, the presence of Network Address Translation (NAT) on the GSM network causes additional connectivity issues, making DDNS impractical.
  3. Free Solution Requirement: My goal is to create a cost-effective solution without recurring expenses, so I can’t host a server or maintain an MQTT broker. I need a solution or protocol that would allow the app to communicate with the device directly without needing a central server or a paid service.

Question: Is there a protocol or method available to establish a stable, direct connection between a GSM-based IoT device and a mobile app under these conditions? Alternatively, are there any workarounds that could help in this setup?

Any suggestions or insights would be greatly appreciated! Thank you in advance for your help.

had the same problem some years ago using microcontrollers with modems sensing information in remote locations.
every time the modem connected to the internet they receive a new IP address and were behind a NAT box so direct access from the internet was difficult (did hear at one time modems could be assigned static IPs - at a cost)
in the end we used our own server with a static IP running a TCP or UDP servers (implemented in Java) - the modems would connect to the server and upload data - laptops (equipped with modems) would connect to the server to view or download data