Page 1 of 1

Cloud MQTT Subscribe Commands

PostPosted: Tue Jan 29, 2019 6:57 am
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

Re: Cloud MQTT Subscribe Commands

PostPosted: Tue Jan 29, 2019 11:40 am
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

Re: Cloud MQTT Subscribe Commands

PostPosted: Tue Jan 29, 2019 11:48 am
by 89delta
Thank Roberto...

Sent from my SM-N920T using Tapatalk