funcion de Arduino IDE que manda un mqtt por SIM7080G usando las librerias tinyGSm y PubSubClient requiere el topic y el mensaje setup y funciones
#include <Arduino.h> #include <TinyGsmClient.h> #include <PubSubClient.h> #include <ArduinoJson.h> #define pwmmoter 5 #define C_SPEED MOTOR_100_PERCENT #define DEVICE_NAME "test" #define AT_COMMAND_DELAY 1000 #define PUB_TOPIC "test" #define PUB_TOPIC "test" #define MQTT_SERVER "mqtt.thingspeak.com" #define MQTT_PORT 1883 TinyGsm modem(SerialAT); TinyGsmClient client(modem); PubSubClient mqtt(client); void motor_stop() { analogWrite(pwmmoter, 0); } void motor_move(int speed) { analogWrite(pwmmoter, speed); } void motor_foward() { motor_move(C_SPEED); } void