Comments (4)
Hi, it probably is possible, but I don't own any other cars so I'm not able to do this myself.
from cdcemu.
Ok, I have Peugeot 206 so if you want to add this functionality I can check and debug your software :) Additionally, I found the VAN description on http://pinterpeti.hu/psavanbus/PSA-VAN.html
from cdcemu.
To support the VAN bus an additional IC is required (TSS463) you can see a few sample schematics in my repo: https://github.com/morcibacsi/arduino_tss463_van
To emulate a CDC on the VAN bus, alI you need is a few lines of code. Here is an Arduino sample code, which uses my TSS463 library (not the latest version, but I am happy to help converting it to the up to date version if needed):
#include "VanMessageSender.h"
const int VAN_PIN = 7;
AbstractVanMessageSender *VANInterface;
unsigned long currentTime = millis();
unsigned long previousCdcTime = millis();
volatile uint8_t seconds = 0;
volatile uint8_t headerByte = 0x80;
void IncrementHeader()
{
if (headerByte == 0x87)
{
headerByte = 0x80;
}
else
{
headerByte++;
}
}
void IncrementSeconds()
{
seconds++;
if (seconds == 60)
{
seconds = 0;
}
}
uint8_t DecToBcd(uint8_t input)
{
return( (input/10*16) + (input%10) );
}
void AnswerToCDC()
{
uint8_t status = 0xC3; //playing
uint8_t cartridge = 0x16;
uint8_t minutes = 0x01;
uint8_t trackNo = 0x17;
uint8_t cdNo = 0x02;
uint8_t trackCount = 0x21;
uint8_t packet[12] = { headerByte, 0x00, status, cartridge, minutes, DecToBcd(seconds), trackNo, cdNo, trackCount, 0x3f, 0x01, headerByte };
VANInterface->set_channel_for_immediate_reply_message(0, 0x4EC, packet, 12);
}
void setup(){
VANInterface = new VanMessageSender(VAN_PIN);
VANInterface->begin();
}
void loop() {
currentTime = millis();
if (currentTime - previousCdcTime >= 1000)
{
previousCdcTime = currentTime;
IncrementSeconds();
IncrementHeader();
AnswerToCDC();
}
}
from cdcemu.
I see, thanks for the answer. This is obviously possible, but would require a major code refactor, as well as a notable hardware change. CDCEmu depends highly on the CDC commands sent by the radio/display, so that would need to be implemented as well.
I'm planning to build a new version anyway, based on ESP32 with built-in Bluetooth, better quality, etc, and single-boarded. Thus, the code would need to be rewritten as well. I'm planning to do a more universal and abstracted architecture of "sources" (Bluetooth, AUX, etc) and the output protocols (CAN RD4, VAN for example, and since I have a 2006 Golf as well it could help to emulate CDC there).
To be honest, I do not have any ETA for that. There's just too much work around other projects, college and stuff. For now CDCEmu "works" so it's sadly pushed to a lower priority. I hope you can understand that.
from cdcemu.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdcemu.