Hello, magicians.
Hate to disturb people with dumb questions, But I am struggling with setting up mask and filter for ID on canbus. I have read alot of topics on this matter and it was easy with different library, but... never easy quest .. library I used before was conflicting with another that I need for the project... My hair went grey with trying to establish whats going on.
Now I am using this library:
mcp2515.h
And I need to filter by ID - 418.
I will need other IDs at a later stage, but help with setting first one up will be sufficient for me to continue on my quest and hopefully grasp the logic of writing this filter/mask.
So whoever reached this fat here is a backstory of the idea:
Soon I am going to be doing an engine and gearbox swap into much older vehicle that is very analogue. I would like to keep as much as possible from original setup so inside should be as stock as possible. It doesn't have separate indicator on dash for Gear selector position, but does have a little rectangular warning icon right in the middle that is spot on for small OLED 128x64 0.96"display. So I want to show selector position on there plus current gear ( will be 7 speed auto gearbox). I have vehicle with same box and I found IDs and bytes that are changing.
With first library that I tried mcp_can.h everything separately works great, very easy to setup mask and filter, but if I start OLED before I start mcp2515 - CAN starts dumping zeroes over serial monitor or will show CAN data, but will "'self generate" last signal when can is switched off. If I enable CAN first and then OLED ( I2C by the way) , it will fail to allocate OLED.
Anyway I have programmed separate Nano + MCP2515 to send every 2 seconds data over can ID 418, every time changing bytes responsible for current gear and it works 100% as a bench guineapig. Even more so I have managed with current library to get OLED to display correct gear, but due to too much data over CAN on vehicle it starts misbehaving on the spot when hooked up to car without Mask and filter.
Can somebody with more knowledge help me with setting up the mask and filter on this library. Bare in mine I am complete noob in this field and all accomplished is based on days of research and alot of "exotic" words in few languages that I can speak.
Future development ideally will include few additional stages, at which point I am sure nano will not cut it.
Desirable addons:
Get vehicle speed from CAN ( oh yes it will have way more modern ABS) and convert it to analogue to be able to drive original speedo (its electronic, but analogue),
Maybe RPM,
Maybe coolant temp,
deffo MIL for engine, transmission and ABS ( plus flashy light for traction control).
Stay tuned as will most definitely encounter problems and few thousand heads here are way better than one that is new to this.