B4R Question Sending MQTT messages with gprs shield?

Discussion in 'B4R Questions' started by corwin42, Jul 4, 2017.

  1. corwin42

    corwin42 Expert Licensed User


    I'm very new to Arduino and B4R and I'm still learning the basics.

    My goal is to create a piece of hardware which is able to communicate with an MQTT broker over a GSM/GPRS shield.

    I know there is an MQTT tutorial for B4R but this uses an ethernet connection. There is also a tutorial for gsm/gprs communication but this uses only SMS messages to communicate.

    Is it possible to create a connection to an MQTT broker over GPRS? The hardware will work in my car so there is no way to use wifi. I need to use gsm/gprs connection.
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Arduino GSM library was not wrapped yet. The SMS implementation is a custom implementation based on the AT commands.

    I will try to wrap it as this is indeed an interesting feature.
    janderkan, Peter Simpson and corwin42 like this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    I've created an example of sending http requests with the GSM shield: https://www.b4x.com/android/forum/threads/http-requests-with-gsm-shield.81382/
    The implementation is based on the internal AT modem. Creating a TCP connection is a pretty complicated task, especially as there are all kinds of shields with different modules.

    I recommend you to plan the solution based on http requests.
  4. corwin42

    corwin42 Expert Licensed User

    Hmm, then I will need to run/host a http server which is what I want to avoid.
  5. Erel

    Erel Administrator Staff Member Licensed User

    You can use IO Adafruit. It works with both MQTT and HTTP.
    Peter Simpson likes this.
  6. corwin42

    corwin42 Expert Licensed User

    This sounds like a great solution. Thanks.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice