79162062

Date: 2024-11-06 09:53:31
Score: 1
Natty:
Report link

Change the credentials type to String, then use c_str() to convert them to char.

// GPRSS credentials
String apn;
String gprsUser;
String gprsPass;
// MQTT credentials
String topic;
String broker;
String clientID;
String brokerUser;
String brokerPass;

Example:

modem.gprsConnect(apn.c_str(), gprsUser.c_str(), gprsPass.c_str())
mqtt.setServer(broker.c_str(), port)
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Chung Phạm