Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
I've forgotten to ask: Did you already make a sound check? I've noticed a annoying ping sound every 600 ms with picoharis software on an ATmega128 as well as with Olystyle's software on an Arduino Pro Mini and on an Esp32. Did you hear something similar. I gues it might be a problen of grounds.
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Hi William,
I had a look at what you have done, this looks absolutely great! Way better than what I had in mind doing for my Alpine.
I was able to flash the binaries contained in your zip onto an Esp32 (using a Raspberry Pi 3), conecting to its Wifi and the debugging page afterwards. I still have to get the radio out of the car and build the hardware part to test. Will be interesting to see whether the code which is sent after a button press really is the same. Also, my HU doesn‘t have an internal CD, only the changer in the trunk
However, it seems I can‘t compile the code by myself due to some lacking (?) files. With Win 10, as well as with Raspbian Duster, no matter whether using cmake or make, the build process stops with a „file not found“ error:
Any idea what might be the problem?
To get things sorted (and before heating the soldering iron), I've made a kind of diagram of what I understood is your concept (does your radio/changer also comes with the 8-pin DIN sockets?). Would you mind to have a look at it?
What I still don_t understand is the part
etc. I deduce that you are also planning to use a relay to switch between sources? I've noticed that some of the pins you list in config.h aren't available on my Ep32 Wrover board (see diagram).
BTW: I tried the onboard Bluetooth of my Esp32, merging Phil Schatzman's software with Oliver's M-Bus emulator sketch - worked fine out-of-the-box. I integrated an old DAC (PhatDac) I had lying around to get a decent sound quality; the only drawback seems to be that there is no library for the Esp32 that includes handsfree...
Best regards
Martin
I had a look at what you have done, this looks absolutely great! Way better than what I had in mind doing for my Alpine.
I was able to flash the binaries contained in your zip onto an Esp32 (using a Raspberry Pi 3), conecting to its Wifi and the debugging page afterwards. I still have to get the radio out of the car and build the hardware part to test. Will be interesting to see whether the code which is sent after a button press really is the same. Also, my HU doesn‘t have an internal CD, only the changer in the trunk
However, it seems I can‘t compile the code by myself due to some lacking (?) files. With Win 10, as well as with Raspbian Duster, no matter whether using cmake or make, the build process stops with a „file not found“ error:
Code: Select all
ninja: error: '../espfs', needed by 'esp-idf/espfs/espfs_image.bin', missing and no known rule to make it
Traceback (most recent call last):
File "C:/Users/mknap/Desktop/M-Bus/wllm3000/mbus0.0.1/components/espfs/tools/build-image.py", line 102, in <module>
subprocess.check_call(['xxd', '-i', 'espfs_image.bin', 'include/espfs_image_bin.h'])
File "subprocess.py", line 359, in check_call
File "subprocess.py", line 340, in call
File "subprocess.py", line 854, in __init__
File "subprocess.py", line 1307, in _execute_child
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden
[673/1001] Generating x509_crt_bundle
ninja: build stopped: subcommand failed.
To get things sorted (and before heating the soldering iron), I've made a kind of diagram of what I understood is your concept (does your radio/changer also comes with the 8-pin DIN sockets?). Would you mind to have a look at it?
What I still don_t understand is the part
Code: Select all
// OUTPUTS
// 13 AUDIO RELAY CDC
// 16 AUDIO RELAY BT
// 17 AUDIO RELAY INTCD
// 21 AUDIO RELAY AUX
// 19 MBUS CHANGER OUT
BTW: I tried the onboard Bluetooth of my Esp32, merging Phil Schatzman's software with Oliver's M-Bus emulator sketch - worked fine out-of-the-box. I integrated an old DAC (PhatDac) I had lying around to get a decent sound quality; the only drawback seems to be that there is no library for the Esp32 that includes handsfree...
Best regards
Martin
- Attachments
-
- Schaltung William.jpg (169.16 KiB) Viewed 8649 times
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
I think the code could run on a wroom. If I remember correctly I didn't pin specific tasks to a specific core (wrover is dualcore).
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
I don't have any sounds. I didn't connect the bluetooth module but just shutdown the cd player and there is no audio. Causes could be a ground loop or other interference.dadoc22 wrote: ↑Mon Sep 20, 2021 3:46 pmI've forgotten to ask: Did you already make a sound check? I've noticed a annoying ping sound every 600 ms with picoharis software on an ATmega128 as well as with Olystyle's software on an Arduino Pro Mini and on an Esp32. Did you hear something similar. I gues it might be a problen of grounds.
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Thanks Though the code is still not really optimized and could be way better.dadoc22 wrote: ↑Mon Sep 27, 2021 2:36 pmHi William,
I had a look at what you have done, this looks absolutely great! Way better than what I had in mind doing for my Alpine.
I was able to flash the binaries contained in your zip onto an Esp32 (using a Raspberry Pi 3), conecting to its Wifi and the debugging page afterwards. I still have to get the radio out of the car and build the hardware part to test. Will be interesting to see whether the code which is sent after a button press really is the same. Also, my HU doesn‘t have an internal CD, only the changer in the trunk
However, it seems I can‘t compile the code by myself due to some lacking (?) files. With Win 10, as well as with Raspbian Duster, no matter whether using cmake or make, the build process stops with a „file not found“ error:
Any idea what might be the problem?Code: Select all
ninja: error: '../espfs', needed by 'esp-idf/espfs/espfs_image.bin', missing and no known rule to make it Traceback (most recent call last): File "C:/Users/mknap/Desktop/M-Bus/wllm3000/mbus0.0.1/components/espfs/tools/build-image.py", line 102, in <module> subprocess.check_call(['xxd', '-i', 'espfs_image.bin', 'include/espfs_image_bin.h']) File "subprocess.py", line 359, in check_call File "subprocess.py", line 340, in call File "subprocess.py", line 854, in __init__ File "subprocess.py", line 1307, in _execute_child FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden [673/1001] Generating x509_crt_bundle ninja: build stopped: subcommand failed.
To get things sorted (and before heating the soldering iron), I've made a kind of diagram of what I understood is your concept (does your radio/changer also comes with the 8-pin DIN sockets?). Would you mind to have a look at it?
What I still don_t understand is the partetc. I deduce that you are also planning to use a relay to switch between sources? I've noticed that some of the pins you list in config.h aren't available on my Ep32 Wrover board (see diagram).Code: Select all
// OUTPUTS // 13 AUDIO RELAY CDC // 16 AUDIO RELAY BT // 17 AUDIO RELAY INTCD // 21 AUDIO RELAY AUX // 19 MBUS CHANGER OUT
BTW: I tried the onboard Bluetooth of my Esp32, merging Phil Schatzman's software with Oliver's M-Bus emulator sketch - worked fine out-of-the-box. I integrated an old DAC (PhatDac) I had lying around to get a decent sound quality; the only drawback seems to be that there is no library for the Esp32 that includes handsfree...
Best regards
Martin
My (non-mbus) radio has a seperate indash cd player, because of the looks and functionality I would like to have this one in my dash. Therefore there is some extra circuitry/code to support this but for your setup you could delete/disable/ignore it
'../espfs', needed by 'esp-idf/espfs/espfs_image.bin
This error is because it needs a few linux tools to compile espfs generator. For Windows you need to install nodejs and mingw64 and include the binfolders in the PATH variable. Specifically it needs 'xxd' which is provided by vim-common package.
Regarding circuit design yes I found out that certain pins can't be used. In the end I'll use an analog multiplexer or relay array to switch between sources! Currently I'm trying some PCB design (first time at that too). It's not finished yet however I might go ahead and order the pcb anyway just to see what faults I made in the design https://pw12.nu/STATIC/prelude/mbus0.0.1_pcb.zip
Interesting! I looked at using the esp32 too for bluetooth but my idea behind the csr8675 was, it's already a decent bluetooth handsfree with better codecs (aptx-hd/aac for higher bitrate than default a2dp codecs) and some noise canceling goodies. There is a port of APTX to esp32 but haven't found any handsfree code for the esp.
Ohh and I've been a little away from this project a few weeks, busy with my actual car but now it's time to continue.
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Hi William,
great to hear from you again (the forum software, however, doesn't seem to notify about new posts...).
However, as the Bluetooth modules Tim has written the code for aren't available any longer, it might be hard to try the software. But perhaps you're interested to have a look at it.
In the meantime, I've put another "solution" into my old Jag to be able to use BT in and CD at the same time: I soldered two 8 pin jacks together and soldered the AUX in cable coming from a Bluetooth module pluged into the cigarette lighter parallel to the CD audio cables. Then I burnt a "Silent CD" (very funny: http://duramecho.com/Misc/SilentCd/index.html), and voilà... Not very elegant, but highly effective , and without disturbing ping sounds...
But of course I would prefer a professional solution as the one you are heading for.
Best regards
Martin
great to hear from you again (the forum software, however, doesn't seem to notify about new posts...).
Thanks, I'll try this; however, I had the same error when trying to compile on a Raspberry Pi.../espfs', needed by 'esp-idf/espfs/espfs_image.bin
This error is because it needs a few linux tools to compile espfs generator. For Windows you need to install nodejs and mingw64 and include the binfolders in the PATH variable. Specifically it needs 'xxd' which is provided by vim-common package.
I've found another (8 years old) implementation of a M-Bus emulator that also seems to keep the CD changer in a working state: It uses an Arduino // Teensy, an IC (I've already ordered it) and a Bluetooth module (two to select from). The idea behind seems to be that when selecting a special CD (12 songs with exactly 5 minutes each), the BT mode is automatically activated. It comes with two "flavors": Alpine M-Bus and BMW (?) I-Bus, and a companion app for Android phones: https://github.com/timotto/UbarCDC.In the end I'll use an analog multiplexer or relay array to switch between sources!
However, as the Bluetooth modules Tim has written the code for aren't available any longer, it might be hard to try the software. But perhaps you're interested to have a look at it.
In the meantime, I've put another "solution" into my old Jag to be able to use BT in and CD at the same time: I soldered two 8 pin jacks together and soldered the AUX in cable coming from a Bluetooth module pluged into the cigarette lighter parallel to the CD audio cables. Then I burnt a "Silent CD" (very funny: http://duramecho.com/Misc/SilentCd/index.html), and voilà... Not very elegant, but highly effective , and without disturbing ping sounds...
But of course I would prefer a professional solution as the one you are heading for.
Best regards
Martin
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Hi Martin,
Indeed, even while enabled, I don't get notifications either.
Indeed, even while enabled, I don't get notifications either.
On Linux you also need nodejs and vim-common packages. nodejs is used for html/javascript compression.Thanks, I'll try this; however, I had the same error when trying to compile on a Raspberry Pi.../espfs', needed by 'esp-idf/espfs/espfs_image.bin
This error is because it needs a few linux tools to compile espfs generator. For Windows you need to install nodejs and mingw64 and include the binfolders in the PATH variable. Specifically it needs 'xxd' which is provided by vim-common package.
Interesting, I'll have a look at it. Maybe there is something useful there!I've found another (8 years old) implementation of a M-Bus emulator that also seems to keep the CD changer in a working state: It uses an Arduino // Teensy, an IC (I've already ordered it) and a Bluetooth module (two to select from). The idea behind seems to be that when selecting a special CD (12 songs with exactly 5 minutes each), the BT mode is automatically activated. It comes with two "flavors": Alpine M-Bus and BMW (?) I-Bus, and a companion app for Android phones: https://github.com/timotto/UbarCDC.In the end I'll use an analog multiplexer or relay array to switch between sources!
However, as the Bluetooth modules Tim has written the code for aren't available any longer, it might be hard to try the software. But perhaps you're interested to have a look at it.
Nice. If it's stupid and it works, it's not stupid You could also hook a switch between the wires! That was my first idea with my currently installed radio as it only supports a very basic form of communication between the cd player and radio. But yes, I'm also aiming for something more fancy that's the reason I bought another radio with CDC support and decided to put my efforts in that. I had to discover the hardway that even though the connectors looked familiar (CDC/CD+EQ). Some magic smoke came from the CDC and had to repair it (I sacrificed the muting circuit in the CDC as there was a blown transistor of somekind).In the meantime, I've put another "solution" into my old Jag to be able to use BT in and CD at the same time: I soldered two 8 pin jacks together and soldered the AUX in cable coming from a Bluetooth module pluged into the cigarette lighter parallel to the CD audio cables. Then I burnt a "Silent CD" (very funny: http://duramecho.com/Misc/SilentCd/index.html), and voilà... Not very elegant, but highly effective , and without disturbing ping sounds...
But of course I would prefer a professional solution as the one you are heading for.
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
I finally managed to compile without errors on Windows. Besides vim, I also had to install sed (!) for WIndows in order to get rid of the errors.
I had a look at your PCB design - wow, this looks like serious stuff...! Did you leave the BT module out or was it simply me not finding it?
Talking about bluetooth: I’ve changed my plans a little bit. On one hand, I’ve got used to the commodity of having a kind of remote control for the radio, as the concept of the old Alpine HU (only push buttons, even for volume…) is not my favorite way to interact. I'm more the rotating-knobs-type
So, in a first step, I decided to „outsource“ the entire Bluetooth/Hands-free part to an 15-Euro-Adapter plugged into the cigarrette lighter (which happens to be nicely placed in my Jaguar):
The adapter comes with AUX out which I connected to the CDC audio lines. Thus, I have a whole bunch of additional features, as handsfree phone calls (the adapter comes with an inbuilt mic), Siri VC, USB for quick charging, equalizer, song control with push buttons (play/pause/skip/forward etc.) and so on.
And on the other hand, I’m very interested in having DAB+ radio in the car. So I looked around – and what I’ve just ordered is this: https://www.alpine.de/p/Products/SingleView/ezi-dab-bt
It combines the features of the 15-Euro-Adapter with a DAB+ receiver, and I liked the idea to have the control unit completely wireless (will have to see whether hiding away the actual receiver and DAB antenna in the dash will allow for a good signal).
This means that I'm back to only need an emulator that only opens the audio input from the CD changer.
William, would it be possible to compile your code for this on an Esp32, i.e. without fancy things like bluetooth or switching between sources? Would I need to change sth. in zthe sources? (hopefully not, because further than editing comments or change some pin assignation I'm really unable to code on this level...).
Having a version based on Picoharis Code ported to Esp32 would be very helpful in general, as the ATMega128 are rather impossible to get. I know that there are some guys in a German Arduino forum hoping for a port, too...
Best regards
Martin
- Attachments
-
- einbau.jpg (664.31 KiB) Viewed 7907 times
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Hi Martin, not sure if you're still following this but I've been away from the project for some time for various reasons and just recently started to give this a bit more attention.dadoc22 wrote: ↑Thu Oct 21, 2021 1:28 pmI finally managed to compile without errors on Windows. Besides vim, I also had to install sed (!) for WIndows in order to get rid of the errors.
I had a look at your PCB design - wow, this looks like serious stuff...! Did you leave the BT module out or was it simply me not finding it?
Talking about bluetooth: I’ve changed my plans a little bit. On one hand, I’ve got used to the commodity of having a kind of remote control for the radio, as the concept of the old Alpine HU (only push buttons, even for volume…) is not my favorite way to interact. I'm more the rotating-knobs-type
So, in a first step, I decided to „outsource“ the entire Bluetooth/Hands-free part to an 15-Euro-Adapter plugged into the cigarrette lighter (which happens to be nicely placed in my Jaguar):
The adapter comes with AUX out which I connected to the CDC audio lines. Thus, I have a whole bunch of additional features, as handsfree phone calls (the adapter comes with an inbuilt mic), Siri VC, USB for quick charging, equalizer, song control with push buttons (play/pause/skip/forward etc.) and so on.
And on the other hand, I’m very interested in having DAB+ radio in the car. So I looked around – and what I’ve just ordered is this: https://www.alpine.de/p/Products/SingleView/ezi-dab-bt
It combines the features of the 15-Euro-Adapter with a DAB+ receiver, and I liked the idea to have the control unit completely wireless (will have to see whether hiding away the actual receiver and DAB antenna in the dash will allow for a good signal).
This means that I'm back to only need an emulator that only opens the audio input from the CD changer.
William, would it be possible to compile your code for this on an Esp32, i.e. without fancy things like bluetooth or switching between sources? Would I need to change sth. in zthe sources? (hopefully not, because further than editing comments or change some pin assignation I'm really unable to code on this level...).
Having a version based on Picoharis Code ported to Esp32 would be very helpful in general, as the ATMega128 are rather impossible to get. I know that there are some guys in a German Arduino forum hoping for a port, too...
Best regards
Martin
I've added some very basic standalone mode which you can try. It doesn't handle buttons but just tries to fool the radio there is a cdc attached and playing.
Re: Porting Alpine M-Bus emulator from Arduino Pro Mini to Esp32 dev
Hey Guys,
I've been searching for a long time for a build like this! Are you still working on it? I would like to see your latest updates at this
Thanks
I've been searching for a long time for a build like this! Are you still working on it? I would like to see your latest updates at this
Thanks
Who is online
Users browsing this forum: No registered users and 78 guests