Electron doesn't seem to respond to Serial input

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()) {

        serialData = Serial.read();
        switch(serialData) {
          case 'A':
          case 'a':
            Serial.println("Enter the APN: ");
            STATE = ENTER_APN_STATE;
            inputBufferOffset = 0;
          case 'K':
          case 'k':
            Serial.println("Enter the keepAlive value in seconds: ");
            inputBufferOffset = 0;
          case 'C':
          case 'c':
            Serial.println("Starting the carrier report...");
            stateTime = millis();

          case 'D':
          case 'd':
            Serial.println("Printing out EEPROM vars: ");
            stateTime = millis();
          case '\r':
          case '\n':
            STATE = MENU_STATE;

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?

What tool are you using to send the data to the device.
Are you using a non-AUTOMATIC system mode and/or SYSTEM_THREAD(ENABLED)?
Can you try a really minimal test sketch that only catches the input and mirrors it back as it comes in?

What ScruffR said. Make sure you’re not using particle serial monitor because that’s really only a monitor - you can’t type commands to the device into it.

1 Like

Yea, I was just about to delete the question, ha. I’m pretty sure it is what @rickkas7 suggested. I was using particle serial monitor without thinking about it. Should probably sleep before posting questions…

Is there a recommended vscode extension for a serial monitor that supports input? Pretty sure that functionality was lost between the Atom-based IDE and the current vscode-based one?