Categories

BreathUp: PCB, AES, LMIC and LoRa

Hi!

As already explained by Benjamin and Alexandre, we received our PCB. Sadly, they contain some mistakes that will need to be patched and the LoRa part is quite compromised because of that… But anyway, we will do our best during the end of the week to patched them and you will be able to find an update in next Sunday’s post.

I also worked with Alexandre to set up our ChibiOs project, including: configuring the board, the clocks, creating a basic test program…

Eventually, I worked on LMIC and AES. I concluded that we cannot use LMIC’s AES function for the Bluetooth communications and we will therefore create an other one.

For the end of the week I want to work on the patch of the PCB, the basic development on the PCB (LEDs, PWM, UART, shell…) and on LMIC implementation on RFM95W chip that we might use in our PCB patch.

Have a nice end of the week,

Xavier Chapron

BreathUp: Website and Qualification

Hi,

During this week, I worked, as planned, on the website and on the qualification.

Concerning the website, I create some more views and bootstrap them. Therefore it’s not just an API anymore, one can administrate and visualize the status of every devices with just a few clicks on their browser.

Regarding the signal’s qualification, I had implemented last week a first draft of algorithms to localize and count the breathing cycles and heart beats. I improved and cleaned them a lot. One of the major improvement is that they now run on the fly.

In order to test theses algorithms, I wrote some Pythons scripts that plot on figures the original ECG and EMG with the detections and they clearly match.

I’ve therefore wrote an email to our partners to inform them of our progress and to ask them what data do they really want to see in real time on the website and that we should therefore acquire and send via Bluetooth or LoRa.

Eventually, as we will only be able to work on the PCB at the beginning of year, I will spend some time on how LMIC uses AES.

I wish you a merry Christmas.

Xavier Chapron

BreathUp: qualification and tests

Hi!

Contrary to what I said in my last post, I didn’t work on AES during the end of the week.

First, I worked on the qualification of the breathing and heart signals. Because after having them filtered, we need to count the breathing cycles and heart beats. Therefore I created a C script that works pretty well with good signals. I still need to test it on our database, but as the majority of our datas were acquired with different configurations, this might not be as relevant as I want it to be.

Then I worked on the tests, and they are now running on each commit after they are pushed. Configuring the docker to create a postgresql database for our server wasn’t an easy thing to do but it has been done!

During the start of the week, I will continue my work on testing the qualification of the signals and I might work on the front end of the server.

Have a nice week,

Xavier Chapron

BreathUp: a lot of minor things take a lot of time!

Hi!

I feel as I didn’t do so much during the start of the week, even if I spent a lot of time on the project. I’m guessing that this is because I’ve not dedicated my time to one task, but I’ve done different tasks such as:

  • Cleaning the code for LoRa.
  • Testing ACK and OTAA, but without success. As we are moving from TTN network to Obgenious’. Then I will work on this when we will have received the IDs we need.
  • Cleaning a bit our git repository.
  • Configuring a systemd service for our server.
  • Creating a method to get the battery voltage and characterizing its discharge.
  • Spending some time to understand how AES128 works and how it is implemented in LMIC. But I’m not done with this, and will therefore still work on it during the end of the week.
  • Discussing with Alexandre about how we should interface the STM32, the BT module, the android app and the server… That was really exhausting, but we managed to find an agreement.

Eventually for the end of the week, I might take over from Benjamin on the qualification of the signals and I will work on the cryptographic part until we have a secure way to exchange datas between the devices and the server.

Have a nice end of the week,

Xavier Chapron

BreathUp: now emitting from LoRa

Hi!

To start with the good news, the PCB are on their way! We hope to receive them before Christmas.

For the end of the week, I worked on a new LoRa module based on a SX1272 chip. With this chip, I managed to send messages coming from the uart and up to 30 char. I still need to work on the down way (ack and sending message from the server to the device) and on the Over The Air Activation.

I will then still work on LoRa during next week and I should work on its integration with the server.

Have a nice weekend.
Xavier Chapron

BreathUp : PCB and LoRa on the way!

Hi!

Here is what I did during the beginning of the week:

  • I worked on the BOM, because the library is quite outdated and therefore I needed to find real reference for each one of the 166 components of our PCB.  That was a really boring task and as we can’t afford any error, I had to ask Benjamin for a check, then check again… And we found errors…
  • I worked on the server, eventually, we are hosted by Scaleway because Heroku was too restrictfull for our project. As I changed the server from Heroku to Scaleway, Samuel tested it, and discovered some unexpected comportment that weren’t happening on my computer… But I fixed them! Damned JS…
  • I worked a lot on LoRa, and still have an unresolved issue. The main chip register seems to change by itself, without any reason and obviously that’s not expected… As even with the help of Alexis and Samuel we didn’t find any solution, I will from now on work on an other module based on a real sx1272 and not on a Chinese one… I hope to obtain better results!

Eventually, for the end of the week, I really want to be able to send as many messages I want with LoRa. And If I have some time remaining, I will characterize the discharge of our battery.

Have a nice end of the week,

Xavier Chapron

BreathUp : mainly routing and LoRa

Hi!
Once again, I worked on several topics, and therefore I didn’t take the time to finish the LoRa part. Here is what I’ve done:
  • I tested the connectors I found and they will be good enough.
  • I exchanged some pin connections on the schematic to make it easier to route.
  • I did the routing.
  • I worked on LoRa and on LMIC, but that’s still not finished. At the end of Friday, I discovered with Samuel that LMIC use interrupts in an non-orthodox way… They are making spi calls during them. So I need to implement something based on multi-threads, semaphores and mutex to handle this properly…

For next week, I want to finish the LoRa part and as the PCB will be sent to the printer, we will know when he will be sent back to us. Therefore we will work on a new schedule of the tasks to be ready for the final presentation, and that is going to be quite tight…

See you on Wednesday,

Xavier Chapron

BreathUp: some progress on the LoRa part

Hi,

My main tasks of the week are LoRa and the webapp.

I started the week on the webapp. I added some Ajax, Jquery and Jinja2 technologies to improve our website. It used to has an API. It now also has some web pages, with forms and buttons.

I added some HTML with Jinja renderer but they are horrible… I will need to put some Bootstrap on it, but clearly that’s not our top priority…

On the LoRa part, I made some test, and that didn’t work at the first try. I spend the whole Tuesday trying to find why the MISO signal was not responding anything. Finally Alexis gave me the answer that was in the datasheet (I really need to start reading them). In fact I was releasing the SPI bus by raising the NSS signal between each frame of 8 bits. And in the datasheet it’s clearly said that the NSS signal is used as an interrupt by the chip, and between each interrupt we need one frame of address and one frame of data.

Today, I made new tests, the chip tells me that is trying to joined the network, but never send me the confirmation that he has. I’ve some ideas about what might be the issue and I will therefore investigate on it during the end of the week.

I also found the snaps to connect our cable to the electrodes. I will then test how we can use them as connectors. We need to know if they don’t introduce to much noise and if we can solder them to the coaxial cable in a resistant way.

Have a nice end of the week,
Xavier Chapron

BreathUp : schematics, LoRa and webapp

Hi!

During the end of the week I worked on many topics:

  • We spent some time with E-respi to show them our progress, and I hope that they are happy with it.
  • I worked on the PCB:
    • I switched the pins connection of the LoRa and the ADC on the MCU. That looks like nothing, but it was important for Benjamin to create a better placement of our PCB. And that wasn’t so easy because both the ADC and the LoRa need a lot of pins with requirements : SPI, IRQ…
    • I double checked the routing table of the MCU because we can’t afford any error in it.
  • I also spent some time on the webapp :
    • Improving the tests.
    • Refactoring some views.
    • Reading some documentation on Ajax and Jinja2, because I will probably need them in order to use the wep API from a web browser.
  • I’ve spent hours on porting LMIC for ChibiOs on STM32. That’s more difficult than I thought… This is still on progress but I think that I’m getting closer!

Eventually, I will still work on the webapp and on LoRa this week, and I hope to obtain some results!

Have a nice week,

Xavier Chapron

BreathUp: Getting closer for the acquisition part

Hi!

So, Sunday I said that I wanted to improve the server and make some more tests on LoRa and for the beginning of the week, I haven’t really done that…

So what did I do?

First, on Monday I worked with my team mates on a resume of the work that has been done for the project for a presentation we made for our teachers.
Then on Tuesday, I spent a lot of time as a guinea pig to acquire some more ECG and EMG. They are pretty good so we decided to send some of them to E-Respi with a sum up of what has been done. I wrote it with Alexandre and it was quite a long mail to write because writing something with two brains is clearly longer than with one… But we finally sent it and received some encouraging feedbacks. They are real EMG, they are our breathing signals, and they should be clear enough to count the breathing signals and for a doctor to analyze them if necessary.
I’m not saying that they are perfect… We will have huge problems to detect when the patient is moving or speaking and we need to disqualify those moments.
I also spent time on rewriting some Python scripts to filter multiple acquisitions at a time, to export them as csv, to change the acquisition sample time… And they are clearly increasing our efficiency!

Eventually, I did not work so much on the server and the LoRa part, but I might spend more time on it during the end of the week.

See you on Sunday.

Xavier Chapron