03-11-2021, 03:25 PM
hi,
I have been looking into setting up a BMW I drive controller.
list of parts:
raspberry pi 3b+
can hat based on the MCP2515 https://www.waveshare.com/wiki/2-CH_CAN_HAT I got this board so I don't have to any logic conversion
BMW idrive controller like this one
https://www.ebay.co.uk/itm/Original-BMW-...DUnbranded&_trksid=p2047675.c101195.m1851
I have set up the can hat based on manufactures instructions. basically the same as the instructions the blue wave team emailed me.
here is my /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=82
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23
dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=12
dtoverlay=spi-bcm2835-overlay
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=off
dtoverlay=disable-bt
disable_splash=1
dtoverlay=vc4-fkms-v3d
[pi3]
gpu_mem=128
max_framebuffers=1
[pi3+]
gpu_mem=128
max_framebuffers=1
[pi4]
max_framebuffers=2
start_x=1
[all]
#dtoverlay=vc4-kms-v3d
start_file=start_x.elf
fixup_file=fixup_x.dat
enable_uart=0
and here is my /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/usr/local/bin/rpi4pci.sh
/sbin/ip link set can0 up type can bitrate 100000
/sbin/ip link set can1 up type can bitrate 100000
exit 0
i have both can0 and can1 set up for testing in the end i will only use can0
also here is my controller service in /home/pi/.openauto/config/openauto_controller_serviceidrive.ini
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=2
; CAN interface connected to the iDrive Gen 1 controller (e.g. via MCP2515 device)
Interface=can0
; Duration in milliseconds between two presses of the iDrive controller knob in left, right, up or down direction. 0 disables double press feature.
;
; List of double press actions:
;
; Right - [Mode - switch between active applications, OpenAuto Pro and active Projection (Android Auto or Mirroring)]
; Left - [Back]
; Up - [Show/Hide OpenAuto Pro Top Bar]
; Down - [Bring OpenAuto Pro to front]
DoublePressSpeed=200
[IDriveGen1]
; Orientation in degrees of the iDrive Gen 1 controller. Possible values are 0, 90, 180, 270.
Angle=0
; true - Enable standalone mode of the controller; false - listen controller connected to the CIC/CCC BMW head unit.
Polling=true
; Period in milliseconds of querying the iDrive Gen1 controller (standalone mode).
PollTimeout=100
; Timeout in milliseconds for response from the iDrive Gen 1 controller (standalone mode). Exceeding this timeout terminates the controller service.
ControllerTimeout=1000
to test if I set up the can hat properly I have preformed a loopback test on can0 and have also connected can0 and can1 and I have been able to send and receive data over can bus network. ifconfig also shows both can0 can1. This leads me to believe that I have the can hat set up correctly . I also have the 120 ohm jumper on
pi@raspberrypi:~ $ ifconfig
can0: flags=193 mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 9 bytes 72 (72.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 96 (96.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
can1: flags=193 mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 12 bytes 96 (96.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 72 (72.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4099 mtu 1500
ether b8:27:eb:0f:7d:e2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
my idrive unit has 8 pins: i have triedid to connect the controller as instructed by blueweave in the email. I have also tried to connect it like so pin 1 12v pin 2 gnd pin 4 can hi pin 5 can lo took a look inside and took a look a the pin out of the micro controllers.
both ways i connect my idrive to the can hat I get no can data when using candump can0.
and when i test controller service i get this:
pi@raspberrypi:~ $ controller_service /home/pi/.openauto/config/openauto_controller_serviceidrive.ini
Error: Can't open display: (null)
[2021-03-11 15:13:47.476938] [0x76f37040] [info] [OpenAuto] [Controller Service] running...
[2021-03-11 15:13:48.477421] [0x76f37040] [error] [OpenAuto] [BMWIDriveController] IDrive controller communication error: Connection timed out
I'm assuming that my I have got something wrong with the idrive controller either connected it up wrong or even the wrong type of unit entirely but i could be wrong.
can anyone help me out ?
I have been looking into setting up a BMW I drive controller.
list of parts:
raspberry pi 3b+
can hat based on the MCP2515 https://www.waveshare.com/wiki/2-CH_CAN_HAT I got this board so I don't have to any logic conversion
BMW idrive controller like this one
https://www.ebay.co.uk/itm/Original-BMW-...DUnbranded&_trksid=p2047675.c101195.m1851
I have set up the can hat based on manufactures instructions. basically the same as the instructions the blue wave team emailed me.
here is my /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=82
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=23
dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=12
dtoverlay=spi-bcm2835-overlay
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=off
dtoverlay=disable-bt
disable_splash=1
dtoverlay=vc4-fkms-v3d
[pi3]
gpu_mem=128
max_framebuffers=1
[pi3+]
gpu_mem=128
max_framebuffers=1
[pi4]
max_framebuffers=2
start_x=1
[all]
#dtoverlay=vc4-kms-v3d
start_file=start_x.elf
fixup_file=fixup_x.dat
enable_uart=0
and here is my /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/usr/local/bin/rpi4pci.sh
/sbin/ip link set can0 up type can bitrate 100000
/sbin/ip link set can1 up type can bitrate 100000
exit 0
i have both can0 and can1 set up for testing in the end i will only use can0
also here is my controller service in /home/pi/.openauto/config/openauto_controller_serviceidrive.ini
[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
Type=2
; CAN interface connected to the iDrive Gen 1 controller (e.g. via MCP2515 device)
Interface=can0
; Duration in milliseconds between two presses of the iDrive controller knob in left, right, up or down direction. 0 disables double press feature.
;
; List of double press actions:
;
; Right - [Mode - switch between active applications, OpenAuto Pro and active Projection (Android Auto or Mirroring)]
; Left - [Back]
; Up - [Show/Hide OpenAuto Pro Top Bar]
; Down - [Bring OpenAuto Pro to front]
DoublePressSpeed=200
[IDriveGen1]
; Orientation in degrees of the iDrive Gen 1 controller. Possible values are 0, 90, 180, 270.
Angle=0
; true - Enable standalone mode of the controller; false - listen controller connected to the CIC/CCC BMW head unit.
Polling=true
; Period in milliseconds of querying the iDrive Gen1 controller (standalone mode).
PollTimeout=100
; Timeout in milliseconds for response from the iDrive Gen 1 controller (standalone mode). Exceeding this timeout terminates the controller service.
ControllerTimeout=1000
to test if I set up the can hat properly I have preformed a loopback test on can0 and have also connected can0 and can1 and I have been able to send and receive data over can bus network. ifconfig also shows both can0 can1. This leads me to believe that I have the can hat set up correctly . I also have the 120 ohm jumper on
pi@raspberrypi:~ $ ifconfig
can0: flags=193
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 9 bytes 72 (72.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 96 (96.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
can1: flags=193
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 12 bytes 96 (96.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 72 (72.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4099
ether b8:27:eb:0f:7d:e2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
my idrive unit has 8 pins: i have triedid to connect the controller as instructed by blueweave in the email. I have also tried to connect it like so pin 1 12v pin 2 gnd pin 4 can hi pin 5 can lo took a look inside and took a look a the pin out of the micro controllers.
both ways i connect my idrive to the can hat I get no can data when using candump can0.
and when i test controller service i get this:
pi@raspberrypi:~ $ controller_service /home/pi/.openauto/config/openauto_controller_serviceidrive.ini
Error: Can't open display: (null)
[2021-03-11 15:13:47.476938] [0x76f37040] [info] [OpenAuto] [Controller Service] running...
[2021-03-11 15:13:48.477421] [0x76f37040] [error] [OpenAuto] [BMWIDriveController] IDrive controller communication error: Connection timed out
I'm assuming that my I have got something wrong with the idrive controller either connected it up wrong or even the wrong type of unit entirely but i could be wrong.
can anyone help me out ?