Categories

BreathUp: presentation and final changes

Hi,

As expected, I made some improvements of the server code and on the qualification of the breathing signals. I also made a lot of tests, and the project definitely works as expected.

Eventually, I worked and will continue to work with my teammates on Friday presentation.

Xavier Chapron

BreathUp: Tests and cleanup

Hi,

During the end of the week I spend most of my time testing the device and cleaning our code.

During this week I will mainly work on Friday’s presentation and maybe make some minor changes on the PCB or Server code.

Have a nice week,

Xavier Chapron

BreathUp: getting some acquisition…

Hi,

During the first part of the week I worked mainly on acquisition, because they are not as good as we wanted them to be. Indeed, after finding an interesting configuration of the ADS on Monday, we find out that he need a really stable power supply. Therefore we need to change our filters to removes artifacts that would prevent us to use any qualification algorithms.

I have made some tests and found a way to clean the ECG signal. I will therefore make some real situation tests with them tomorrow morning and I hope to be able to merge a alpha version onto master at the end of the day.

Eventually, I will then work on clean up and on a beta version with proper handling of the LEDs, the IMU and maybe a qualification of the EMG.

Have a nice end of the week.

Xavier Chapron

BreathUp: Integration of communication and acquisitions

Hi,

During the end of the week I ended my work on the integration of the LoRa and the Bluetooth, and also worked on the way the configuration is download by the device, how it’s stored, what happens on a reboot of the device… All seems as functional as we want it to be.

Then we made some acquisition with the PCB and try to study them to find out why we don’t have breathing signals on them but on only a beautiful ECG.

Eventually, I made some more Python tool to process easily our acquisitions and to examine them.

During this week I will work on acquisitions, global integration and code cleaning.

Xavier Chapron

BreathUp: LoRa and global integration

Hi,

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

Hi,

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: IMU, low-power and making a box

Hi,

During the start of the week I implemented an IMU driver that give us the gravity vector and a way to evaluate if the patient is moving or not.

I also created a first version of the box that will host the PCB and the battery. That was my first 3D printing and it is not gorgeous, but I’m still happy with it.

Finally, I started looking at the RTC driver and the low-power modes of our STM, but there is still a lot of thing to do on this subject.

Eventually, during the end of the week, I will work on the global integration of all the drivers we have produced and I will continue my work on the low-power modes.

Xavier Chapron

BreathUp: I2C, IMU, LoRa, Qualification, Cipher

Hi,

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: Clocks, USB, UID and battery level

Hi,

I started the week by finding out why our quartz wasn’t oscillating. Indeed, we had configured it as an oscillator and not as a quartz in the MCU registers…

Then I worked on the USB and was quite blocked by an hard fault until Samuel found out that this was due to a too old version of my toolchain. I still can’t believe that it was possible to compile without any warning  even though the generated binary was wrong…

With the USB working, I was able to implement a shell and a function to get a unique id from the STM. It will help us to have different device id while flashing the same code! And I also implement a basic function to get the battery level with one of the STM ADC. It still needs to be test and calibrated.

Eventually, I worked on the start of the drivers for the ADS and the IMU and this should be one of my main job for the end of the week.

Xavier Chapron

BreathUp: AES, PCB, and debug

Hi!

During this end of the week, I worked on the AES and implement C and Python functions that encrypt and decrypt messages using AES128 CTR mode and they work pretty well.

I also worked on our PCB, and implemented some code to drive the LEDs with PWM.

We also discovered another problem: the quartzs are not oscillating, and as we need the 25MHz one for the USB, we still can’t use printf() to debug our drivers, witch makes thing a bit trickier. Therefore, while we are looking for a way to use the quartz, I worked on Segger Real Time Transfer (RTT) that should allow us to debug the code on the STM, but this is not working for the moment.

Eventually, during the beginning of the week I will work on RTT and on the quartzs.

Have a nice week,

Xavier Chapron