Cloud MQTT Subscribe Commands

Community contributed apps
Post Reply
89delta
Posts: 157
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Cloud MQTT Subscribe Commands

Post by 89delta »

How goes it everyone. Well i'm back in the development of my 7" TFT version. I got a couple ESP8266's for a weather station project i'm also working on for a 3.2"TFT. Since the weather station is taking up more of my time atm I thought i'd add a second screen to include the mqtt handlers. I know i'd be subscribing to 89delta/out. Yet i'm still a little lost....so here is what I have so far:

Code: Select all

#include "EspMQTTClient.h"

void onConnectionEstablished();

EspMQTTClient client(
  "ssid*****",           // Wifi ssid
  "********",           // Wifi password
  "192.168.1.101",    // MQTT broker ip
  1883,                    // MQTT broker port
  "89delta",              // MQTT username
  "*********",        // MQTT password
  "test1",                 // Client name                                                           DO I NEED THIS????????
  onConnectionEstablished, // Connection established callback
  true,                    // Enable web updater
  true                     // Enable debug messages
);

void setup()
{
  Serial.begin(115200);
}

void onConnectionEstablished()
{
  client.subscribe("89delta/out", [] (const String &payload)
  {
    Serial.println(payload);
  });
I know I still have to go through the RA Library to get the ip address and port.....but is there anything else I would need to do to my code after I run this and get the payload from the serial output? I'd just want to get the values for pH,Salinity, tank temp and maybe a few other things.

Thanks
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Cloud MQTT Subscribe Commands

Post by rimai »

Everything looks good, except the broker.
The broker is not RA*.
RA* is also a client.
The cloud server is cloud.reefangel.com
Roberto.
89delta
Posts: 157
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Re: Cloud MQTT Subscribe Commands

Post by 89delta »

Thank Roberto...

Sent from my SM-N920T using Tapatalk
Post Reply