DIY E46 Media Centre: MP3, videos, Digital Radio, Digital TV? - Page 13 - E46Fanatics E46 BMW Social Directory E46 FAQ 3-Series Discussion Forums BMW Photo Gallery BMW 3-Series Technical Information E46 Fanatics - The Ultimate BMW Resource BMW Vendors General E46 Forum The Tire Rack's Tire Wheel Forum Forced Induction Forum The Off-Topic The E46 BMW Showroom For Sale, For Trade or Wanting to Buy

Go Back   E46Fanatics > Tuning & Tech > Mobile Electronics Forum

Mobile Electronics Forum
Have all your A/V and electronics questions answered here. Ipods, A/V, Radar Detectors Oh My!

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 69 votes, 4.99 average. Display Modes
Old 02-24-2014, 02:43 AM   #241
onefifty370
Registered User
 
Join Date: Feb 2014
Location: Adelaide
Posts: 10
My Ride: e46 M3
Quote:
Originally Posted by E46 Coupe View Post
You shouldn't have CDC with the pibus unplugged. Did you leave the changer plugged in with the pibus?
It is not showing "CDC", it is showing "CD" when the pibus is not connected. I assume this is the slot loading CD in the head unit.

With CD changer connected, Mode cycles through Radio, "No Discs" (changer) and "No CD" (head unit CD).

Without CD changer connected, Mode cycles through Radio, and "No CD" (head unit CD).

With pibus connected Mode cycles through Radio, "TR04 CD1" (pibus spoof of changer?) and "No CD" (head unit CD).
onefifty370 is offline   Reply With Quote
Old 02-24-2014, 03:34 AM   #242
320247
Guest
 
Join Date: Feb 2014
Location: Stuttgart, Germany
Posts: 43
My Ride: 525iA E39
I didn't know there were systems that have a CD changer (in the trunk) and a CD slot in the front.

Quote:
Originally Posted by PeteAU View Post
...It looks for the text "CDC 1-04" to switch the video and keyboard...
In your case the text is different so maybe that is the problem. But I'm just guessing...

Last edited by Mopinsky; 02-24-2014 at 03:47 AM.
320247 is offline   Reply With Quote
Old 02-24-2014, 03:58 AM   #243
onefifty370
Registered User
 
Join Date: Feb 2014
Location: Adelaide
Posts: 10
My Ride: e46 M3
Yes, mine has changer in the boot (model 6512 6977766-03) and a slot load CD under a flip down screen on the head unit.

The head unit looks different to the one in an earlier post by Peter too.
Mine looks more like this one:
https://forum.e46fanatics.com/showthread.php?p=15905785

Assuming it is the text string that is the problem, is it the microcontroller that handles it or the SW running on the Pi? If it is the Pi, then hopefully it's just a simple code change and remake. If it's running on the micro then I don't think I have the technology to build and reprogram
onefifty370 is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 02-24-2014, 04:47 AM   #244
320247
Guest
 
Join Date: Feb 2014
Location: Stuttgart, Germany
Posts: 43
My Ride: 525iA E39
I am not sure if it is in the RPi-software or the microcontroller, but looking at "ibus.c" in the pibus/rpi directory, it could be in the Linux software.
Line 335 says: "{20,"\x68\x12\x3b\x23\x62\x10\x43\x44\x43\x20\x31\x2d\x30\x34\x20 \x20\x20\x20\x20\x4c", "CDC 1-04", NULL, 0, cdchanger_handle_cdcmode}".

But I would wait for PeteAU to confirm that.
As he wrote in an earlier post: there are 5$ Microcontroller programmers from Hong Kong on eBay, so even if it was a microcontroller thing you could change it, I guess.
320247 is offline   Reply With Quote
Old 02-24-2014, 04:55 AM   #245
onefifty370
Registered User
 
Join Date: Feb 2014
Location: Adelaide
Posts: 10
My Ride: e46 M3
Thanks Mopinski. Found that too. Note there is also a defined message containing TR 04" directly after the "CDC 1-04" message. I'm still trying to get my head around their usage. Hopefully Pete can chime in since he knows the code best.
Just downloaded the ibus.txt log and are going to try searching for equivalent messages.
onefifty370 is offline   Reply With Quote
Old 02-24-2014, 04:58 AM   #246
PeteAU
Registered User
 
Join Date: Oct 2011
Location: Melbourne
Posts: 541
My Ride: 330i
Quote:
Originally Posted by Mopinsky View Post
I am not sure if it is in the RPi-software or the microcontroller, but looking at "ibus.c" in the pibus/rpi directory, it could be in the Linux software.
Line 335 says: "{20,"\x68\x12\x3b\x23\x62\x10\x43\x44\x43\x20\x31\x2d\x30\x34\x20 \x20\x20\x20\x20\x4c", "CDC 1-04", NULL, 0, cdchanger_handle_cdcmode}".

But I would wait for PeteAU to confirm that.
As he wrote in an earlier post: there are 5$ Microcontroller programmers from Hong Kong on eBay, so even if it was a microcontroller thing you could change it, I guess.
There is code in both the Pi & ATtiny that looks for the CD-changer strings:
- The Pi uses this to switch "keyboard focus".
- The ATtiny uses this to switch the video signal.

It's possible onefifty370 has a different model radio we haven't seen yet, that has a slightly different string. If that turns out to be the case, it's not a total disaster, you can get a $3 programmer off ebay and change the code - I'll show you how if need be.

At the moment it looks for two possible strings:

1. \x68\x12\x3b\x23\x62\x10\x43\x44\x43\x20\x31\x2d\x30\x34\x20 \x20\x20\x20\x20\x4c - "CDC 1-04"
2. \x68\x0e\x3b\x23\x62\x10\x54\x52\x20\x30\x34\x20 - "TR 04"

The second one was added by an M3 owner in Europe, my car doesn't use that one, and it seems to be a rare variant.

onefifty370: EMail me your ibus.txt log file and we can see if your car behaves differently or not.
PeteAU is offline   Reply With Quote
Old 02-24-2014, 05:00 AM   #247
ccfj1
Registered User
 
Join Date: Jan 2007
Location: UK
Posts: 112
My Ride: 2003 M3
Quote:
Originally Posted by onefifty370 View Post
It is not showing "CDC", it is showing "CD" when the pibus is not connected. I assume this is the slot loading CD in the head unit.

With CD changer connected, Mode cycles through Radio, "No Discs" (changer) and "No CD" (head unit CD).

Without CD changer connected, Mode cycles through Radio, and "No CD" (head unit CD).

With pibus connected Mode cycles through Radio, "TR04 CD1" (pibus spoof of changer?) and "No CD" (head unit CD).
Sounds like you have a 2005 onwards radio module mate (with the latest firmware), these replace the cd message with TR, maybe the PiBus is now not "seeing" the correct cd string and therefore not switching.

Looking at the PiBus code (I've commented the hex code on the left)

buf[0] == 0x68 && /* Radio Source */
buf[6] == 0x43 && /* C */
buf[13] == 0x34 && /* 4 */
buf[19] == 0x4c) || /* L */
(bufPos == 16 &&
buf[0] == 0x68 && /* Radio Source */
buf[6] == 0x54 && /* T */
buf[7] == 0x52 && /* R
buf[8] == 0x20 && /* "space" */
buf[9] == 0x30 && /* 0 */
buf[10] == 0x34)) /* 4 */

The short string seems to be correct, but the long string seems to be looking at the wrong code, I think it should be looking at (43 44 43 20 31 2d 30 34)

buf[0] == 0x68 && /* Radio Source */
buf[6] == 0x43 && /* C */
buf[7] == 0x44 && /* D */
buf[8] == 0x43 && /* C */
buf[10] == 0x31 && /* 1 */
buf[12] == 0x2d && /* - */
buf[13] == 0x30 && /* 0 */
buf[13] == 0x34) || /* 4 */
(bufPos == 16 &&
buf[0] == 0x68 && /* Radio Source */
buf[6] == 0x54 && /* T */
buf[7] == 0x52 && /* R
buf[8] == 0x20 && /* "space" */
buf[9] == 0x30 && /* 0 */
buf[10] == 0x34)) /* 4 */

clutching at straws though!!!
__________________
53, M3, Silver Grey. Reto-fits: Modded Mk4 DVD, OEM Bluetooth, VR Control, Rainbow/Alpine Speakers, Sony SOT Amp, HK Sub, CCFL, Intravee II, NightMode.

Last edited by ccfj1; 02-24-2014 at 05:01 AM.
ccfj1 is offline   Reply With Quote
Old 02-24-2014, 05:05 AM   #248
320247
Guest
 
Join Date: Feb 2014
Location: Stuttgart, Germany
Posts: 43
My Ride: 525iA E39
Do you have to buy a new microcontroller or can you reprogram it? If you can reprogram it, do you have to unsolder it or could you do it without having to do some "manual labour"?

I'm asking because I am not very handy with a soldering iron but still want to get the "no video playback while driving"-project done somehow.
320247 is offline   Reply With Quote
Old 02-24-2014, 05:12 AM   #249
onefifty370
Registered User
 
Join Date: Feb 2014
Location: Adelaide
Posts: 10
My Ride: e46 M3
Thanks all. Had a quick look through the ibus log. Definitely no messages containing the string CDC, and the whilst it contains a message with TR 04, it looks considerably different to that defined in ibus.c. Mine is a late 05 build M3, so yes consistent with your thoughts ccfj1.

Have just emailed ibus.txt to you PeteAU.
onefifty370 is offline   Reply With Quote
Old 02-24-2014, 05:14 AM   #250
ccfj1
Registered User
 
Join Date: Jan 2007
Location: UK
Posts: 112
My Ride: 2003 M3
Hmmm, it should still switch on TR04 though!!!
__________________
53, M3, Silver Grey. Reto-fits: Modded Mk4 DVD, OEM Bluetooth, VR Control, Rainbow/Alpine Speakers, Sony SOT Amp, HK Sub, CCFL, Intravee II, NightMode.
ccfj1 is offline   Reply With Quote
Old 02-24-2014, 08:57 AM   #251
320247
Guest
 
Join Date: Feb 2014
Location: Stuttgart, Germany
Posts: 43
My Ride: 525iA E39
Quote:
Originally Posted by Mopinsky View Post
Do you have to buy a new microcontroller or can you reprogram it? If you can reprogram it, do you have to unsolder it or could you do it without having to do some "manual labour"?
Nevermind. I noticed that there is the possibility for AVR ICSP on the pibus board. But if anyone showed me how to reprogram it, that would be great.

320247 is offline   Reply With Quote
Old 02-24-2014, 07:58 PM   #252
bgennette
Registered User
 
Join Date: May 2013
Location: Newcastle AU
Posts: 10
My Ride: l322 Range Rover
Reprogramming the ATtiny on the Pibus board

This really only takes a minute or 2 . . .

Buy any simple ATMEL capable programmer on ebay, BUT make sure it -
_comes with usb drivers for your operating system (or links to download them)
_can be controlled via AVRDUDE
_has a 2x5 header cable (or a 1x6 to 2x5 adaptor)

Download a version of AVRDUDE for your operating system that has ATtiny 2313 in its list of supported microcontrollers.
(You may also get AVRDUDESS which is a gui shell for lazy users, however it is a little limited. After all you'll only be typing 100 charactors at most.)

Install the programmer and AVRDUDE programs.

Download the ibusxxxxxxxx.hex file you wish to upgrade to. Extract it if it is inside a package.

+----------------------------------------------------------------------------------------

Copy the iBusxxxxxxxx.hex file to the directory AVRDUDE is stored in
Enter a command shell environment - Windows users type 'cmd' in the Start | Search box
Change to the directory AVRDUDE is installed in - C:/> cd /AVR
Connect the ATMEL programmer to your PC (mine is a usbtiny)
Connect the PiBus to the ATMEL programmer
_Note - the PiBus must be bare, nothing else connected to it.

+----------------------------------------------------------------------------------------
Programming -
Check that it recognizes the microcontroller - C:\AVR> avrdude -p t2313a -c usbtiny

_Note if using a different program to avrdude you often can turn off "target identification" so that a t2313, t2313A, t2313S or t2313V may all be programmed using the t2313 config file.

Burn the .hex file - C:\AVR> avrdude -p t2313a -c usbtiny -e -U flash:w:ibusxxxxxxxxx.hex

_Note capital U for Up loading (a lower case u forces unsafe fuse checking)

+----------------------------------------------------------------------------------------

If you are writing to a new 2313A the fuses will have to be set too -

Burn the fuses - C:\AVR> avrdude -p t2313a -c usbtiny -u -U efuse:w:0xff:m -U hfuse:w:0x9f:m -U lfuse:w:0x7d:m

_Note :m means read values from the command line instead of from a file
_Note you have to use unsafe fuse checking when changing fuse values.
+----------------------------------------------------------------------------------------

Unplug the PiBus and test it.

bye.

Last edited by bgennette; 03-07-2014 at 07:37 PM.
bgennette is offline   Reply With Quote
Old 02-24-2014, 08:13 PM   #253
PeteAU
Registered User
 
Join Date: Oct 2011
Location: Melbourne
Posts: 541
My Ride: 330i
--> http://pibus.info/program.html
PeteAU is offline   Reply With Quote
Old 02-25-2014, 03:05 AM   #254
ccfj1
Registered User
 
Join Date: Jan 2007
Location: UK
Posts: 112
My Ride: 2003 M3
Whats the best way to compile a new HEX file?
__________________
53, M3, Silver Grey. Reto-fits: Modded Mk4 DVD, OEM Bluetooth, VR Control, Rainbow/Alpine Speakers, Sony SOT Amp, HK Sub, CCFL, Intravee II, NightMode.
ccfj1 is offline   Reply With Quote
Old 02-27-2014, 02:11 AM   #255
E46 Coupe
Registered User
 
E46 Coupe's Avatar
 
Join Date: May 2008
Location: Australia
Posts: 5,273
My Ride: Rules1 & 2: S T F U!
So while I was driving home on the freeway today my indicators decided to stop working, my nav screen turned off and my wipers thought it was raining!!
It went back to normal after dropping Netgun off home, but when I left it did it again! I had to pull over and disconnect the pibus and it all went back to normal. That was fun!
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
E46 Coupe is offline   Reply With Quote
Old 02-27-2014, 03:05 AM   #256
PeteAU
Registered User
 
Join Date: Oct 2011
Location: Melbourne
Posts: 541
My Ride: 330i
Quote:
Originally Posted by E46 Coupe View Post
So while I was driving home on the freeway today my indicators decided to stop working, my nav screen turned off and my wipers thought it was raining!!
It went back to normal after dropping Netgun off home, but when I left it did it again! I had to pull over and disconnect the pibus and it all went back to normal. That was fun!
That sucks. Something must have come loose, cracked, come-off from vibration I would imagine. IMO I don't like the look (from your photo) of only isolating the board from the metal CDC frame with tape. The pins at the bottom could eventually punch through and touch ground.
PeteAU is offline   Reply With Quote
Old 02-27-2014, 03:37 AM   #257
320247
Guest
 
Join Date: Feb 2014
Location: Stuttgart, Germany
Posts: 43
My Ride: 525iA E39
I have another question concerning re-programming.
Does the pibus forward all ibus messages to the Raspberry Pi? I want to send a message/signal/keypress to the RPi if the key is removed from the ignition lock.
The ibus message for that is 44 05 bf 74 00 ff + Checksum. Do I have to change the code for the attiny or for the linux software or both?

I thought I had to modify the attiny but taking a closer look I think the attiny somehow forwards the messages to the RPi and the linux software emulates the keypresses. My first attempt would be to add my lines of code to the "ibus.c" in the rpi directory.

Also: which IDE on which operating system did you use to develop the linux software?

Last edited by Mopinsky; 02-27-2014 at 05:00 AM.
320247 is offline   Reply With Quote
Old 02-27-2014, 05:27 AM   #258
E46 Coupe
Registered User
 
E46 Coupe's Avatar
 
Join Date: May 2008
Location: Australia
Posts: 5,273
My Ride: Rules1 & 2: S T F U!
Quote:
Originally Posted by PeteAU View Post
That sucks. Something must have come loose, cracked, come-off from vibration I would imagine. IMO I don't like the look (from your photo) of only isolating the board from the metal CDC frame with tape. The pins at the bottom could eventually punch through and touch ground.

My mount is actually on 3mm perspex secured by Velcro Pete.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
E46 Coupe is offline   Reply With Quote
Old 02-27-2014, 05:29 AM   #259
E46 Coupe
Registered User
 
E46 Coupe's Avatar
 
Join Date: May 2008
Location: Australia
Posts: 5,273
My Ride: Rules1 & 2: S T F U!
Shorting isn't possible unless the pibus can piss through perspex!
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
E46 Coupe is offline   Reply With Quote
Old 02-27-2014, 09:11 AM   #260
Arthur530SE
Registered User
 
Join Date: Nov 2013
Location: Burton on Trent, U.K
Posts: 79
My Ride: 2001 530iSE
Hi All,

A great Installation tutorial from bgennette.

Quote:
Originally Posted by bgennette View Post
PiBUS - Raspberry Pi in an IBus BMW

+----------------------------------------------------------------------------------------------------------
Run Paragon ExtFS for Windows (not required for linux) to add files to the Ext part of the SD card -
Copy the pibus-xxxxxxxx file onto the ext formatted part of the SD card (named /storage)
Copy pm3-hd.zip onto /storage (Note - do not unzip inner package)
Load some of your media content into /storage/xxx on the SD Card.
Note - while running /system is read-only and locked away, put all your config and media files on /storage
Note - ext file systems use a forward slash between directory names, not Windows style backslash.
Note - Windows file managers show disk names starting with upper case (even if they are lower case!), be sure to always type /storage with all lower case.
+----------------------------------------------------------------------------------------------------------
Just a little clarification here... Quoted above bgennette says "Copy the pibus-xxxxxxxx file onto the ext formatted part of the SD card (named /storage)"

Are you referring to the entire directory resulting from unzipping the pibus software?

I just copied the file "pibus" from the "rpi" folder to /storage which worked for me.

Just one more question to all...
Has any one tried using any of the available XBMC plugins for example the openbm plugin which allows XBMC to display BC info?

I don't see any reason why plugins shouldn't work I've just not had the time try yet.
Arthur530SE is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Censor is ON



All times are GMT -5. The time now is 05:55 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
(c) 1999 - VerticalScope Inc. All rights reserved.