serial issues going from uno to Pro Micro. SIM800L Softwareserial.h

Hey people, this may sound stupid, but it has me kinda stumped. I'll explain.

I mashed some code together on an Uno (i'll attach the code, and a schematic below), but always intended on moving it over to a 5v/16mhz Pro Micro board( i have like 15 of them, unused)

Problem that I am having is that the project is meant to communicate with a SIM800L over 9600baud serial. This whole thing is working perfectly on the UNO, but I can't seem to get it to work on the Pro Micro. I have read up on the softwareserial.h, but I can't make heads or tails of it. the code is not complicated, imho, but i'm still butting heads with this. When I recompile the code for the pro micro, which is the Leonardo based chip, the code outputs only the the serial monitor and doesn't communicate with the SIM800L.

Anyone able to help? Hoping that someone may be able to provide that last little bit of help I need to finish this stage of the project. Thanks in advance. Please be specific with any help, don't just tell me to RTFM, because I have and I'm still stuck.

The link below is the Fritzing schematic. the two items at the top are LM2596 DC-DC buck converters. One is set at 5v output for the Arduino, and the other is set at 3.7v for the SIM800L. It is intended to run off of 12V vehicle power, so these were chosen for a stable output voltage(and their cheap as) The Fob is not shown in the schematic, but instead 4 relays are shown. Please ignore the relay loading the pins etc, the don't exist in real life in my project.

If you've read this far, I want to thank you again in advance, i'm so close to deployment.

Schematic with Uno. Working now

/*SMS_Star_.04d 2016 Michael Illingby
 * This software was assembled to allow the interface of a SIM800L 
 * with a Key Fob to give cell phone control over GSM via SMS
 * to give unlimited range for autostart features and vehicle 
 * location. I can be reached at michael.i@me.com if you have
 * any questions, or wish to colaborate. Portions of code 
 * dealing with SIM800L repurposed from belajarduino.com. 
 */
 
#include <gprs.h>
#include <softwareserial.h>

#define TIMEOUT    5000

GPRS gprs;
 
void setup() {
  pinMode (3 , OUTPUT); //Locate
  pinMode (4 , OUTPUT); //Unlock
  pinMode (5 , OUTPUT); //Lock
  pinMode (6 , OUTPUT); //Auto Start 
  Serial.begin(9600);
  while(!Serial);

 
  Serial.println("Starting SIM800L SMS Auto Read");
  gprs.preInit();
  delay(1000);
 
  while(0 != gprs.init()) {
      delay(1000);
      Serial.print("init error\r\n");
  } 
 
  //Set SMS mode to ASCII
  if(0 != gprs.sendCmdAndWaitForResp("AT+CMGF=1\r\n", "OK", TIMEOUT)) {
    ERROR("ERROR:CNMI");
    return;
  }
   
  //Start listening to New SMS Message Indications
  if(0 != gprs.sendCmdAndWaitForResp("AT+CNMI=1,2,0,0,0\r\n", "OK", TIMEOUT)) {
    ERROR("ERROR:CNMI");
    return;
  }
 
  Serial.println("Init success");
}
 
//Variable to hold last line of serial output from SIM800
char currentLine[500] = "";
int currentLineIndex = 0;
 
//Boolean to be set to true if message notificaion was found and next
//line of serial output is the actual SMS message content
bool nextLineIsMessage = false;
 
void loop() {
  //Write current status to LED pin
         digitalWrite(13, LOW); 
  //If there is serial output from SIM800
  if(gprs.serialSIM800.available()){
    char lastCharRead = gprs.serialSIM800.read();
    //Read each character from serial output until \r or \n is reached (which denotes end of line)
    if(lastCharRead == '\r' || lastCharRead == '\n'){
        String lastLine = String(currentLine);
         
        //If last line read +CMT, New SMS Message Indications was received.
        //Hence, next line is the message content.
        if(lastLine.startsWith("+CMT:")){
           
          Serial.println(lastLine);
          nextLineIsMessage = true;
           
        } else if (lastLine.length() > 0) {
           
          if(nextLineIsMessage) {
            Serial.print("Recieved Command : ");
            Serial.println(lastLine);

            
//Auto Starter Function - requires pressing autostart button twice. relay connected to pin D6             
            if(lastLine.indexOf("Start") >= 0){
              digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
              delay(500);                       // wait for half a second
              digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
              delay(500);
              digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
              delay(500);                       // wait for half a second
              digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
              Serial.println("Starting");} 
              else if(lastLine.indexOf("Start off") >= 0) {
              Serial.println("Start off");}

//Lock Function - requires pressing Lock button once. relay connected to pin D5                
            if(lastLine.indexOf("Lock") >= 0){
              digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
              delay(500);                       // wait for half a second
              digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW
              Serial.println("Locking");} 
              else if(lastLine.indexOf("Lock off") >= 0) {
              Serial.println("Lock off");}
             
//Unlock Function - requires pressing Unlock button once. relay connected to pin D4             
            if(lastLine.indexOf("Unlock") >= 0){
              digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
              delay(500);                       // wait for half a second
              digitalWrite(4, LOW);    // turn the LED off by making the voltage LOW
              Serial.println("Unlocking");} 
              else if(lastLine.indexOf("Lock off") >= 0) {
              Serial.println("Lock off");}
             
//Locate Function - requires pressing Locate button once. relay connected to pin D3             
            if(lastLine.indexOf("Locate") >= 0){
              digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
              delay(1500);                       // wait for one and a half seconds
              digitalWrite(3, LOW);    // turn the LED off by making the voltage LOW
              Serial.println("Locating");} 
              else if(lastLine.indexOf("Lock off") >= 0) {
              Serial.println("Lock off");}
             
            nextLineIsMessage = false;
          }
           
        }
         
        //Clear char array for next line of read
        for( int i = 0; i < sizeof(currentLine);  ++i ) {
         currentLine[i] = (char)0;
        }
        currentLineIndex = 0;
    } else {
      currentLine[currentLineIndex++] = lastCharRead;
    }
  }
}

michaeli:
but I can't seem to get it to work on the Pro Micro.

Presumably something happens that you have not told us?

"not working" does not provide any useful debug information.

I presume you are aware that the Pro Micro has a spare HardwareSerial port (Serial1) so you probably don't need to use SoftwareSerial. I have never tried SoftwareSerial on my Pro Micro but I am not aware of any reason why it would not work.

I know nothing about the GPRS library. I can't see where the SoftwareSerial pins are defined.

...R

Robin2:
Presumably something happens that you have not told us?

"not working" does not provide any useful debug information.

I presume you are aware that the Pro Micro has a spare HardwareSerial port (Serial1) so you probably don't need to use SoftwareSerial. I have never tried SoftwareSerial on my Pro Micro but I am not aware of any reason why it would not work.

I know nothing about the GPRS library. I can't see where the SoftwareSerial pins are defined.

...R

When I recompile the code for the pro micro, which is the Leonardo based chip, the code outputs only the the serial monitor and doesn't communicate with the SIM800L.

Sorry if I wasn't clear enough, I don't know whats wrong honestly, I only know that when I upload it to the Arduino pro micro, I have no serial communication with the sim800l.

Maybe defining the pins is what I am missing, how do I do that for the pro micro? Do I still use pins 1&2, or do I have to use other pins? Can I still use 7&8? am I limited to what pro micro pins i CAN use?

Can you shoot me an example of how to define those pins in software serial?

Is there something I can provide that will elaborate? I don't know what to say.

michaeli:
Maybe defining the pins is what I am missing, how do I do that for the pro micro? Do I still use pins 1&2, or do I have to use other pins? Can I still use 7&8? am I limited to what pro micro pins i CAN use?

This is confusing. I did not know you are using Pins 1 and 2 with the Uno. And the Rx and Tx pins are actually 0 and 1.

Normally you would have a line like

SoftwareSerial mySerial(7, 8); // RX, TX

but, as I don't see that in your program it must happen inside the GPRS library and I have no idea what that might be doing. You need to read the library documentation.

...R

I am using pins 7&8 of the Arduino currently

Not all pins on all Arduinos support pin change interrupts. You can only use SoftwareSerial on pins that do support pin change interrupts. On the Uno, all pins support pin change interrupts. On other Arduinos, that is not necessarily the case. You need to dig into the documentation for your board, to see which pins support pin change interrupts and use only those pins.

michaeli:
I am using pins 7&8 of the Arduino currently

Then why did you say "Do I still use pins 1&2"?

It is much easier to help when you explain what you are thinking. No problem if it was typo, but it clarifies things to say so.

...R

1&2 are the TXD & RXD pins on the Pro Micro, but they aren't working. What I meant was do I configure softwareserial for pins 1&2, or do I need to use different pins. Thats what I meant, sorry

1&2 are the TXD & RXD pins on the Pro Micro

No, they aren't. 0 and 1 are the hardware serial pins for the Serial1 instance.

michaeli:
What I meant was do I configure softwareserial for pins 1&2, or do I need to use different pins. Thats what I meant, sorry

As I said in Reply #3 you need to study the documentation (and maybe the source code) for your GPRS library. Without knowing what the library does you are just floundering in the dark.

...R

I didn't download or add any GPRS library, or softwareserial for that matter. I saw mention of them online and added the #include tags. They come with the IDE by chance, this was a fresh install last night, so I know I didn't add them. but after some searching I found something that must have come with it from Seeduino

Here is the gprs.h. I can't find anything in there that is defining pins at all.

/*
 * gprs.h
 * A library for SeeedStudio seeeduino GPRS shield
 *
 * Copyright (c) 2013 seeed technology inc.
 * Author        :   lawliet zou
 * Create Time   :   Dec 2013
 * Change Log    :
 *
 * The MIT License (MIT)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#ifndef __GPRS_H__
#define __GPRS_H__

#include "sim800.h"

enum Protocol {
    CLOSED = 0,
    TCP    = 1,
    UDP    = 2,
};

/** GPRS class.
 *  used to realize GPRS communication
 */
#define MESSAGE_LENGTH  20

class GPRS: public SIM800
{
public:
    uint32_t _ip;
    char ip_string[20];

    /** Create GPRS instance
     *  @param number default phone number during mobile communication
     */
    GPRS(int baudRate = 9600):SIM800(baudRate){};

    /** initialize GPRS module including SIM card check & signal strength
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int init(void);

    /** Join APN
     *  @return
     *        true Jion APN successfully
     *        false failed to join VPN
     */
    bool join(const char  *apn = 0, const char *userName = 0, const char *passWord = 0);


    /** parse IP string
     *  @return
     *      ip in hex
     */
    uint32_t str_to_ip(const char* str);

    /** get Ip address
     *  @return
     *       IP string
     */
    char* getIPAddress();

    /** check SIM card' Status
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int checkSIMStatus(void);

    /** check network is OK or not
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int networkCheck(void);

    /** send text SMS
     *  @param  *number phone number which SMS will be send to
     *  @param  *data   message that will be send to
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int sendSMS(char* number, char* data);

    /** read SMS if getting a SMS message
     *  @param  buffer  buffer that get from GPRS module(when getting a SMS, GPRS module will return a buffer array)
     *  @param  message buffer used to get SMS message
     *  @param  check   whether to check phone number(we may only want to read SMS from specified phone number)
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int readSMS(int messageIndex, char *message, int length);

    /** delete SMS message on SIM card
     *  @param  index   the index number which SMS message will be delete
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int deleteSMS(int index);

    /** call someone
     *  @param  number  the phone number which you want to call
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int callUp(char* number);

    /** auto answer if coming a call
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int answer(void);

    /** build TCP connect
     *  @param  ip  ip address which will connect to
     *  @param  port    TCP server' port number
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int connectTCP(const char* ip, int port);

    /** send data to TCP server
     *  @param  data    data that will be send to TCP server
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int sendTCPData(char* data);

    /** close TCP connection
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int closeTCP(void);

    /** close TCP service
     *  @returns
     *      0 on success
     *      -1 on error
     */
    int shutTCP(void);
};
#endif

I defiantly don't have softwareserial.h anywhere on my machine, unless it's hidden that can't be searched. Could this maybe be my problem? Maybe I need to get that and set it up for the Pro Micro?

SoftwareSerial is part of the Arduino system. In my 1.6.3 it is at

...../arduino-1.6.3/hardware/arduino/avr/libraries/SoftwareSerial

but I don't have any GPRS library.

Can you post the code for your gprs.cpp

...R

If there is nothing in the gprs.h file, and nothing in the corresponding source file, then the class assumes that the device is connected to specific pins (possibly the hardware serial pins) that are documented somewhere else (possibly on seeed's web site).

/*
 * gprs.cpp
 * A library for SeeedStudio seeeduino GPRS shield
 *
 * Copyright (c) 2013 seeed technology inc.
 * Author        :   lawliet zou
 * Create Time   :   Dec 2013
 * Change Log    :
 *
 * The MIT License (MIT)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#include <stdio.h>
#include "gprs.h"

int GPRS::init(void)
{
#if 0
    for(int i = 0; i < 2; i++){
        sendCmd("AT\r\n");
        delay(100);
    }
    sendCmd("AT+CFUN=1\r\n");
    if(0 != checkSIMStatus()) {
        ERROR("ERROR:checkSIMStatus");
        return -1;
    }
    return 0;

#endif
    if(sendCmdAndWaitForResp("AT\r\n","OK\r\n",DEFAULT_TIMEOUT*3)){
      return -1;
    }
    if(sendCmdAndWaitForResp("AT+CFUN=1\r\n","OK\r\n",DEFAULT_TIMEOUT*3)){
      return -1;
    }
    if(checkSIMStatus()) {
		  return -1;
    }
    return 0;

}

bool GPRS::join(const char *apn, const char *userName, const char *passWord)
{
    char cmd[64];
    char ipAddr[32];
    char gprsBuffer[32];
   
    //Select multiple connection
    //sim900_check_with_cmd("AT+CIPMUX=1\r\n","OK",DEFAULT_TIMEOUT,CMD);
      
    cleanBuffer(ipAddr,32);
    sendCmd("AT+CIFSR\r\n");    
    readBuffer(ipAddr,32,2);
    
    // If no IP address feedback than bring up wireless 
    if( NULL != strstr(ipAddr, "ERROR") )
    {
        if( 0 != sendCmdAndWaitForResp("AT+CSTT?\r\n", apn, DEFAULT_TIMEOUT) )
        {
            sendCmd("AT+CSTT=\"");
            sendCmd(apn);
            sendCmd("\",\"");
            sendCmd(userName);
            sendCmd("\",\"");
            sendCmd(passWord);        
            sendCmdAndWaitForResp("\"\r\n","OK\r\n",DEFAULT_TIMEOUT*3);
        }
        
        //Brings up wireless connection
        sendCmd("AT+CIICR\r\n");
         
        //Get local IP address
        cleanBuffer(ipAddr,32);
        sendCmd("AT+CIFSR\r\n");
        readBuffer(ipAddr,32,2);        
    }          
#if 0    
    Serial.print("ipAddr: ");
    Serial.println(ipAddr);
#endif

    if(NULL != strstr(ipAddr,"AT+CIFSR")) {        
        _ip = str_to_ip(ipAddr+11);
        if(_ip != 0) {
            return true;
        }
    }
    return false;
}

uint32_t GPRS::str_to_ip(const char* str)
{
    uint32_t ip = 0;
    char *p = (char*)str;
    
    for(int i = 0; i < 4; i++) {
        ip |= atoi(p);
        p = strchr(p, '.');
        if (p == NULL) {
            break;
        }
        if(i < 3) ip <<= 8;
        p++;
    }
    return ip;
}

//HACERR lo de la IP gasta muuuucho espacio (ver .h y todo esto)
char* GPRS::getIPAddress()
{
    uint8_t a = (_ip>>24)&0xff;
    uint8_t b = (_ip>>16)&0xff;
    uint8_t c = (_ip>>8)&0xff;
    uint8_t d = _ip&0xff;

    snprintf(ip_string, sizeof(ip_string), "%d.%d.%d.%d", a,b,c,d);
    return ip_string;
}

int GPRS::checkSIMStatus(void)
{
    char gprsBuffer[32];
    int count = 0;
    cleanBuffer(gprsBuffer,32);
    while(count < 3) {
        sendCmd("AT+CPIN?\r\n");
        readBuffer(gprsBuffer,32,DEFAULT_TIMEOUT);
        if((NULL != strstr(gprsBuffer,"+CPIN: READY"))) {
            break;
        }
        count++;
        delay(300);
    }
    if(count == 3) {
        return -1;
    }
    return 0;
}

int GPRS::networkCheck(void)
{
    delay(1000);
    if(0 != sendCmdAndWaitForResp("AT+CGREG?\r\n","+CGREG: 0,1",DEFAULT_TIMEOUT*3)) {
        ERROR("ERROR:CGREG");
        return -1;
    }
    delay(1000);
    if(0 != sendCmdAndWaitForResp("AT+CGATT?\r\n","+CGATT: 1",DEFAULT_TIMEOUT)) {
        ERROR("ERROR:CGATT");
        return -1;
    }
    return 0;
}

int GPRS::sendSMS(char *number, char *data)
{
    char cmd[32];
    if(0 != sendCmdAndWaitForResp("AT+CMGF=1\r\n", "OK", DEFAULT_TIMEOUT)) { // Set message mode to ASCII
        ERROR("ERROR:CMGF");
        return -1;
    }
    delay(500);
    snprintf(cmd, sizeof(cmd),"AT+CMGS=\"%s\"\r\n", number);
    if(0 != sendCmdAndWaitForResp(cmd,">",DEFAULT_TIMEOUT)) {
        ERROR("ERROR:CMGS");
        return -1;
    }
    delay(1000);
    serialSIM800.write(data);
    delay(500);
    sendEndMark();
    return 0;
}

int GPRS::readSMS(int messageIndex, char *message,int length)
{
    int i = 0;
    char gprsBuffer[100];
    char cmd[16];
    char *p,*s;

    sendCmdAndWaitForResp("AT+CMGF=1\r\n","OK",DEFAULT_TIMEOUT);
    delay(1000);
    sprintf(cmd,"AT+CMGR=%d\r\n",messageIndex);
    serialSIM800.write(cmd);
    cleanBuffer(gprsBuffer,100);
    readBuffer(gprsBuffer,100,DEFAULT_TIMEOUT);

    if(NULL != ( s = strstr(gprsBuffer,"+CMGR"))){
        if(NULL != ( s = strstr(gprsBuffer,"+32"))){
            p = s + 6;
            while((*p != '

)&&(i < length-1)) {
               message[i++] = *(p++);
           }
           message[i] = '\0';
       }
   }
   return 0;
}

int GPRS::deleteSMS(int index)
{
   char cmd[16];
   snprintf(cmd,sizeof(cmd),"AT+CMGD=%d\r\n",index);
   sendCmd(cmd);
   return 0;
}

int GPRS::callUp(char *number)
{
   char cmd[24];
   if(0 != sendCmdAndWaitForResp("AT+COLP=1\r\n","OK",5)) {
       ERROR("COLP");
       return -1;
   }
   delay(1000);
   sprintf(cmd,"\r\nATD%s;\r\n", number);
   serialSIM800.write(cmd);
   return 0;
}

int GPRS::answer(void)
{
   serialSIM800.write("ATA\r\n");
   return 0;
}

int GPRS::connectTCP(const char ip, int port)
{
   char cipstart[50];
   sprintf(cipstart, "AT+CIPSTART="TCP","%s","%d"\r\n", ip, port);
   if(0 != sendCmdAndWaitForResp(cipstart, "CONNECT OK", 2
DEFAULT_TIMEOUT)) {// connect tcp
       ERROR("ERROR:CIPSTART");
       return -1;
   }

return 0;
}
int GPRS::sendTCPData(char data)
{
   char cmd[32];
   int len = strlen(data);
   snprintf(cmd,sizeof(cmd),"AT+CIPSEND=%d\r\n",len);
   if(0 != sendCmdAndWaitForResp(cmd,">",2
DEFAULT_TIMEOUT)) {
       ERROR("ERROR:CIPSEND");
       return -1;
   }
       
   if(0 != sendCmdAndWaitForResp(data,"SEND OK",2*DEFAULT_TIMEOUT)) {
       ERROR("ERROR:SendTCPData");
       return -1;
   }    
   return 0;
}

int GPRS::closeTCP(void)
{
   sendCmd("AT+CIPCLOSE\r\n");
   return 0;
}

int GPRS::shutTCP(void)
{
   sendCmd("AT+CIPSHUT\r\n");
   return 0;
}

That still does not have the relevant code and it seems to be referring to functions that are not within it.

Post a link to the place where you got the library so I can see all of it.

...R

I am almost certain that this is where I got it from.

michaeli:
GitHub - Seeed-Studio/Seeeduino_GPRS: Seeeduino GPRS Library

I am almost certain that this is where I got it from.

I will have a look at that.

One way to confirm it is to download the code from the known website and see if it works. :slight_smile:

...R

In the file gprs.h there is a line

#include "sim800.h"

and in that file there are the lines

#define SIM800_TX_PIN           8
#define SIM800_RX_PIN           7
#define SIM800_POWER_PIN        9
#define SIM800_POWER_STATUS     12

If you want to use different pins that seems to be the place where you need to make the changes

IMHO it was very unhelpful for the author to put those definitions into that file when he could easily have instructed the user to place them in the user program where they would be visible.

...R

there must be something different then between the pins 8&7 on the UNO vs the Pro Micro then. I originally tried moving the sketch over the the Pro Micro, and it didn't work, which is what prompted this thread in the first place.

on the uno, I use 8 RX and 7 TX, but when I switched over to the micro, it didn't work at all

are uno pins 8&7 different than Pro Micro (leonardo) pins 8&7?

not sure if I'm asking this properly, but I hope that you get my point here.

I have not found any single document that answers your question. Try using Pins 8 and 9 - because Pin 7 seems to connect to physical pin 1 on the 32U4 and it is a different type of interrupt pin.

(I am assuming the Micro is closely similar to a Leonardo).

...R