Broken BC127 Melody BLE db gen tool (I like to add the Battery GATT service)

Hey,

I like to add some GATT services like battery for my BC127. If I get it right, I need to setup the GATT database by adding the battery service(0x180F) and the battery characteristic(0x2a19). So I ended up with

https://source.sierrawireless.com/resources/airprime/tools/bc127-melody-ble-db-gen/

But sadly this tool is broken on my Ubuntu 19.04 or Windows 10(64Bit).

On both systems I got following error:

“OSError: db_gen/bin/Release/libdb_gen.a: invalid ELF header”

or

wrong executable format on Windows.

at line: “db_gen_lib = CDLL( …” in ble_database.py

Any ideas how to overcome this problem

Yes! There is another post on this forum where a user said they were able to use this on Win10 with Python2.7. So, I tried this and it also failed for me. However, I did some digging on the error:

windowserror: [error 193] %1 is not a valid win32 application

And on StackExechange there is an unrelated post where someone was having a similar issues. The resolve was to use the 32 Bit (x86) version of Python. I am running x64 Windows 10 machine.

I uninstalled my x64 version of Python, I installed Python 2.7.18 (x86) version and tried again. I’m happy to report that the db_gen.dll now works with the provided ble_database.py file.

Please try a 32 bit version of python for this!!!