Cloud MQTT Subscribe Commands

Community contributed apps

Posts: 153
Joined: Mon Oct 15, 2012 7:21 pm
Location: Albany, GA
PostPosted: Tue Jan 29, 2019 6:57 am
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

Posts: 12393
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Jan 29, 2019 11:40 am
Everything looks good, except the broker.
The broker is not RA*.
RA* is also a client.
The cloud server is cloud.reefangel.com
Roberto.

Posts: 153
Joined: Mon Oct 15, 2012 7:21 pm
Location: Albany, GA
PostPosted: Tue Jan 29, 2019 11:48 am
Thank Roberto...

Sent from my SM-N920T using Tapatalk

Return to Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron