Closed robinhellstrom closed 3 years ago
All messages from CAN1 you mean? Or all 3 busses? Why are you using filter range for CAN1 then overriding it with a regular filter? Can you try one or the other? You can also use msg.mb to identify which mailbox the message came from
@tonton81 there was a typo, I'm not using FilterRange at the same time as regular filters. All CAN1 traffic except 0x258 disappears when using the filters above.
Are there any special MB:s that don't work with standard frame messages?
Not that i am aware of. All busses use the same code, all controllers should respond the same. You can print out the mailbox info with mailboxStatus() to confirm mailboxes should be all set to standard and not extended, else the filtering depends on that flag
Also try without enhancements, although i highly think theyre not affecting it, you are filtering a single ID, so technically you don't need to enhance it as only one frame will pass that filter, hardware blocks everything else, then the SMB would attempt to send the other frame to another mailbox that actually accepts it.
Also curious, did you try having ONLY CAN1 enabled in your sketch without the other ones enabled?
Also make sure you are using the current github copy, last updated Feb 23
Also, for: CAN_2.setMBFilter(MB2, 0x258, STD); Only use STD for setMB, else it acts as a 2nd ID value for the mailbox
I'll give your suggestions a go tomorrow, do I command the mailboxStatus() after I've initiated Serial.begin() in the setup()-loop?
After yes, or whenever you use setMB, so you can see the mailbox layout which are TX, RX STD, and RX EXT
Also, be sure those CANIDs are standard, they can exist with extended frames as well. Example, 0x300 could be an EXTENDED frame as well, and by accepting ALL, it gets collected in the extended mailboxes, and when filtering for standard, you stop receiving it. A data log of ACCEPT_ALL showing msg.flags.extended showing 0 or 1 would be good confirmation of this to make sure
0 == STANDARD, 1 == EXTENDED
I've having trouble getting CAN-messages through the mailboxes that I try to filter out messages with.
Maybe you could clarify in the README.md more about how the thoughts are on filters and mailboxes.
When I set up the code with this settings then will I only get msg 256 on CAN1 and nothing on CAN2 or CAN3:
When I change the seup to this do I get all the messages: