Hi all,
I am from South Africa. I am trying to get airtime balance from my sim800l but the command does not return what I want to see. When I type the command in the serial monitor, it displays the balance, but from the code it just displays the command without the airtime balance in the serial monitor.
#include <SoftwareSerial.h>
SoftwareSerial sim800l(5, 4);
void setup() {
Serial.begin(9600);
sim800l.begin(9600);
Serial.print("Airtime balance: ");
Serial.println("AT+CUSD=1,\"*100#\""); //Returns airtime balance
updateSerial();
}
void loop() {
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
sim800l.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(sim800l.available())
{
Serial.write(sim800l.read());//Forward what Software Serial received to Serial Port
}
}

Please help!