Android Question Read the data transmitted by Bluetooth Laser Telemeter

Fabio68

Member
Licensed User
Hi, I'm creating an application that calculates the amount of material necessary for the construction of certain construction works. The program, after entering the data relating to height and length in the text boxes to obtain the surface and perimeter of a wall, displays the relative results in two specific labels and at the same time displays all the necessary material in a list and the quantities thanks to a calculation that I impose on them by carrying out specific mathematical formulas. So far so good, the application works wonderfully and I achieved the goal but, I would like to be able to enter the data using a Bluetooth laser rangefinder, instead of doing it manually. The one in my possession is from a famous brand which provides itself with an application that I have installed on my mobile phone and works correctly. I tried to modify an application found in the forum in a test program, the point is this: after starting the app the device connects but, when I start the measurement, nothing happens.
I attach the copy of the test program and I hope you, please, can give me a tip on the matter. I state that I am not a programmer but I have a passion for computer science and the B4A language helps me a lot. Thank you in advance

Fabio
 

Attachments

  • Test Bluetooth.zip
    507.9 KB · Views: 179

imbault

Well-Known Member
Licensed User
Longtime User
Can you give the reference of the device you are using? and links to provided programming documentation
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
Do you have a piece of code, you received with the device? whatever the language
 
Upvote 0

Fabio68

Member
Licensed User
No no code, the application they give is connected to the device and shows the reading in a text label.
The test application that I prepared manages to connect to the device but when I read from the rangefinder it does not read the data, I think it is due to the fact that something is missing in my code to be able to do it.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
try using the nRF App to check the data..

then use the BLE example to start dev your App B4X
 
Upvote 0

Fabio68

Member
Licensed User
try using the nRF App to check the data..

then use the BLE example to start dev your App B4X
Thanks for your help. I will let you know....
 
Upvote 0

emexes

Expert
Licensed User
Better late than never šŸ» and might be useful for other people trying to connect to Bosch laser distance measuring devices via bluetooth too :

https://www.eevblog.com/forum/proje...0-laser-measuring-tape/msg1331649/#msg1331649

Re: Hacking the Bosch GLM 20 Laser Measuring Tape
Reply #4 on: October 24, 2017, 02:44:49 pm

These commands work with Bosch PLR15 serial port

send frame: [startbyte][command][length]([data])[checksum]
receive frame: [status][length][...][checksum]

Get serialnumber: C006004A
Get "firmware" version:C00400BA
Backlight ON:C0470020
Backlight OFF:C0480062
Laser ON:C0410096
Laser OFF:C042001E
Start measure:C04000EE

Example measure:
send C04000EE ->reply 00 04 13 0E 00 00 32
Change endianness
distance in mm=0x00000E13*0,05=180mm

Max measurement rate is about 4 times per second

Unknown commands:
C0030074 reply->000100AE

First byte in reply is status:
0x00 -> OK
0x01 -> communication timeout
0x03 -> checksumerror
0x04 -> unknown command
0x05 -> invalid accesslevel
0x08 ->harware error
0x10 ->device not ready
(0D=invalid accesslevel + harware error)
 
Upvote 0
Top