Categories

BreathUp, Android – Bluetooth – Time

Good Evening,

Since Wednesday, I have continued to work on the application and after some tests I found an error about the way I used to handle the thread of the service. So, after to speak with Sam, I decided to change how I made it and used a conditionVariable. I also split the application to put on a new app the part about the Bluetooth Server, I used that to make tests. I also modified a little bit the design of the application.

Friday, with my team-mates, we made some checks about our progress and we decided to do some changes. Indeed, now, it is the application which will send the time to the device,thanks to the Bluetooth connection, instead of the Lora chip. So, the application could receive different kind of requests sent by the device. The device could send a report, ask the parameters’ setup, and ask the time. To do that I modified a little bit the structure of the application. I need to make tests to valid that. At the same time, I changed the error codes which are sent to the device in order to have a response which have always the same length.

Eventually, the next week, I will finish with the treatment of the time requests and the other kind of requests. It is implemented but not tested. I need to implement a remote device which send different requests. I will use the work of Alexandre to do that on the Olimex E407 or on own PCB if the Bluetooth module works on. After, I will work to handle the time in order to have signals which match with a time to file them.

Have a nice week!

Benoît

BreathUp, New requests!

Hi !

Like I wrote in my last post, I worked on the integration of the new requests in the app. Indeed, thanks to the Bluetooth connection, the remote could send bytes instead of chars. To do that I created a class PostRequest with OkHttp package. The main difficulty was to understand how make the request because I would like sending only bytes in the body and I did not know which content-type was the good. Moreover, there was a mistake on the server because it wanted 19 bytes instead of 18. So, I did not understand why my request was bad with the error 400 and I spoke with Xavier to be agree with him on the post request. Now, that is ok. I also modified a little the structure of the app to be able to handle bytes.

Now, the application seems to be ok, I just need to clean up and I could work on the IMU.

Bye,

Benoît

BreathUp, Bluetooth interfacing and Post Request

Good Evening!

During this end of the week, I spent my time to interface the Bluetooth Application with the code which made by Alexandre in order to connect the smartphone to the Bluetooth unit and do long exchanges. After some problems and tests, the two devices are interfacing.

Since yesterday, Xavier has changed the encryption’s algorithm and the server request. I have began to switch the two Get requests to Put requests, but I will finish that next week.

Before the interfacing of the Bluetooth, I spent few times on the IMU driver to understand how the I2C communication works .

Have a nice week,

Benoît

BreathUp, Works during holidays

Happy New Year!

I hope you spent good times for Christmas and the New Year’s celebrations!

During holidays, I carried on the application. Indeed,

  • I put the Bluetooth connection in a service to do that in background.
  • I modified the Bluetooth Server to be able to simulate a remote device.
  • I handle it to start and stop the service’s thread.
  • like the server’s API has been modified, I had to changed how I made requests.
  • I made tests to find bug and correct them.
  • I changed a little bit the UI.
  • I reviewed and cleaned the code.

Now, about the application, I will work with Alexandre to make tests and modified some parameters which will be modified with the new encrypt program. Indeed, encrypted messages will not have the same length. And to split the key and the message, I need to know their length.

Benoît for BreathUp

BreathUp, Week 12

Good evening,

During this end of week, I worked again with Alexandre on the Bluetooth interface and made tests. Now, thanks to the apps, the Bluetooth module can send a request to the server and receive its answer. I will handle that, thanks to a service, to do that in background. About the requests to the server, I decided to make Get requests with the OkHttp class which is easier to use.

I also work on the continued integration. But for that, on the server which makes tests, I need an Android SDK.Therefore, Sam will install it his server.

As you know, it is Christmas holidays. I don’t know when I could post. So, during the holidays I think I will do several short posts.

Have a happy Christmas Holidays,

Benoît

BreathUp, Bluetooth exchanges

Hi everybody,

Monday with Alexandre, we worked together to test our works and know if the app could exchange data with the Bluetooth module. That was conclusive. After that, the steps was the thought about the communication between the device and the server. There were debates with Alexandre and Xavier about that and its security. Thanks to that, we have established a “protocol” between the different elements. Therefore, I  have begun its implementation for the app. Therefore, I will continue to work on during the end of the week.

Simultaneously, I also worked on sending http requests to the server and giving back the answer. To do that, Xavier explained me how generate valid encrypt messages with a python script. I also continued to develop the Bluetooth server to be able to do tests and work alone. I took some times in order to clean the code, remove bugs and add commentaries.

This week, PaulGWF organized “Rose Events”. He put forward us to do a secret Santa and a dinner together. Those were good moments together and cool. So, thank you PaulGWF and others.

Benoît for BreathUp.

BreathUp, week 11

Hi everyone,

During this last days, I finished implimenting the Bluetooth server to test an connexion between two devices and it has worked. Indeed, the application can send and receive data.

As I said in the last post, I worked to make a http request. The application can do a GET and receive the answer.

Therefore, the next step, it is to interface the application and hardware Bluetooth unit with Alexandre. I have begun to think about that. But I will have to talk with Alexandre to choose the best solution.

That’s all.

Benoît for BreathUp

BreathUp, Some advancements

Good-Evening,

Since Sunday, I have made some progresses about the Android Application. Indeed, after spent lots of time to understand why the application could not discover remote devices with smartphones which used Marshmallow version and later. The problem was, in addition to the permissions about Bluetooth, to use Bluetooth connexion, I had to add the “Access Coarse Location” permission.

After that issue was solved, I progressed step by step to make a connexion between two devices. I began to set up a communication between a client which used the Android application and another device which used native Bluetooth Service.

However, that not allow me to manage data which was exchanged by the devices. Therefore, I implemented a Bluetooth server in order to watch if the client received data from the server and if it could send data. Now, the server accepts a connexion but my implementation to send and receive data does not work. I need to review how Inputstream and OutputStrean work. ( I am going to do this evening).

I think, during the next part of the week, I could finish with the Bluetooth and begin to send request to the server which made by Xavier. (If I will not be blocked by an other problem 🙂 ).

Have a good week.

Benoît for BreathUp.

BreathUp, Android Application Work In Progress

Hi everyone,

As I found some bugs in the application, I decided to make time in order to clean my code and check it to delete all bugs I could find.

Like my own smart-phone has a problem with the touch screen, Alexis lent me a new smart-phone: a Motorola G4. However, when I use this device, I can’t detect new devices which do not pair with the Motorola G4. So, I spent time to understand why but it was a fail. Whereas, with a Samsung S3, my application works. I am going to investigate.

Therefore, now I need to test my code with different devices to understood what does not work. I had to create a connexion and send/receive datas to test I can manage a connexion. After that, I will make a TCP request to transfer  bluetooth datas to the server.

Have a good week,

Benoît

BreathUp, week 9

Hi everyone,

During this end of week, I was not very efficient. Indeed, the application did not progress a lot. I identified some bugs in my code and I corrected some of them. There is still a bug, I identified it but I have not understood why that generate an error. I still investigate. However, I worked on the bluetooth connexion but like I found the bugs, I stopped that to correct the bugs. So I could not tests that part. I had some problem with the UUID, because my understanding of that was wrong. That is why I made some researches to understand what it is and which one I will use.

Friday, with my teammates, we met E-Respi to present our progress and speak about algorithms they had to give us.

For the next week, my main task will be the application again. I hope to be more efficient.

Have a good week,

Benoît for BreathUp