Can you share what CAN-bus messages worked for you by pasting them here? I can then incorporate them back to my project.
Itās actually the exact same CAN-bus messages incorporated into your project. Iām just using a MCP2515 with a Mega2560 Pro Board. This combined with a 120ohm resistor and a dual channel relay to bridge the can for the 2020+ APIM/Displays. Iām by no means good at coding so I used GPT along with bits of your code to come up with my own. Here are the two revisions of code for my Arduino project if that helps any.
Revision 1: Worked on any APIM <2019 and worked on APIMās 2020+ only after adding a specific Asbuilt configurationā¦Donāt recall any brightness issues.
Revision 2: Tested and works on any APIM 2016+(Havenāt tested Sync 4 APIMs, or Sync 2 APIMS) with any asbuilt configurationā¦ Has brightness issues on sync 3.4(Dim display)
So same CAN messages. Then what is different? Your code looks like a copy of mine except modified to work against āmcp_can.hā instead of the excan library.
Also what is this dual channel relay thing? Where does that go in the circuit?
Exactly. Iām not one for coding at all so its practically yours with a bit of GPT mixed in LOL. The āDual Channel Relayā is a HK19F-8P-12V connected to a 12v switch this just bridges HSCAN and ICAN to get FORscan functionality. Although switching the relay makes no difference in actually powering on the display. I will also note that I changed āuint8_t txDataLen = 8ā to ā11ā and for whatever reason this worked to properly turn it on. Again Iām not good at coding what so ever and kind of just tinkered with things until I got it working.
Interesting, I think that could be something. How did you arrive at 11 vs 8?
I honestly do not recall how I got 11. I went through my GPT conversation and I just stated that the value 11 worked over 8.
I believe I originally attempted to use ā12ā or some other value, I even recall at some point it being ā29ā all of these values worked to some degree but 11 just happened to turn the display on. It was kind of a educated guessing game of just putting numbers in.
Weird, but cool I will have to try it and see if it makes a difference, except I donāt have a newer APIM or screen. Probably time to get a new ride.
Well thatās just nuts.
Iām working on a long-shot project and trying (and failing) to bench-test one of the newer IPMAs. The gateway module keeps going to sleep, so I wanted to try hooking up my old Sync APIM to keep it awake.
Well, the APIM keeps going to sleep too, so came across this project.
I was honestly surprised to see a link to my own findings on Explorer Forums in the source code, and my pastebin in this thread Really glad to see someone else was able to make use of it!
That is awesome, thanks for providing that info in your original post. That was helpful.
I changed the can_message array length and txDataLen variable values from 8 to 11 and tested it on STM32 and Arduino Nano based CAN bus emulators, but the modified code failed to display anything on SYNC 3 screen when I connected the 54 pin connector to APIMs manufactured in 2019 and 2020. After these failed attempts, I decided to check the APIM AS-Built data and connected the OBD2 adapter to the CAN bus emulator OBD2 port. Then using FORScan changed the 7D0-08-01 - 7D0-09-03 settings to all zeros and that change fixed the issue. Next, I changed one value at a time and found out that Message Set (MS) setting in the 7D0-08-01 was causing the problem.
7D0-08-01 xxx* xxxx xx
0, 1, 2, 3, 8, 9, A, B ā These values work fine and set the Message Set(MS) to Legacy from New.
4, 5, 6, 7, C, D, E, F ā Change these values to 0, if you are using the STM32 or Arduino based emulators.
Hello and sorry for my question. I did the Linux revive to my unit and understood how to get that going after trial and error. However this is way outside my expertise. Does anyone have a step by step? I downloaded VSCode, PlatformIO inside VSCode, Arduino Framework and exothink/eXoCAN in a Zip. I also downloaded stm_can_sim in a zip and opened both. When I opened stm_can_zip platformio.ini it downloaded some stuff. I use to make c++ files back then (1998) but I am not seeing a compile option. Its been a while since I have coded anything so I am sorry but I need some help. I also was unable to get the STM32 to show up under devices in VSCode. Thanks if someone can help
Just wanted to say thanks to OP for this project. Some items I ran into:
- I did not want to invest time in the bluepill environment since I already have a ton of Arduino experience. So I used the version 2 code that @andrewvv32 posted above along with the Arduino canbus library by Cory Fowler. Only change was since I had an Uno and not a Mega, I made SPI_CS_PIN = 10
- Like andrew, using a data length of 8 did not work but 11 did. As mentioned by others this may be due to the APIM. This was an upgrade for my sonās 2013 Escape and the donor APIM was manufactured 12/2018 for a 2019 Explorer. So I guess it is considered a MY2019 APIM.
- I used a Sparkfun CANBUS shield I had leftover from a previous project. It did not have a 120 ohm resistor between CANH and CANL (APIM 19 and 20). Once I added that, everything worked. The TJA1050 board OP uses does have the resistor.
- Similarly, the OBD2 interface did not work initially. I wired it per the wiring diagram. I then added a 120 ohm resistor between APIM 53 and 54 and then that started working. No need to bridge anything. I used an OBDLink EX cable for FORScan.
- USB hub worked fine once I fashioned a USB mini to mini cable.
Still donāt understand the need for data length 11. I did a CANBUS project for my 2011 F-150 and never had an issue with length 8 (which is the length of the message). Weird. Glad Andrew figured it out.
I saw your other post on getting the simulator to work with Sync 2. I built one that worked great with the Sync 3 APIM but am unable to get it to work with the Sync 2 APIM I removed. It was working when pulled from a 2013 Escape (which now has the Sync 3).
Specifically what APIM pins did you use and what bus speed? I have tried pins 19/20 at 500kbps (works for Sync 3) and also pins 16/17 at both 500 and 125. But I canāt get it to wake up. Iām sending the code that both you and OP used (048 - 00 00 00 00 07 00 E0 00).
If I was to guess, it is probably the CAN messages, in the app that have to change. Maybe enable / disable some and try again. I donāt recall any other differences. I am not sure why you want to get a sync2 working though, itās kind outdated e-waste now.
Thanks, Iāll keep trying. The 4 CAN messages in your program worked great for my Sync3 APIM. Just trying to confirm that I use the same APIM pins (19 and 20) and 500 kbps bus speed for Sync2.
And yes, I thought the old module was useless but they are still selling for $50-150 on eBay (module and screen). But before I sell I want to do a master reset and delete personal info. I didnāt think to do that before I removed it and have already installed the Sync 3 unit.
Thanks again for sharing your work with the community.
EDIT: working now with your original messages and APIM schematic (pins 19, 20; 500kbps). I must have had a bad connection.
Can you still change AS-Built data even when APIM is not turned on?
No.
The board/IC has to have power in some way shape or form.
Its a bit like trying to change a text file on a USB drive, has to be powered to access the storage.