Intrepid Tools at the Junction Tokyo Hackathon

Our Tools at Junction Tokyo
What we are offering to You
Vehicle Spy Pro with CCodeInterface
neoVI Fire Adaptor
neoECU CAN Bus Simulator
CC3100 SimpleLink + Emulation Boosterpack Bundle

Quick Start Guides
Install Vehicle Spy
Setting Up Hardware

Technical Manual
Vehicle Spy &
neoVI Fire Basic
CCodeInterface Guide

Download and Sample Projects
1. Sample Visual Studio CCode Interface Project – Adding CC3100
SimpleLink Support

2. Sample Visual Studio CCode
Interface Project – TCP Client sending
CAN data to TCP Server using CC3100

Contact Us
Email
Skype

What we are Offering to You

Intrepid Control Systems is a global provider of innovative tools for engineers in the vehicle networking, testing, and embedded engineering fields.

At Junction Tokyo, we are providing the following set of tools that will allow you to build applications that can communicate with electronic units inside your car over CAN network. We also offer the ability for you to take your application wireless by interfacing to Texas Instrument’s CC3100 Boosterpack from your application.

  • Vehicle Spy Pro Software with CCodeInterface Visual Studio Development Environment
  • neoVI FIRE (CAN / LIN Vehicle Network Adapter)
  • neoECU CAN Bus Simulator
  • CC3100 SimpleLink + Emulation Boosterpack Bundle

Some possible project ideas using the provided tools are:

  • Design and implement your own Cybersecurity for CAN bus to protect your vehicle from getting hacked
  • Hack your vehicle by remotely injecting arbitrary CAN messages into your vehicle’s CAN bus
  • A smartphone app that captures / displays real time drive data via WiFi Direct connection (P2P) with CC3100
  • A smartphone app that sends email or text message when you are driving above speed limit
Intrepid Tools at MHacks
Intrepid Tools at MHacks

Vehicle Spy Pro with CCodeInterface

Build your Automotive IoT Application Today!

Vehicle Spy Pro is a Vehicle Network tool from Intrepid Control Systems that enables you to monitor vehicle network bus, perform diagnostics, node/ECU simulation, data acquisition, automated testing, memory edit/calibration, and more.

Vehicle Spy Pro provides a way to write C code in Visual Studio that interacts with the automotive communication protocols Vehicle Spy works with such as CAN and LIN. The main advantage of using C Code Interface is that your code can access all the features of Vehicle Spy. Some examples of features you can access are vehicle network message decoding, message reception, database decoding, and display of signals. When you create a C Code Interface project, Vehicle Spy automatically generates a Visual Studio project that contains all the necessary source and include files for you to access such features.

Intrepid Control Systems provides ways for hackers to take their C Code Interface project wireless with popular IoT solution from Texas Instruments, the SimpleLink™ WiFi® CC3100 Boosterpack + Advanced Emulation Boosterpack bundle. The bundle allows developers to write code to emulate CC3100 MCU from PC via TI’s SimpleLink™ Studio library. Intrepid has made slight adjustments to the SimpleLink™ Studio library so that it builds seamlessly in the existing C Code Interface project environment (Visual Studio).

C Code Interface with SimpleLink™ Studio opens possibilities for developers to bridge WiFi® and automotive networks. This means you could write an application to receive some data from your vehicle network such as rpm and speed which then can be sent to a smartphone app wirelessly over WiFi Direct connection, local network, or internet. Some possible project ideas are:

neoVI FIRE Adaptor

neoVI FIRE is a multi-channel vehicle network adaptor that provides up to 6 channels of CAN and 4 channels of LIN. neoVI FIRE is fully compatible with our Vehicle Spy software. Users can use Vehicle Spy Pro to monitor and transmit on all networks simultaneously.

CC3100 SimpleLink + Emulation Boosterpack

This CC3100 boosterpack bundle from Texas Instrument consists of:

  • CC31XXEMUBOOST-Advanced Emulation BoosterPack for SimpleLink Wi-Fi CC3100 BoosterPack plug-in module
  • CC3100BOOST-SimpleLink Wi-Fi CC3100 wireless network processor BoosterPack plug-in module

The C Code Interface feature in Vehicle Spy Pro provides a way to write C code in Visual Studio to create your custom application that interacts with Vehicle Spy. Using the bundle, you will be able to extend your C Code Interface project to interface with the CC3100 wireless network processor. This allows you to write an application that leverages all the features of both Vehicle Spy and CC3100. The result is an automotive IoT application that connects your vehicle to the internet.

For more info about the CC3100 bundle, please visit https://store.ti.com/cc3100boost-cc31xxemuboost.aspx.

Install Vehicle Spy Software

  1. Click here to install Vehicle Spy software 
  2. Then run the vspy3_install.exe file you downloaded.
  3. Click on Vehicle Spy 3 and follow the on-screen instructions. This will take a few minutes, since there are several drivers installed with the software.
  4. With the install done, click on Exit for the first screen.
  5. Double click on the red Vehicle Spy 3 Icon to start Vehicle Spy.

Vehicle Spy License

The password on the zip file is… vspy3r701-SWDV

 

Hardware setup 

setup

Quick Guide to Integrating SimpleLinkStudio into C Code Interface

Create a C Code Interface project in Vehicle Spy

To add a new project, click on the “Add Project…” button (Figure 1), and a drop down will appear giving the options to add a new project, convert from CAPL, or add an existing project.

MHacks adding new c code

Figure 1: Adding a new C Code project in the C Code Interface view.

If a new project is selected, a windows will pop up called “Add New C Code Project”. Here a project name and a description is entered in. Vehicle Spy will then create a new base project and launch Visual Studio. Next the “Edit” button can be used to create events or the project can be worked with in Visual Studio. Make sure you build the DLL once before starting Vehicle Spy, otherwise, you will not have anything for Vehicle Spy to load – this will result in an error.

name project

Figure 2: You need a project name and description to create a new project.

 

Add SimpleLink™ Studio to the generated C Code Interface project

First, download the SimpleLink Studio archive from https://github.com/jchung-intrepid/CCIF_SIMPLELINK_BASE.git. Copy the entire ‘simplelink’ folder and paste it into the project directory. You can open the project directory from Visual Studio by right clicking on the project and selecting ‘Open Folder in File Explorer’.

download simplink
Figure 1: Copy the downloaded simplink directory into the CCIF project directory.

In Visual Studio, right click on the project and use Add -> New Filter to add a ‘simplelink’ directory with three sub directories named ‘include’, ‘common’, and ‘source’. Then, drag and drop all contents of each directory from your project directory.

add filters
Figure 2: Add filters using Add -> New Filter.

add file
Figure 3: Add files in include, source, common directories to the project.

In Visual Studio, make the following changes to the project properties:

  1. Go to Configuration Properties -> C/C++ -> Additional Include Directories. Add $(SolutionDir)\simplelink\, $(SolutionDir)\simplelink\include, $(SolutionDir)\simplelink\source, and $(SolutionDir)\simplelink\common. add simplelinkFigure 4: Add simplink include paths to the project.
  2. Goto Configuration Properties -> Linker -> Input -> Additional Dependencies. Add Add $(SolutionDir)\simplelink\SimpleLinkStudio.lib.add simpFigure 5: Add simplink library path to the project.
  3. Goto Configuration Properties -> C/C++ -> Code Generation -> Runtime Library. Set to ‘Multi-threaded DLL (/MD)’.ruFigure 6: Set Runtime Library to link dynamically during build.
  4. Goto Configuration Properties -> C/C++ -> Precompiled Headers. Set to ‘Not using precompiled header’.CCIFFigure 7: Change Precompiled Header to ‘Not Using Precompiled Headers’.
  5. Include “simplelink.h” in SpyCCode.c. Then, copy and paste the following function stubs in SpyCCode.c. These are asynchronous callback functions used by SimpleLinkStudio™ to notify various network events and need to be defined somewhere in your program.

 

 

/*!
\brief This function handles WLAN events

\param[in] pWlanEvent is the event passed to the handler
\return None
\note
\warning
*/

void __cdecl SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{
}

/*!
\brief This function handles events for IP address acquisition via DHCP
indication
\param[in] pNetAppEvent is the event passed to the handler
\return None
\note
\warning
*/

void __cdecl SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
{
}

/*!
\brief This function handles callback for the HTTP server events
\param[in] pHttpEvent – Contains the relevant event information
\param[in] pHttpResponse – Should be filled by the user with the
relevant response information
\return None
\note
\warning
*/

void __cdecl SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pHttpEvent,
SlHttpServerResponse_t *pHttpResponse)
{
}

/*!
\brief This function handles general error events indication
\param[in] pDevEvent is the event passed to the handler
\return None
*/

void __cdecl SimpleLinkGeneralEventHandler(SlDeviceEvent_t *pDevEvent)
{
}

/*!
\brief This function handles socket events indication
\param[in] pSock is the event passed to the handler
\return None
*/

void __cdecl SimpleLinkSockEventHandler(SlSockEvent_t *pSock)
{
}

 

Build the C Code Interface project

If you have completed step 2, your C Code Interface project should compile successfully. You are now ready to add your code in SpyCCode.c or add additional source and header files as needed to build your desired application.

Extend SpyCCode
Figure 1: Extend SpyCCode.C and create more source files as needed to implement your application.

 

Run the built C Code Interface DLL with Vehicle Spy

When you build your C Code Interface project in Visual Studio, the result is a DLL that plugs into Vehicle Spy. The DLL exports a set of standard functions, which Vehicle Spy calls to make everything work. When you start Vehicle Spy, it will dynamically load the DLL and execute your C Code Interface project.

To do this, go back to Vehicle Spy where you created your C Code Interface Project. Click on the play button located on the top left corner of the window and Vehicle Spy will start. If you have already completed our hardware setup guide, Vehicle Spy will connect to neoVI FIRE and gain access to the vehicle network that neoVI FIRE is connected to. After Vehicle Spy starts, you will notice that the Output console will start printing ‘Another Second happened’ as defined in the Spy_Main().

output
Figure 1: Output console window showing Printf message from Spy_Main().

 

Downloads

SimpleLink™ Studio Archive – Contains changes from Intrepid Control System to build seamlessly in C Code Interface project environment.

Base VS Project for C Code Interface + SimpleLink Studio – This is a clean archive of Visual Studio project containing all the default C Code Interface and SimpleLink™ Studio source and library files. Use this as a base to quickly start developing your application for Vehicle Spy and CC3100. Start coding your application by extending SpyCCode.c.

Sample Project: TCP Client that sends CAN Messages to TCP Server

sample pro

This sample application demonstrates how programmers can use Event Handlers in C Code Interface to receive various data from Vehicle Spy such as CAN messages and application signals. This DLL application will open a TCP socket connection to a remote TCP server and send the CAN data from Vehicle Spy to the server.

To learn more about Event Handlers, checkout the ‘Message Objects’, Application Signals’, and ‘Timers’ help doc in Vehicle Spy.

Files and Equipments Needed

Hardware

  1. neoVI FIRE – CAN network interface. Connects to vehicle network bus via 25pin connector. Connects to Vehicle Spy PC software via USB.
  2.  neoECU Simulator – Vehicle CAN network simulator. Each of the Knobs 1 ~ 4 are mapped to unique CAN message.
  3.  SimpleLink WiFi® CC3100 Boosterpack + Advanced Emulation Boosterpack bundle.

Software

  1. Vehicle Spy Pro
  2. Visual Studio 2015, 2013, 2010, or 2008.

 

Downloads

  1. CCIF_SimpleLink_TCP.vs3 – A Vehicle Spy 3 save file that loads and executes the user code in CCIF DLL. It contains decoding information of four CAN messages, which are handled by the four Rx Message Event Handlers. When Vehicle Spy receives any one of those messages, it will forward them to CCIF by invoking the matching Event Handler callback.
  2. CCIF_SimpleLink_TCP Archive – This archive contains all the C Code Interface source files for this sample application.

 

Application Sequence

This sample C Code Interface application does the following:

  1. Initializes the CC3100 board to a default state and connect to a WiFi AP of your choice. The application will retry every 1 second until connection is made.
  2. Attempts to open a TCP connection to a TCP server listening at port 5001. The application will retry every 1 second until connection is made.
  3. Data from the server will be received by the BsdTcpClientReceiveProcess function. For the sake of demonstration, the function will simply echo the received data back to the server.
  4. Anytime Vehicle Spy receives a CAN message that matches one of the four messages defined in the Receive Table of the Messages Editor, CCIF_SimpleLink_TCP.vs3 will invoke the matching Event Handler callback function defined in the C Code Interface DLL. When Vehicle Spy invokes the callback function, it will pass the pointer to the CAN Message object to the DLL. message editiorFigure 1: Messages Editor window showing the four CAN Receive Messages. c interfaceFigure 2: C Code Interface ‘Edit’ window showing Event Handlers for the four Receive Messages
  5. The Event Handler callback receives the CAN Message from Vehicle Spy and sends the 8 byte content of the message to the connected server via socket.receive message Figure 3: Receive Message Event Handlers defined in the C Code Interface project.

 

 

 

Running the Sample Application

Before you proceed, please make sure that you have all the hardware, software, and download contents from the step 1.

  1. Open the C Code Interface DLL project in Visual Studio and set the WiFi AP connect credentials and TCP Server IP address.open cFigure 1: Define parameters needed to connect to an AP such as SSID and Passkey in sl_common.h.
  2. Double click the downloaded ‘CCIF_Simple_TCP.vs3’ file to start Vehicle Spy. Press the ‘Edit’ button from C Code Interface window and set the project path to the Visual Studio project file located in the downloaded CCIF_SimpleLink_TCP archive.edit windowFigure 2: CCodeInterface ‘Edit’ window – change project path to the directory in your PC where .vcxproj is located.
  3. CAN messages originate from physical CAN networks in your vehicle. Hence, we must first connect a CAN network adaptor to the vehicle’s CAN bus. Do this by taking the 25pin – OBDII cable and connecting your neoVI FIRE to the 25pin connector of the cable and the OBDII connector to your car’s OBDII port. For those who do not have access to an actual vehicle, Intrepid is providing a CAN bus simulator which generates fixed set of CAN messages to mimic a CAN bus. This simulator, called neoECU Simulator has an OBDII port which conveniently plugs into the OBDII connector on the 25pin – OBDII cable. Finally, supply power to the neoECU Simulator by connecting the provided power pack to the 12V barrel jack connector. This will power both neoECU Simulator and neoVI FIRE.setupFigure 3: neoVI FIRE and neoECU Simulator connected via 25pin – OBDII cable.
  4. Now that we have a CAN adaptor (neoVI FIRE) connected to your vehicle or the neoECU Simulator, we need to connect the neoVI FIRE to the PC so that it can forward all received CAN messages to the Vehicle Spy software. Do this by simply connecting the USB cable between neoVI FIRE and your PC.
  5. At this point all Intrepid hardware and software should have been configured. Finally, connect the CC3100 Boosterpack + Advanced Emulation boosterpack board to your PC using the provided micro USB cable. powerFigure 4: Connecting CC3100 from http://processors.wiki.ti.com/index.php/CC31xx_Quick_Start_Guide.
  6. Make sure CC3100 board is properly connected to your PC. Open Vehicle Spy. When you start Vehicle Spy, it should have full read & write access to the connected CAN bus via the neoVI FIRE adaptor. Start Vehicle Spy by pressing the play button on the top left corner of the window. You should see a real-time trace of all CAN messages generated by your vehicle or the neoECU Simulator from Vehicle Spy’s Messages view.message windowFigure 5: Messages window showing real-time CAN traffic and CCodeInterface window showing output from DLL.
  7. Identify the four CAN messages that contain data that represents the first four knobs on the neoECU Simulator. Vehicle Spy will send those messages to the C Code Interface DLL, which will then forward them to a remote TCP server via connected socket.four canFigure 6: Messages window showing the four CAN Messages mapped to neoECU Simulator Knobs.
  8. Verify that Vehicle Spy has successfully loaded the C Code Interface DLL by observing the ‘Output’ tab of the C Code Interface window.CCodeInterfaceFigure 7: CCodeInterface Output console showing CC3100 connection status.
  9. Setup a remote TCP Server on your Smartphone, MAC, or PC with proper IP address and port number. If you are using an Android phone, convenient way to do this is to download the TCP/UDP TEST TOOL app by animod from Google Play and use the app to setup a TCP Server.TCP severFigure 8: A sample TCP Server application used for testing.
  10. Click button from Graphical Panel to instruct C Code Interface DLL to start forwarding CAN data to the connected TCP Server. Data sent by the TCP Server can be viewed in Vehicle Spy by observing the ‘Output’ tab of the C Code Interface window.Send canFigure 9: Click the ‘Send CAN Data to TCP Server’ button from Graphical Panel window to instruct CCodeInterface to send data to the connected TCP Server. There is also a Red/Green LED indicating the socket connection status.

Figure 10: Android app showing CAN data sent by CCodeInterface using socket connection made by CC3100.

TCP server

Downloads

CCIF_SimpleLink_TCP.vs3 – A Vehicle Spy 3 save file that loads and executes the user code in CCIF DLL. It contains decoding information of four CAN messages, which are handled by the four Rx Message Event Handlers. When Vehicle Spy receives any one of those messages, it will forward them to CCIF by invoking the matching Event Handler callback.

Base VS Project for C Code Interface + SimpleLink Studio – This is a complete archive that contains all the C Code Interface source files for this sample application. Use CCIF_SimpleLink_TCP.vs3 to load and execute this DLL project.

 

JapanKoreaChinaUSA