Usage: This method is the constructor of the NBduuino
- Author
- Antonio Cafiero
- Parameters
-
mqttServer | The name or the IP address of the MQTT broker (String) |
mqttPort | The port number of the MQTT broker (Int) |
mqttUser | The username enabeled to access the MQTT broker (String) |
mqttPassword | The password to autenticate the userto access the MQTT broker (String) |
timeToConn | The timeout in ms in connection phase (unsigned long) NBduino NBiot( "54.76.137.235", 18224, "test", "test", 60000); |
- Date
- 14/12/2018
/**
* @file NBduino_MQTT_HELLO_WORLD.ino
* @brief Plug your NBduino SHIELD on the Arduino board,run this sketch, after loading is complete open
* the IDE serial monitor publish, over MQTT protocol, "Hello World!"
* as "payload" and the SHIELD's IMEI as "Topic"
*
* @author Antonio Cafiero
*
* @date 14/12/2018
*/
#include <NBduinoLibrary.h>
NBduino NBiot("54.76.137.235", 18224, "test", "test");
String Topic;
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("Let's start!");
delay(300);
NBiot.begin();
Topic = NBiot.reqIMEI();
}
void loop()
{
NBiot.publish(Topic, "Hello World");
delay(1000);
}