Categories

Makahiya, Week 14.5

Happy new year everyone !

 

During the holidays, I tried to work on the bluetooth chip but I couldn’t get very far. I continued today and I am now able to communicate between the processor and the bluetooth chip. I will continue and try to establish a communication with another device. I also still have some things to fix regarding the server during the rest of the week.

Makahiya, Week 12

Hi,

Since last time, I continued to work with the server. It was possible to upload a file but apparently not to download it, I had to add a view for this (it looks like static files don’t need a view but non static files do). I also wrote a basic client to communicate with the server. I ended up using the websocket-client library and I was able to listen and write to the server at the same time. But while I was testing this, I saw that the sockets would close with no apparent reason. I tried to solve this problem but I didn’t manage to do it yet. Maybe it is some kind of timeout if the communication stays idle but I’m not sure. But the problem seems to come from the server’s side (so not on the client’s)

During the holidays, I will try to investigate it and I will also begin to work with our Bluetooth module. But I will not always have an internet connection which could be a problem.

Tanguy

Makahiya, Week 11.5

Hi,

During the first part of this week, I continued to work on the server. Now the communication between a client and a plant through two websockets is functional and I can take into account if the plant is connected or not. I also added the possibility to upload an audio file to the server.

The server is also deployed at the same place than Breathup’s and websockets are no longer closed after two minutes of idle time. Thanks to hooks, the server is restarted after each git push with the updated code.

For the rest of the week, I will continue working on the server, maybe I will add authentification or write a client.

Tanguy

Makahiya, Week 11

Hi,

During the second part of this week, I continued my work with websockets. First, I made them be able to communicate in both ways (in the beginning, I was only sending data, now I can also receive some simultaneously). Then, I tried again to run gunicorn on Heroku. The problem was that gunicorn needs to the port to use in a config file but Heroku allows to use only one specific port that changes every time to deploy. I found a trick that consists in modifying the config file with sed during the deployment. So I was able to deploy our server on Heroku, but we found later that Heroku closes websockets if you don’t use them during 2 minutes, so as we don’t want to ping the server continuously, we will have to deploy our server elsewhere.

Then, I tried to have multiple websockets concurrently. I wanted each socket to have a different URL, the difference being a number at the end of it. With pyramid, it is easy to dispatch URLs with such variables in it and to use the values of these variables for normal views. But aiopyramid that I use to handle websockets like views doesn’t give access to this information. After a long search, I found the problem to be solvable only by adding a line in the code of the library. Later, I also handled the closing of websockets : it crashed on every disconnection, so when we wanted to reopen a websocket at the same URL, it didn’t work. Now, the websockets are properly closed upon disconnection and can be reopened later without any problem.

Next week, I will continue working on the server.

Tanguy

Makahiya, Week 10.5

Hi,

During the beginning of this week, I worked on the server. We want to be able to forward some commands (like setting a Led’s color) to the plant. We could have the plant polling, but it seems better to use a websocket. I managed to have a websocket working with the websockets library for python, but it didn’t work on Heroku. Indeed, I had one thread running the server and another one opening and running the websocket on another port, but Heroku doesn’t let you open ports.

So I searched a solution to this problem and decided to use gunicorn. It allows handling request asynchronously and it runs a websocket without opening a new port when I test it locally. But unfortunately I didn’t manage to test it on Heroku as I can’t find how to deploy a server with pyramid and gunicorn there.

During the rest of this week, I will continue working on the server.

Tanguy

Makahiya, Week 10

Hi,

I still didn’t have a lot of time with the end of the FH week. I tried to change the server database from sqllite to postgresql, but I hadn’t access to our project on heroku at this point and when I tried to use postgresql on my computer, I didn’t manage to have it work (problems with passwords).

Then, the migration to postgresql broke the continuous integration, so I repaired it by adding alternate config files to allow testing with sqllite. By the way, the strange behavior with the database on heroku doesn’t happen with sqllite on my computer.

Next week, we will try to understand this bug and we will work on the server.

Tanguy

Makahiya, Week 9.5

Hi,

with the FH week I didn’t progress on the project since last week-end. It will be more or less the same for the end of this week although I will probably do some work tomorrow evening.

 

Tanguy

Makahiya, Week 9

Hi,

I initially thought that I would finish the PCB this week, but Sylvain was tired of working on the audio codec and so he wanted to do something else.

So instead, I worked on the server. I began with finishing the tutorial for the pyramid framework. Then I implemented one part of the API : there is a database containing the values for the LEDs and it is possible to update this values with a POST request. I also wrote unitary tests to check if the request contains valid data.

Finally, I set up the continuous integration for the new server branch with gitlab-ci. The current version works but I had to put the build and the tests in the same script, otherwise the tests fail because pytest is not found although it is installed during the build, this is quite strange.

Next week is the FH week, so I will have classes every day on the morning and on the afternoon, which doesn’t leaves a lot of time for ROSE. If I can, I will add other things to the server.

Tanguy

Makahiya, Week 8.5

Hi,

For the beginning of this week, I finished fixing the last details concerning the schematic of the PCB and then I did a first version of the placement.

I also began working on the server, we will use the Pyramid Python framework (like BreathUp). But for now, I only have a Hello World and unitary tests working.

For the rest on this week, I will probably have to fix the placement of the PCB and if it goes well I will do the routing. I will also continue to work on the server.

Tanguy

Makahiya, Week 8

Hi,

I was unfortunately not productive during the end of this week. I waited for some components for the PCB but the commit was pushed earlier today and I had no time to work on it. I also couldn’t find the motivation to place components with the schematic still not finalized.

Next week, work will continue on the PCB.

Tanguy