RoseOnRails – solder and code!


Still soldering…  Yes, we have a HUGE amount of leds (607) and consequently a whole lot of tiny pieces of ledstriop to solder with tiny pieces of wire. So all four of us have been working on it for a few days now, hoping that we’ll be able to finish it soon.

Apart from that, I tried to find some time to work on my code for our central station. I don’t recall if I had already mentioned, but Hubert kindly implemented the multi-slave functionality in BLueLib therefore I can easily use several connections in one thread (or more). However, while discussing with Sam, he told me that the programming language I’ve been using so far (namley C) is not perfectly apropriate and that Python (for instance) is much more well-suited fr this kind of application (above al for the “intelligence” part of the application which is in charge of verifying that the user commands are compatible with the current configuration of the circuit). Later on, while discussing with Alexis about the same subject, he too strongly recommended the use of Pyhton instead of TCP sockets in C.

Being a bit confused about all this new information (I don’t yet know Python very well, so I still can’t “feel” to what point it’s user-firendly, interfaceable and portabe..), I asked more details on the mailing list and received a lot of good explanation from Sam, Aexis and Matthieu. Now, I’m pretty sure I’ll use a websocket-based connection between the server and the smartphones (users) – coded in Python, an application using BluLib for the BLE connection between the server and the train circuit  – implemented in C, and an application that represents the “intelligence” of the game – coded in Python. C and Python will then be interfaced (with sockets or other useful tools). However, I’ll talk to Sam about this again tomorrow just to make perfectly sure about everything and then start to change my current code… and above all learn Pyhton!

See you guys!

PS: Thanks to all of the groups who helped us today with the soldering 🙂

RoseOnRails – ble and client/server

Hello all!

Today, I mainly worked on BLE. I started by “discovering” BlueLib, how it was done, and how it could be used. I looked at the example program get_ble_tree (that prints the tree of services, characteristics and descriptors of a BLE connection in a file), to better understand how the code to use BlueLib should be structured. I also tried to add some functionalities to better understand the code (like the possibility to specifiy the hciX local adapter and the macaddress by user, etc.)

Then I tested ge_ble_tree with the nrf example application (the famous LEDButtonSerivce). It worked perfectly well. In fact, once you know how to use it well, BlueLib is actually very handy, and far more useful to my mind, than gatttool, for instance (thanks @Paluche 🙂 !)

Then, I started to program a client/server application for the communcation between the user and the central station. Later on, the client will be the Android user. But for now, I did a simple version where the client is simply an application that opens a TCP socket towards the server. The latter then receives the commands from the client through this TCP socket. Once this was done, I started to use BlueLib to make the server establish BLE connection, disconnection, to print the ble-tree in a file, and to let the user write/read/notify/indicate values to/from characteristics. For this, I wrote a treat-command function that parses the command entered by the client to find out if it’s a connect/disconnect/write etc., and take into account the variables (mac address, local ble adapter, value to write, etc.) For now, it’s not fully finished, but I will very probably finish it tomorrow so that we can start to implement our custom service(s) on the nrf…

See you soon!