CAN.isRemoteRequest(); always gives 1

Hi all!
I use an MCP 2515 modul.
The CAN.isRemoteRequest(); always gives 1 in WEB editor, BUT the same code (and mybe same mcp_can.h) in installed Ardunio IDE works well!

Can you help me sb?

that's my stack: Arduino Cloud

void readCANmsg(void)
{
byte readlen =0;
if(CAN_MSGAVAIL == CAN.checkReceive()) // check if data coming
{
if(!CAN.isExtendedFrame())
{
unsigned long canId = 0;

CAN.readMsgBufID(&canId, &readlen, buf); // read buf with object ID
byte isRTR = CAN.isRemoteRequest();
switch (canId)
{
case (STATUS_VALUE+NODE_ID): //
{
if(isRTR)
{
GF0._bits.SendStatus=1;
}
}
break;
case (COMMAND_VALUE+NODE_ID):
{
if((!isRTR)&&(readlen==2))
{
if(((commandByte0_mask & buf[0])==GOvalveOPEN) && valve_state==VALVE_CLOSED) valve_move_request=1;
if(((commandByte0_mask & buf[0])==GOvalveCLOSE) && valve_state==VALVE_OPENED) valve_move_request=1;
StatusByte1.byte = buf[1]; //incremented last command ID
}
}
break;
} // end of switc-case
DEBUG_PRINTLN("-----------------------------");
DEBUG_PRINT("Get data from ID
: ");
DEBUG_PRINTLNHEX(canId);
DEBUG_PRINTLNHEX(isRTR);
DEBUG_PRINTLNHEX(readlen);
DEBUG_PRINTLNHEX(buf[0]);
DEBUG_PRINTLNHEX(buf[1]);
for(int i = 0; i<len; i++) // print the data
{
DEBUG_PRINTHEX(buf*);*

  • DEBUG_PRINT("\t");*
  • }*
  • DEBUG_PRINTLN();*
  • }// end of check NO extended CANID*
  • } // check CAN data *
  • if(last_StatusByte0._byte!=valve_state) //check status byte0 changes //valve state*
  • {*
  • GF0._bits.SendStatus=1;*
  • last_StatusByte0._byte=valve_state;*
  • }*
  • if(last_StatusByte1._byte!=StatusByte1._byte) //check status byte1 changes //command ID*
  • {*
  • GF0._bits.SendStatus=1;*
  • last_StatusByte1._byte=StatusByte1._byte;*
  • }*
  • if(last_StatusByte2._byte!=StatusByte2._byte) //check status byte1 changes //trmerature A*
  • {*
  • GF0._bits.SendStatus=1;*
  • last_StatusByte2._byte=StatusByte2._byte;*
  • }*
  • if(last_StatusByte3._byte!=StatusByte3._byte) //check status byte1 changes //trmerature B*
  • {*
  • GF0._bits.SendStatus=1;*
  • last_StatusByte3._byte=StatusByte3._byte;*
  • } *
  • //if(CAN.checkError()) DEBUG_PRINTLN("CAN ERROR");*
  • } //end of functio*

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile: