Hello All,
I'm looking for guidance on a project I'm designing. The goal is to monitor, and log the traffic on multiple networks in my car, as well as some analog sensors. I started building this with a RaspberryPi, and some golang code since I am *much* more comfortable with userland computer software programming (https://github.com/rgeyer/go-ssm2logger), but I realized it's likely going to be much better to do this with a more embedded solution.
At the moment, these are the things I'd like to log.
I intend to wrap this data in my own data frames which will include a timestamp, the type of packet, then the content. This will ideally be streamed to an SD card for logging, as well as being output over USB serial so that I can connect a laptop to see and analyze the data in real-time.
I have selected the Teensy 3.6 for the following reasons
I have a couple of questions.
CAN Question:
First, since I need a 3rd CAN connection, I see three different options.
1: Use the two embedded CAN, with appropriate transceivers, and add a third CAN using something like the MCP2515 over SPI
2: Do not use the embedded CAN at all, and do all CAN over SPI using MCP2515 (or similar?)
3: Assign two more digital pins as CAN2 TX and RX, and go spelunking in the Teensyduino code, and FlexCAN to support my franken-configuration
Ideally, I'd love to do #3, but I'm not sure it is even possible?
If it is not, any advice on which of the other two approaches to use in order to address all three of the CAN networks I'm attempting to monitor?
Speed:
I (probably naively) thought that since I was dealing with less than 1Mb/s of throughput (500kbps + 125kbps + 125kbps + 4600bps) that I would have no problem writing that data to an SD card, and spewing it out the USB serial, all with cycles to spare for processing, and accepting input/interrupt commands via USB serial. Afterall, writing to an SD card is usually measured in multiples of 100MB/s, and I have 12Mb/s through USB serial.
But, in reading this thread (https://forum.pjrc.com/threads/55114-SD-Datalogging-Best-Practice-in-2019) I'm beginning to get concerned that maybe I'm not thinking through this correctly?
I'm sure I'm leaving things out, and I'm still quite new to Arduino, but I'm a fairly accomplished software engineer, and happy to take advice, learn, and do the work. Please feel free to ask me questions about what I may have left out.
Thanks in advance for your guidance!
I'm looking for guidance on a project I'm designing. The goal is to monitor, and log the traffic on multiple networks in my car, as well as some analog sensors. I started building this with a RaspberryPi, and some golang code since I am *much* more comfortable with userland computer software programming (https://github.com/rgeyer/go-ssm2logger), but I realized it's likely going to be much better to do this with a more embedded solution.
At the moment, these are the things I'd like to log.
- CAN0 - 500kbps Engine/Driving
- CAN1 - 125kbps Body
- CAN2 - 125kbps Entertainment
- Subaru Select Monitor (SSM) - 4600bps UART
- Fuel Pressure - Analog sensor
I intend to wrap this data in my own data frames which will include a timestamp, the type of packet, then the content. This will ideally be streamed to an SD card for logging, as well as being output over USB serial so that I can connect a laptop to see and analyze the data in real-time.
I have selected the Teensy 3.6 for the following reasons
- Fast USB Serial (12 Mb/s)
- Dual embedded CAN (Still need a 3rd)
- Embedded SD Card
I have a couple of questions.
CAN Question:
First, since I need a 3rd CAN connection, I see three different options.
1: Use the two embedded CAN, with appropriate transceivers, and add a third CAN using something like the MCP2515 over SPI
2: Do not use the embedded CAN at all, and do all CAN over SPI using MCP2515 (or similar?)
3: Assign two more digital pins as CAN2 TX and RX, and go spelunking in the Teensyduino code, and FlexCAN to support my franken-configuration
Ideally, I'd love to do #3, but I'm not sure it is even possible?
If it is not, any advice on which of the other two approaches to use in order to address all three of the CAN networks I'm attempting to monitor?
Speed:
I (probably naively) thought that since I was dealing with less than 1Mb/s of throughput (500kbps + 125kbps + 125kbps + 4600bps) that I would have no problem writing that data to an SD card, and spewing it out the USB serial, all with cycles to spare for processing, and accepting input/interrupt commands via USB serial. Afterall, writing to an SD card is usually measured in multiples of 100MB/s, and I have 12Mb/s through USB serial.
But, in reading this thread (https://forum.pjrc.com/threads/55114-SD-Datalogging-Best-Practice-in-2019) I'm beginning to get concerned that maybe I'm not thinking through this correctly?
I'm sure I'm leaving things out, and I'm still quite new to Arduino, but I'm a fairly accomplished software engineer, and happy to take advice, learn, and do the work. Please feel free to ask me questions about what I may have left out.
Thanks in advance for your guidance!