Categories

Take Me Home, Country Roads

I hear her voice
In the mornin’ hour she calls me
The radio reminds me of my home far away
And drivin’ down the road I get a feelin’
That I should have been home yesterday, yesterday

Hello World!

Since Wednesday, I have been exiled in my lovely little village: Pernes les Fontaines. However, this is no excuse to stop working and enjoy the beautiful weather of Provence. So when I arrived, I immediately brought out my computer and all my cables, and now there is an official branch of the A406 in the South of France.

My main task was to implement all the BLE services and characteristics on the drop. For now, there is one service (Drop) and two characteristics (Message Command and Box Command). The Message Command characteristic has already been explained with schematics in a previous post, but since there has been some changes, I will publish an updated version soon. But the code behind the scene is now working thanks the amazing work of Lauriane on DropFS. I heavily tested the message commands (and the called DropFS functions) with gatttool, because I don’t have a phone with BLE. Fortunately, I took some time to develop a web interface to help me writing requests and parsing responses (don’t care about the design, this is just a developer tool !!).

Message Command Generator

This tool helped me a lot to test all the functions, and check if nothing had been broken when I made some changes in the code. And good news: we now have a working version of the Message Command characteristic, which supports the basic operations (create, read, update, delete) and returns potential error codes.

I also started to work on the Box Command characteristic. But there is still a lot of work to do in DropFS, so I keep this task in background and I update the code as soon as new functions are added by Lauriane.Another job was to migrate to SDK 4.4.2. As I explained in my previous post, we had a bad surprise because we received an outdated and very buggy version of the nRF51822. So we had to rollback to a previous version of the SDK and I performed this migration (otherwise, the drop was simply not working, so we couldn’t test anything!).For the next days, I have a lot of items in my todo list! I have to think about a way to handle long messages (for the moment, we can’t write messages longer than 13 characters). I also have to add new commands and characteristics to reflect the functions that Lauriane is adding in DropFS. And above all, I have to find all the easter eggs before my brother tomorrow.

May the force be with you!

I just came to say hello

Kinda like this thing but there’s something you should know
I just came to say hello

Hello World!

What a touching moment. Our first drop (Drop65) just said “Hello”.

Hello Drop

It was not an easy journey to make it work. We came through doubts, tears and despair. But we finally got it. We got a sign of life from our dear and beloved drop.

We encountered many problems before achieving this. First, we noticed that the nRF chip was a very old revision, with its bunch of bugs. So we had to downgrade to a previous version of the nRF SDK compatible with this revision. Then we tried to test a simple program using BLE, but the drop was not even advertising (whereas the same program was working on the development board). Next, we decided to test another program directly using the radio (without BLE), but again it did not work on the drops. Finally we tried to replace the 32MHz quartz with a 16MHz quartz (so that we had the same clock than on the development board). And guess what… it worked! We can now see our drop advertising! However, we still don’t know why it was not working with the 32MHz quartz, but it seems that there is a bug with this quartz frequency in our chip revision.

May the force be with you!

Code must go on

On and on, does anybody know what we are coding for?

Hello World!

In my last post, I described the toughness and the cruelty of the arguments which cheered our last week up. Until Wednesday, the fight kept on, and then we finally managed to start coding again. What a relief!

So on Wednesday we dispatched the work like this: Adele will work on the lowest level by writing the code to communicate with the Flash, Lauriane will be in charge of the DropFS code, and I will personally take care of the BLE layer and the different services. I started to write the code for parsing the Message commands (I will publish an explanation of the architecture very soon).

On Friday, we had our presentation which was appreciated. However we had some remarks about our pricing, so we need to think a bit more about this subject before our final presentation. Then, we had one more big discussion about the DropFS organization, and especially how to handle the synchronization between the drops and the phones in our KTA app. Now we have a very interesting and strong system, with a lot of good properties. I know Adele is preparing some schematics to explain all that, so stay tuned!

This week end, I had no time to work on the project, but tomorrow I will be back again, because code must go on!

May the force be with you!

Back to ROSE

We only said goodbye with words
I died a hundred times
You go back to her
And I go back to…..
I go back to us

Hello World!

Yes, I’m back. Sith Lords are not as powerful as they used to be, so kicking them out of the galaxy has been easier than expected.

Last week end and on Monday, I worked a lot on the Drop Scanner app. I had to learn many things (Scala, Android, Scaloid) and to dive in the code Lauriane had written. When I began to understand how the code was working, I changed a little bit the interface. No breakthrough, but this helped me to put my hands in the code. There are still a lot of things to improve about the UI and the UX. Also, some bugs remain and have to be fixed as soon as possible!

Yesterday, I also started to think about the memory organization. We will have a Flash memory, which means that we have to spread the write requests across the pages not to wear them too fast. So I began to search for existing Flash file systems, in order to take some good ideas. Especially, I found UBIFS and JFFS2 which are popular Linux flash file systems. In the end, I designed a brand new flash file system, called DropFS (stands for Deluxe Rather OPerational File System). We still have to think about a few issues, but the global architecture looks solid. I will explain the whole design in a few days with gorgeous schematics. Stay tuned!

Finally, we decided to think again about our use cases, and clarify them in order to know what we really need to implement in our drops. I was assigned to think about the Cairn use case (the one for hikers). I wrote a little text explaining how the user would use the app, but above all I made an interactive mockup of the app, showing the different screens and interactions. Check it out!

May the force be with you!

The end

This is the end
Beautiful friend
This is the end
My only friend, the end

Hello World!

Today, I’ve to announce you something big, really big. I am not talking about BLE.  I am not talking about Scaloid. I am not even talking about my dear and tender nRF51822.

No, today I am talking for the last time. It was a hard decision to make, but it was necessary. I decided to cease my involvement in the Drops N’ Roses project. I decided to quit ROSE.

I’ve thought a lot about this. Of course, I can’t forget my two coworkers and friends, Adèle and Lauriane, who will have to carry my burden for the rest of the project. Neither can I forget the other groups, and their amazing ideas. May they succeed, all of them.

If I decided to quit ROSE, this is because my place is not here. I felt a disturbance in the Force, something I have not felt in a long time. The Jedi Order is calling me. I have to join them, and fight the return of the Sith Lords.  I have to defend the galaxy, our galaxy.

And you, dear readers, I will miss you a lot. But I will still exists, somewhere else. I will not forget you.

Goodbye, and may the force be with you!

Message in a bottle

I hope that someone gets my
Message in a bottle

Hello World!

On Tuesday, I finished to refactor the LedButton example code. This way, I had reliable foundations on which I could start developing new custom services. Before that, I tested the refactored version with gatttool, and it was working as well as the original one!

The next step was to develop the Message Service. I presented a first architecture to my group:

Message Service v1 - Readarchitecture1_write

We implemented this architecture on Wednesday. I wrote the code for the Bluetooth service, while Adele was handling the persistent storage in RAM. In the end, we had a working prototype and we successfully managed to test it with gatttool.

However we discovered several drawbacks:

  • when we want to write a value, its content is notified even if we don’t want to need it;
  • the maximal length of a notification is 20 characters, so we may need an additional step to read the full message;
  • above all, there are too many exchanges in both read and write operations!!

So yesterday, we argued a lot about the best way to solve this problem. We had many ideas:

  • remove the notification and always perform an additional read request;
  • give with the id characteristic a special bit indicating whether we want to be notified;
  • remove some ACK if we really need to save battery;
  • have two services (ReadMessage and WriteMessage) with different behaviours;
  • have one service with one characteristic and parse the written command in order to infer the operation to perform.

We finally agreed on the last solution. Lauriane will implement it this week end (so that she can put her hands in the code). Personally, I will work on the Android app which is not yet fully functional. I have already read some slides about Android development and browsed the Android developers website. I still have to learn Scala, and then read the code Lauriane has already written.

May the force be with you!

P.S. : yes our logo is official now!!

It’s a kind of magic

This race that lasts a thousand years
Will soon be done.

Hello World!

Yesterday and today, I kept on working with my nRF51822. On Wednesday, I had managed to do some advertising. Now I wanted to add a custom service.

First, I found a very useful and detailed PDF in the nRF51822 documentation, explaining how to build a simple LedButton service. Another device can write a characteristic to switch on or off the led, and the board notifies the other device when the button is pressed. Quite simple it looks! However this basic service requires a lot of code to work. So today I finished a first complete version, which has the good property to be compilable!!

But the hardest part was to actually test the program. I needed another BLE device to display the list of the services, and to read or write some characteristics. Unfortunately, I couldn’t make the Bluetooth dongle work on Linux (I tried everything Yann explained later in his post, but without success). I also tried to use a BLE scanner app on Lauriane’s Nexus 4, but the behaviour was a little unpredictable (it’s a kind of magic…): for example, I had to restart the phone in order to refresh the service list… Then I tried my program with a Nexus 5 (thanks Thomas!). Unfortunately, the behavior was also kind of magic: this time, I managed to get a notification from the board, but it happens once out of ten tries. So tomorrow I will try with another device, perhaps a Windows computer with the Nordic debug software installed on it (yeah I’m hopeless…).

May the force be with you!

Advertising space

No one learned from your mistakes
We let our profit s go to waste
All that’s left in any case
Is Advertising space.

Hello World!

Since this week end, I have continued to work on the nRF51822. On Sunday, I tried to write my first program from scratch. My goal was to get a blinking led. But I added a little challenge: I had to use timers, so that I could start to dive into the nRF51822 documentation, and especially the API of the SoftDevice. Fortunately, the doc is well written, and it was quite easy to light a led, and then to use timers in order to make it blink.

On Monday, I took a little break. I didn’t advance on the nRF51822, but I helped some of the other students to flash their boards. I also tested with Lauriane her Android app, and good news: it was able to recognize my nRF51822 advertising (however it was the example program).

Yesterday, I decided my goal of the day would be to write from scratch a program able to advertise (no services for the moment). It was a little harder than the led, but I was able to find some inspiration in the advertising program, especially for the BLE parameters I had to setup and the order of initialization of all the modules. In the end, I had a working program and I tested it with Lauriane’s Android app: it showed a device name “Drop” (screenshot is coming)!! Now my next goal is to add a service (for example, showing the state of a button or of a led). I will start working on it today or tomorrow.

May the force be with you!