Chardev or Netdev driver compilation?
Posted: Tue 15. Mar 2016, 15:42
Hi,
I am new to using PEAK CANBUSB Pro. I have successfully installed the device drivers under Ubuntu (14.04)
I would like to develop in Python read and write CAN messages .. I currently have built the device drivers with the option : make NET=NO .. so I have Chardev device drivers installed. I can successfully run the receive and transmit test so i know my device is running ok. I want to use Python to transmit on CAN Bus1 .. In CharDev drivers when I type cat /proc/pcan i get two interfaces no.s 32,33.
i have my code as follows: I don't know how to list the two CAN interfaces I have.. do I even need to install the NEtDev version of the driver in order to use with Python? So that I can have Netdev interfaces CAN1 and CAN2?
import sys
sys.path.append('''/home/rdm/peak-linux-driver-7.15.2/jdk1.8.0_73''')
#sys.path.append('''/home/rdm/peak''')
import PCANBasic
channel = PCAN_USBBUS1
baud = PCAN_BAUD_500K
# The Plug & Play Channel (PCAN-USB) is initialized
#
objPCAN = PCANBasic()
result = objPCAN.Initialize(channel, baud)
if result != PCAN_ERROR_OK:
# An error occured, get a text describing the error and show it
#
result = objPCAN.GetErrorText(result)
print(result[1])
else:
print("PCAN-USBx was initialized")
I'm pretty sure that the channel = PCAN_USBBUS1 is incorrect..
best regards,
Nicholas.
I am new to using PEAK CANBUSB Pro. I have successfully installed the device drivers under Ubuntu (14.04)
I would like to develop in Python read and write CAN messages .. I currently have built the device drivers with the option : make NET=NO .. so I have Chardev device drivers installed. I can successfully run the receive and transmit test so i know my device is running ok. I want to use Python to transmit on CAN Bus1 .. In CharDev drivers when I type cat /proc/pcan i get two interfaces no.s 32,33.
i have my code as follows: I don't know how to list the two CAN interfaces I have.. do I even need to install the NEtDev version of the driver in order to use with Python? So that I can have Netdev interfaces CAN1 and CAN2?
import sys
sys.path.append('''/home/rdm/peak-linux-driver-7.15.2/jdk1.8.0_73''')
#sys.path.append('''/home/rdm/peak''')
import PCANBasic
channel = PCAN_USBBUS1
baud = PCAN_BAUD_500K
# The Plug & Play Channel (PCAN-USB) is initialized
#
objPCAN = PCANBasic()
result = objPCAN.Initialize(channel, baud)
if result != PCAN_ERROR_OK:
# An error occured, get a text describing the error and show it
#
result = objPCAN.GetErrorText(result)
print(result[1])
else:
print("PCAN-USBx was initialized")
I'm pretty sure that the channel = PCAN_USBBUS1 is incorrect..
best regards,
Nicholas.