0

I am attempting to create a program that can read DTC codes from CAN-Bus devices connected to a Raspberry Pi via a USB to Serial connection. I am testing with a NeoVi Fire that I have hooked up, and currently I am able to send and read serial signals to the device to control car seat heating and cooling units I have attached to it via said serial port.

Now I need to expand what I have into requesting codes from the CAN unit so I am seeing if Python-CAN can do what I need it to (since the rest of my program is all written in Python).

I also went and installed the PyNeoVi library since I am using the NeoVi unit, and I am running into a problem while attempting to use one of the test files with the PyNeoVi repository. This is the code for the test file:

import neovi.neodevice as neodevice
import neovi.ecu as ecu
import neovi.spec as spec
import neovi.neovi as neovi
import json


neodevice.init_api()
dev = neodevice.find_devices(neovi.NEODEVICE_FIRE)[0]
dev.open()


input_file = open('vehicle.spec', 'rt')
data = json.load(input_file, object_hook = spec.from_json)

hvac = ecu.ECU(data['ECUs']['HVAC'], dev)

wanted_values = ['Blower Speed Output', 'External Ambient Temperature', 'Left Solar Radiation Sensor', 'Cabin Temperature']

for value_name in wanted_values:
    result = hvac.read_data_by_id(value_name)['value']
    print("%s = %.1f %s" % (value_name, result[0], result[1]))

dev.close()

The error I am getting is:

OSError: libicsneoAPI.so.0.1.3: cannot open shared object file: No such file or directory

It sounds like I am missing a dependency, but I am not sure where do download said dependency from.

EDIT: Going off of the API page for Python-Can, under the NeoVi Interface section it mentions the following:

This interface is not supported on Linux, however on Linux neoVI devices are supported via Socketcan with ICS Kernel-mode SocketCAN module for Intrepid devices and icsscand

As such I have been attempting to implement the ICS Kernel-mode SocketCAN module, as well as icsscand. My problem with that at the moment is with the kernel-mode SocketCAN module.

$ git clone https://github.com/intrepidcs/intrepid-socketcan-kernel-module
$ cd intrepid/socketcan-kernel-module
$ make

I am getting an error on the $ make command which reads:

make -C /lib/modules/4.9.35-v7+/build M=/home/pi/intrepid-socketcan-kernel-module modules
make[1]: *** /lib/modules/4.9.35-v7+/build: No such file or directory. Stop.
Makefile:4 recipe for target 'all' failed
make: *** [all] Error 2

I am not sure if I should just make the directory it is looking for, or if it not being there is a problem I shouldn't have in the first place.

  • Thanks. I'm able to run the sudo apt-get line with no problems, but where exactly would it be installing to since I'd still need to find the folder to run the make command – Skitzafreak Jul 14 '17 at 14:39
  • You also shouldn't be cross posting stackoverflow.com/questions/45104254/… – Steve Robillard Jul 14 '17 at 15:05
  • Once again you are changing path faster than people can even answer your question. This is not an edit it is an entirely new direction. Ask yourself this how would you feel if a co-worker asked you a question which you then answered, then he came back and said how do I do the exact same thing but with this code. Perhaps your boss should just hire me. – Steve Robillard Jul 14 '17 at 15:17
  • Sorry. I thought in this instance I was working on the same issue, not completely changing directions. – Skitzafreak Jul 14 '17 at 15:20
  • Don't you think that changing library warrants a new question? Not to mention that after researching an answer for you, you pull the rug out and discover that their is no Linux support. I am done answering your questions. – Steve Robillard Jul 14 '17 at 15:22
0

Start by installing the dependencies:

sudo apt-get install libftdi1 libftdi-dev

Next download the required package with the following command:

git clone https://github.com/intrepidcs/icsneoapi.git

Change to the new directory:

cd icsneoapi/

Then build the package:

make

Finally, copy the library and headers to the /usr/lib folder:

sudo cp libicsneoapi.so /usr/lib/
sudo mkdir /usr/include/ics
sudo cp src/icsnVC40.h /usr/include/ics/
sudo cp src/icsneo40API.h /usr/include/ics/

I believe the paths above are correct for the Pi, but they may take a little tweaking.

  • Thanks. I am still getting the error, so I'll see if I need to change any of the file paths and let you know what does or doesn't work. Appreciate the assistance. – Skitzafreak Jul 14 '17 at 14:52
  • Try this sudo cp libicsneoapi.so /usr/lib//arm-linux-gnueabihf/ – Steve Robillard Jul 14 '17 at 15:00
  • That didn't work either. I just made an edit to the OP about some other things i have been trying and hitting errors with. – Skitzafreak Jul 14 '17 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.