.sendCANmsg not working with encoder data collection

I am running into a problem regarding the sendCANmsg and encoder data collection, as soon as I try to start sending the data the encoder is transmitting, the Arduino no longer receives any data from one of the two output wires on the encoder. I am using gray code to determine the position of the encoder via binary output of the encoder, so to clarify when the sendCANmsg is running, one of the outputs from the encoder will only return zeros when turned. This code works perfectly fine when not trying to send the data collected by the encoder. I am not sure how to fix this and would greatly appreciate help! I can give more info as necessary

Can you post a schematic, that or even a hand drawn schematic is better than a frizzy picture. Also post links to technical information on each of the hardware items.

I'm sorry it says as a new user I cannot upload attachments but I can try and type out the best explanations I can.

I have a
{Rotary Encoder TYPE: LPD3806-600BM-G5-24C}
it has 4 wires coming out of it, two being for power, which are connected to a
{CAN-BUS shield v2.0 by seeedstudio}
in the 5v output spot and ground. The other two wires from the rotary encoder are its outputs which are connected to the digital 3 and 2 slots as to utilize the interrupts. The shield is then attached accordingly into an

{Arduino UNO R3}
as to be utilized for the calculations. The shield is also connected via two wires in the voltage output and ground section into another exact shield devices voltage input and ground ports. Both shields are also connected via their Can H and L ports directly to one another. The second shield is accordingly attached to an
{Arduino MEGA 2560}.

I am more than happy to answer any other questions, and will try to answer to the best of my ability, if there is more than I can do to help or get images up please let me know. Thank you very much

p.s. I had to split this up into two posts because as a new user I apparently cannot post more than two links in a single message either

Sorry but I cannot follow what you are saying. The schematic would help a lot as well as posting your code. Do you have termination resistors on each CAN unit and is the CAN wires a few feet in length? What is your question?

Again, I cannot post images as a new user sadly but I have made a schematic in a google drawing which I have linked here the code utilized is at the bottom. In terms of the resistors, we simply have a sort length of wires connected to from each of the shield units directly connected to each of the CAN H and CAN L ports as shown in the schematic with no resistors. The question is why when the code is run and CAN.sendmsg is commented out do we collect the correct encoder values since the LSB varied between 1 and 0 as expected, but when we try activating the CAN.sendmsg the LSB always comes back as 0.

I hope this information is more helpful, again I am more than happy to answer more questions and bring more information into the conversation.

// Needs to collect encoder data and send to mega visual
//Setting libraries and values

#include <SPI.h>
#include <mcp_can.h>

//
MCP_CAN CAN(10);

//sets values
int encoderPin1 = 2;
int encoderPin2 = 3;
volatile int lastEncoded = 0;
volatile long encoderValue = 0;
volatile long lastencoderValue = 0;
int lastMSB = 0;
int lastLSB = 0;

unsigned char canMsg1[1] = {0};

//Initialization process
void setup()
{
    Serial.begin(115200);
    pinMode(encoderPin1, INPUT); 
    pinMode(encoderPin2, INPUT);
    digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
    digitalWrite(encoderPin2, HIGH); //turn pullup resistor on
    attachInterrupt(digitalPinToInterrupt(2), updateEncoder, CHANGE); //interrupts the pin based on a change noticed in the pin and calls a function
    attachInterrupt(digitalPinToInterrupt(3), updateEncoder, CHANGE); 
 
    //tests if the can communication is working
    while (CAN_OK != CAN.begin(CAN_500KBPS))
    {
        Serial.println("CAN BUS init Failed");
        delay(100);
    }
    Serial.println("CAN BUS Shield Init OK!");
}

void loop()
{
  //looping display of the values of interest
  canMsg1[0] = encoderValue*0.1067; //stores the position of the ecoder in a data frame.
  Serial.println(encoderValue); //takes stored value in data frame and displayes in degrees
  //looping send of these values
  CAN.sendMsgBuf(0x177, 0, 1, canMsg1);//sends a message of hex id 177, standard frame, length of 1, containing canMsg1.
}

void updateEncoder()
{
  int MSB = digitalRead(encoderPin1); //MSB = most significant bit
  //Serial.print("MSB: ");
  //Serial.println(MSB);
  int LSB = digitalRead(encoderPin2); //LSB = least significant bit
  //Serial.print("LSB: ");
  //Serial.println(LSB);
  int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
  //Serial.print("encoded: ");
  //Serial.println(encoded);
  int sum  = (lastEncoded << 2) | encoded; //combining it with the previous encoded value
  //Serial.print("sum: ");
  //Serial.println(sum);

  if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++; //clockwise
  if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --; //counter clockwise

  lastEncoded = encoded; //store this value for next time 
}

did you read through the details of the Seeed CAN sheild:
Capture

the INT pin is and OUTPUT from the MCP2515 chip.

and the pins you are using for you encoder are...?

My understanding is that the encoder is attached to pins D2 and D3, but it is also depicted in the schematic in my previous comment if you would like to double check that I am correct about that.

I have posted an updated schematic in the link in the post below for you if that helps

My understanding is that the encoder is attached to pins D2 and D3, but it is also depicted in the schematic in my previous comment if you would like to double check that I am correct about that.