MDB2Pi Configuration
This page contains details of the MDB2Pi configuration for a successful MDB to Raspberry Pi configuration setup. To find out more about the MDB2Pi, please visit About MDB Converter. To buy an MDB2Pi, please visit MDB2Pi.
Connectivity
Please find the GPIO pin layout on Raspberry Pi Pinout.
Power Supply
The MDB2Pi is powered through the MDB bus (10…42V regulated or unregulated supply) and back-powers the Raspberry Pi with up to 2.5A at 5V. Therefore, no separate power supply is required.
Configuration
- Enable UART and RTC by adding the following lines to /boot/config.txt:
enable_uart=1dtoverlay="i2c-rtc,pcf8563
- Disable serial console output:
sudo nano /boot/cmdline.txt
–> remove the “console=…” parameter
MDB Master and Cashless Device Demo
We provide two demo applications for you to test the MDB to Raspberry Pi integration.
- Install Mono runtime:
sudo apt-get install mono-runtime libmono-system-core4.0-cil
- Get the Demo code:
wget https://secure.abrantix.com/downloads/MDBConverter/MDBConverter.zipunzip MDBConverter.zip
- How to run the Master Demo:
cd MDBConvertermono MDBMasterSimulatorConsole.exe /dev/serial0 115200-> For master operation, please make sure to set the DIP Switch to ON-OFF-OFF-ON-ON
- How to run the Cashless Device Demo:
cd MDBConvertermono MDBCashlessDeviceSimulatorConsole.exe /dev/serial0 115200-> For slave operation, please make sure to set the DIP Switch to OFF-ON-ON-OFF-OFF
Hint: On newer Raspbian releases, the serial port is available as /dev/serial0 – older releases may use dev/ttyAMA0.
Firmware Upgrade
It is normally not required to upgrade the firmware. However, in the rare cases this has to be done we will send you the new firmware. You can then use the following command:
mono FlashUtilityConsole.exe /dev/serial0 <Path to HexFile>
pi@raspberrypi:~ $ sudo hwclock -rThu 04 May 2017 06:22:13 UTC -0.310218 seconds
- Write the RTC:
pi@raspberrypi:~ $ sudo hwclock -w
- RTC Troubleshooting: Check if the chip responds over I2C:
pi@raspberrypi:~ $ sudo i2cdetect -y 10 1 2 3 4 5 6 7 8 9 a b c d e f00: -- -- -- -- -- -- -- -- -- -- -- -- --10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --50: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --70: -- -- -- -- -- -- -- --
- Check dmesg for RTC:
pi@raspberrypi:~ $ dmesg | grep rtc[ 2.937443] rtc-pcf8563 1-0051: chip found, driver version 0.4.4[ 2.943665] rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc0
- Hint: In case that the SuperCap has fully discharged, the daemon might be unable to talk to the RTC at first startup:
pi@raspberrypi:~ $ dmesg | grep rtc[ 2.900119] rtc-pcf8563 1-0051: chip found, driver version 0.4.4[ 2.900403] rtc-pcf8563 1-0051: pcf8563_write_block_data: err="-5" addr="0e," data="03"[ 2.900428] rtc-pcf8563 1-0051: pcf8563_probe: write error[ 2.900459] rtc-pcf8563: probe of 1-0051 failed with error -5
In this case, please wait a few minutes to let the SuperCap recharge, then restart your pi so the RTC daemon can detect the chip again.