When placing an int into a uint8_t vector, the mDot joins and sends data to the conduit successfully. When I try the same with a string, even with only one letter, it fails.
void dotHandler::sendData(std::vector<uint8_t> data)
{
logInfo("sending uplink with data = %d", data);
send_data(data);
if (deep_sleep)
{
// if going into deepsleep mode, save the session so we don't need to join again after waking up
// not necessary if going into sleep mode since RAM is retained
logInfo("saving network session to NVM");
dot->saveNetworkSession();
}
sleep_wake_rtc_or_interrupt(deep_sleep);
}
void dotHandler::sendData(std::string s)
{
std::vector<uint8_t> vec(s.begin(), s.end());
sendData(vec);
}
So this works:
int counter = 0;
sendData(counter++);
And this does not as it fails to join:
std::string s = "hello";
sendData(s);
Why would this be?
edit: I’m using the dot_util from the mDot examples. that’s what the send_data function is