I’m using the Ubidots FONA library to send data via an Adafruit FONA 808, and it’s working fine.
The problem I have is that I want to also send the battery level also, which is a function of the Adafruit library but not the Ubidots library.
Specifically: fona.getBattPercent(&vbat) (from the FONA_test program)
I can get the battery function to work if I also instantiate the FONA using the Adafruit library, but if I do this then the Ubidots library no longer sends:
Adafruit_FONA fona = Adafruit_FONA(FONA_RST);
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
SoftwareSerial *fonaSerial = &fonaSS;
fonaSerial->begin(4800);
if (! fona.begin(*fonaSerial)) {
Serial.println(F("Couldn't find FONA"));
while (1);
}
I think that this is because both instances can’t be talking to the same device over serial. So what options do I have?