BreathUp: LoRa and global integration


During this week we eventually get the Objenious keys to register our devices on their LoRa network. Therefore I worked again on LoRa, and there are great improvements. Indeed, Over The Air Activation, ACK and downlink messages are now working. Sadly, there are still some difficulties with Objenious network and even with a LoPy device, the connection isn’t reliable and it is therefore highly probable that we will stay on the TTN network that is more reliable.

With the possibility to send downlink messages to a device, comes major improvement for our project because we will now be able to make it work fully without an Android device. Therefore we now need to integrate everything including the device initialization, the device reinitialization for a new patient, the configurations changes during the monitoring of the patient and of course the report upload with both Bluetooth and LoRa but with preference for Bluetooth witch is cheaper and faster.

Eventually, I will still work on integration during the end of the week.

Xavier Chapron

BreathUp: LoRa, integration and strange behavior


During this end of the week, the project have seen great improvement, as we have put together all the different part of the project that was developed separately.

I first worked on LoRa, and we are now able to send messages to TTN network from a PCB. This wasn’t as easy as expected. Indeed, I encounter two major difficulties. First, an incompatibility between the SPI driver and the SD driver because of DMA shared channels witch forced us to make an hard version of the SPI driver.  Then we (I was coding with Samuel) found out that there might be an issue in the stm32 because when we set the SPI configuration to send 8 bits, it’s sending 16, so we find a way to send our 8 bits by asking the stm to send only 4bit, but that’s quite dirty…

Then I worked on the complete integration of the communication from the PCB and to the PCB, containing the creation of a report, ciphering it, trying to send it via Bluetooth, deciphering it while on the server and all the way backward with a new configuration of the device coming from the server.

Then I worked with Benjamin on the integration of the SD drivers, the filters and the qualification algorithms. After some unexplained problems, we finally find a way to make it work. Then I worked on the test on the filters and the qualification, they are now tested with the code and configuration that will be put on the PCB, and not another file. We can therefore change easily some parameters and be sure that everything will be ok on the PCB.

Eventually, during the IMU driver development and during the implementation of LoRa and the qualification algorithms on the PCB, I have found an still unexplained issue, changing value when they are passed to a function as parameter. The dirty fix I found is to allocate them as static values. then they are stored in the bss and the issue doesn’t happen. It looks as a stack overflow, but we didn’t find any other proof of this…

This week will be the last week before the project evaluation, and therefore I will work again on the global integration. I might also try to use the Objenious network for LoRa instead of the TTN one.

Xavier Chapron

BreathUp: I2C, IMU, LoRa, Qualification, Cipher


During the end of the week I worked mainly on the IMU. It uses I2C, and I had never worked on it. Therefore I first needed to make myself familiar to this protocol. And this is done.

Then I had to send correct requests from the MCU, and this is also done and checked with a logic analyzer.

But the final part, is to receive correct responses from the IMU. And this is still not the case and I still don’t know why and will therefore investigate on it during the beginning of the week.

I also implemented on our PCB the LoRa driver (not tested since we don’t have a LoRa chip for the moment), the qualification and the cipher part that had been prepared.

Eventually during the next week I will work on the IMU and on the LoRa.

Have a nice week,

Xavier Chapron

BreathUp: PCB, AES, LMIC and LoRa


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: a lot of minor things take a lot of time!


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


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!


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

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


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


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