I’m trying to allow users to set the APN and keepAlive for a 3rd-party SIM card; however, the trip up has been at accepting user input over Serial.
It seems like there is never data available over Serial
despite clearly entering data. I have set up the serial connection and then try something like:
while (Serial.available()) {
Serial.println("looking");
serialData = Serial.read();
switch(serialData) {
Serial.println(serialData);
case 'A':
case 'a':
Serial.println("Enter the APN: ");
STATE = ENTER_APN_STATE;
inputBufferOffset = 0;
break;
case 'K':
case 'k':
Serial.println("Enter the keepAlive value in seconds: ");
STATE = ENTER_KEEP_ALIVE_STATE;
inputBufferOffset = 0;
break;
case 'C':
case 'c':
Serial.println("Starting the carrier report...");
STATE = TOWER_REPORT_STATE;
stateTime = millis();
break;
case 'D':
case 'd':
Serial.println("Printing out EEPROM vars: ");
STATE = EEPROM_DATA_STATE;
stateTime = millis();
break;
case '\r':
case '\n':
STATE = MENU_STATE;
break;
}
}
Everything is set up pretty much identical to @rickkas7 clouddebug library. In fact, if I flash the firmware for his library (clouddebug), I experience the same issue - I can’t ever enter in an option for the menu.
I am using os 1.2.1 on an Electron. What are some debugging measures I can take?