eriklins / InsideBlue-BLE-Tool

InsideBlue BLE Tool is a cross-platform Bluetooth LE utility. It can scan for BLE devices showing device information and advert payload as well as connect to devices and access GATT services/characteristics.
MIT License
41 stars 10 forks source link

compile instructions #6

Closed bm16ton closed 1 year ago

bm16ton commented 1 year ago

Hello, I use arm64 so trying to compile it from source. New toolchains with different conf files etc always have a steep learning curve for me. I was hoping to be able to use a simple lazbuild command. Unfortunately it just says it cant find the main file, I tried in the ide gui thing and it says cant find main unit. Also not sure how to include the lazarus dependency listed in README. My lazarus etc install seems to be fine I use it to compile versaloons vsgui. Thank you in advance for any possible hints or steps.

eriklins commented 1 year ago

Hello, I'm not familiar with arm64 based stuff, so difficult for me to comment. You would definitely need to compile the SimpleBLE libraries for you target architecture and copy them to where the InsideBlue executable is. Also not sure why it wouldn't find the main unit. It's in main.pas in /src folder.

bm16ton commented 1 year ago

Ha yeah I was confused as well. I did compile the simpleble libs and had copied them over. The other dependency I hadn't tried much with was hoping for a well worded error bout it' if I ever got by the missing main. Tried adding a a arm64 section. Starting a new project in the ide and bringing in all the files at least tried to compile, think iit may have needed the files in specific order and it was starting the compile with the piece that interacts with the python scripts, and failing. Wasn't sure wich option to choose when starting new. They all said things that made them seem non-gui related. Besides versaloon this is only the second project I've seen use lazarus etc. Kinda cool but a lil hard for me to get a grasp on. ill keep on it when I have time. I appreciate your response tho! Cool prpject hhopefully iill get to try it!

bm16ton commented 1 year ago

ok so I uninstalled all lazarus/fpc etc packages (on ubuntu) compiled fpc from debian/ubuntu git (probly didn't need to lazarus has a script for making fpc debs) then git cloned lazarus' used the the compile lazarus into deb script. then edited the deb because mix/matching deb creators lazarus wanted fpc packages by different names.Used the online package mngr to install "richmemo". Then git cloned simpleble and edited cmake to allow shared lib builds. compiled but no libfmt, luckily its just a make command switch "make fmt" copied the resulting .so* files into the insideblue src folder and into a global lib folder (any folder scraped by ldconfig). Didn't add anything from Pascal_simpleble repo because his readme says the required file is in a folder named pascal wich doesn't exist in his repo. The one file simpleble.pas that looks reasonable for what I need, is the same name as a file in this repo so I figured its all done up for us? Now it compiled without error. But the gui is hard to see and the text invisible with almost all ubuntu mate builtin themes (ill hafta look into changing those colors hopefully not so bad) A quick scan shows my ble device no testing done after that. So sourceforge/ubuntu etc shows last major release for lazarus in like 2015, but its git repo has lots of activity up to and including this week, kinda bizarre. I had thought the project dead but apparently not...official repos using extremely old versions doesn't help.

eriklins commented 1 year ago

Yeah, gui rendering looks weird on some Linux/desktop variants. I was quite disappointed about this, had assumed Lazarus/FPC would give a much better cross-platform experience, because this was the initial idea why I decided to give Lazarus a try for my application. Currently giving the SimpleBle Python bindings a try (SimplePyBle), maybe I drop the Lazarus version and re-write with Python, let's see.

bm16ton commented 1 year ago

I never had a problem with python back in version 2 days, but now github/raspberry pi/ etc is littered with the deprecated corpses of python scripts. I never learned python so when I see a python3 script that's 5months old posted sumwhere I know excellent chance it has deprecated calls in it. I've been looking everywhere for a linux ble tool that can do same stuff as nrf connect or light blue does on android, my preference would be written in C but in no way can i rely on python cuz I can't code it and it deprecates so quickly now (all my own short comings) nordic really screwed us all taking bluetooth serial outa the spec, thereby out of the kernel. Although not a permanent solution or solution to all issues caused by that I was glad to see you added a ble serial term to your project, very cool! I'm way more comfortable coding in the linux kernel then anywhere else and getting close to me having to write a kernel driver for ble serial, also should probly look at the ioctls for ble and maybe bypass the libs entirely and just code read/writes for basic tests. Back to my original point afaik this project is the ONLY universal linux gui app for those basic ble read/writes! I only know of 2 apps for setting up a ble-serial connection to an actual /dev/tty one is ble-serial (python but maintained so far) and a cpp dbus app that very elegantly explains the knightmare of the docs/code/methodology of such a thing. Explains why so few exist and fewer actually work. I don't know if anyone has thanked you for your time, effort and skill but truely thank you my friend! This project is a worthy endevour, and very well thought out and implimented. I envy your skills.

eriklins commented 1 year ago

Thanks for the above!

Thought about doing it in C/C++ in the very beginning but was struggling to find a convenient cross-platform solution for that. Closest might be wxWidgets as GUI toolkit plus mingw on Win and GCC elsewhere. Maybe I'll have a look into this again...