Bluetooth Integration with Android

8 posts / 0 new
Last post
mshawky
Bluetooth Integration with Android

Hello I saw the video of connecting rasperry pi to dlms through bluetooth but I can't find any way to find the Serial Port after connecting to the DLMS Probe. How can I achieve that?

Kurumi
Kurumi's picture

Hi,

I believe that you have read this?
http://www.gurux.fi/bluetooth

If you run hcitool can you see your Bluetooth device?
Have you connected your Bluetooth device to serial port using rfcomm?

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

mshawky

Yes I have read this
http://www.gurux.fi/bluetooth

I am not using hcitool.. I connected to my bluetooth device using serial port profile with UUID 00001101-0000-1000-8000-00805F9B34FB and now it is connected but I can't find any com port to connect like the example mentioned

Kurumi
Kurumi's picture

Hi,

For some reason, I didn’t realize you were using Android. Check this:
https://github.com/Gurux/Gurux.DLMS.Android

It uses Gurux serial port for Android:
https://github.com/Gurux/gurux.serial.android

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

mshawky

Hi

I did check the gurux dlms android code it is using gurux serial port through usb host It has no code related to bluetooth connection

I actually have two problems
1. What is the use of the Media Interface and what is the use of getSynchronous() function
2. The steps in GXDLMS client are vague I really cannot go through the steps

and Thanks in advance

Kurumi
Kurumi's picture

Hi,

I'm sorry. Too many questions at the same time. You can't use Android serial port with Bluetooth.

You can use what communication channel to send data. getSynchronous is used to indicate that the received data is reply. If it's not received data is sent through OnReceived-method.

If you know what you want to read from the meter you don't need to read the association view. Until that you need to call all the functions. DLMS is not an easy protocol and you need to establish the connection as implemented client example. You can save the association view and you don't need to read al the data if you don't want to.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

mshawky

Thanks for your answers
I know the questions are too many but I have been stuck for many days regarding this

So the only way I can use Bluetooth with GXDLMS client is to implement my own GXDLMS client after bluetooth connection right?

do I have to implement IGXMedia in case of using Bluetooth?
If not what are the steps because in the Android DLMS Client there are lots of code which is very confusing for me

Kurumi
Kurumi's picture

Hi,

You don't need to do anything for GXDLMSClient. It just generates and parses the bytes. You need to send generated bytes using Bluetooth connection to the meter. When you receive data from the meter you give it to the GXDLMSClient using GetData -method.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi