Category Archives: Programming

Tips on programming technique for Java, JSP, Ruby, C/C++ and shell scripts
Astuces autour de la programmation, java, ruby, C/C++ et script shells bash

SpringBoot webservices full example

SpringBoot is a really efficient framework for creating webservices and much more. For this reason I’m using it to design my backend applications.

This framework is also well referenced on Internet and many people are downloading it and using it. All of this sounds really good and you will see you can make a webservice in less than 5 minutes following the many examples existing on Internet. As usually in this kind of technology once you have made the classical HelloWorld and university classical practices you have a lot of difficulties to make your first real program coupling different simple use-cases. So As I spent a couple of hours searching solution on Internet, this post will give you a full example of a project getting data from a MongoDB instance to provide a simple webservice.

Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Gcc – wrap a function in a closed archive

Here is the situation : you have a function in an archive but you do not have the source code. And you would like to change the behavior of this function or intercept the call to this function.

This is possible with gcc and the -Wl,-wrap linker options. Thanks to this option you can create a new function starting by __wrap_ followed by the function name. This function will be called instead of the original one. In the function you can decide to call the original function by using its name starting by __real_

Continue reading

Posted in Programming | Tagged , | Leave a comment

Update Telecom Design SDK from 5 to 6.3.4

TD1204 / Sigfox & GPS
TD1204 / Sigfox & GPS

New version of the Telecom design SDK has been released for TD1208 / TD1208R / TD1204 and now officially supporting TD1205.

This new version provide some bug fixes, like a crash after 21285 transmissions that could be after 212 days in case of full use… some I had in touch with could be interested… @pioupiou and also a bug that disable gpio interrupt after sigfox transmission (I experimented it !)

For the main evolution, this version is supporting FCC and TD1508 and improving sigfox transmissions.

From my experience, this version is also a good way to decrease the size of your binary files.

This post is about upgrading from a SDK 5 to SDK6 and the impact you can when recompiling your projects.

To install the SDK from scratch, just follow the well documented official post here.

Continue reading

Posted in Programming, sigfox | Tagged , , | 3 Comments

WordPress revolution slider – start an animate on scroll

wordpress-logoThe revolution slider is a way to animate a web page based on a wordpress plugin. When you create a slider it start to be animated directly when the page is loaded. So if your slider is on top of the page it is perfect but if your animation is on the middle / bottom, the animate will be finished when the user will scroll to that part.

It is possible to custom the javascript part and fix this problem as described in this post.

Continue reading

Posted in Programming | Tagged , | Leave a comment

SWD programming using a RaspberryPi

I previously write this post on how to use a BeagleBoneBlack as a JTAG (SWD) programmer. It was fun but really slow. I port my code on RaspberryPI and now what was taken 5-8 hours is a couple of minutes.

To connect the SWD connector to the PI use the following schema

Connect SWD to RaspberryPi
Connect SWD to RaspberryPi

I use this peace of code to reflash my TD1204 and TD1208 based both on EFM32 when bricked after unsuccessful update…

Here is the python file to interact with SWD :

I hop it will be soon integrated in the main PySWD project as the previous one.

You should check or modify file

import array

from PirateSWD import *
from RpiGPIO import *
from SWDCommon import *


def main():
    busPirate = RpiSWD("", vreg = True)
    debugPort = DebugPort(busPirate)
    efm32     = EFM32(debugPort)

To run the Flash program, just launch

# ./ ../myProgram.bin


Posted in Programming, sigfox | Tagged , , , , , | 4 Comments

Manage sigfox device for consumer deployment

sigfoxWhen you plan to deploy / sell sigfox based solution to consumer, you have to manage you device park. The sigfox network have a restricted radio medium to ensure you will not emit more than what you payed for you will be charged by them if a device you own is emitting, even if it is emitting out of your control. There is no network subscription like in 3G before being able to emit so anyone can emit.  That is why, to ensure every one is clear, you have an extra cost if you emit more than you are allowed or if you emit from a non registered device.

When you are designing end-user system you have no control on the device and if you propose a monthly fee to use your solution you will never sure the end user will unplug it once he stop to pay for your service. It means you could have a consumer stopping to pay for your service but a device continuing to emit and sigfox request you to pay for it.

Since the network allow you to have downlink message, now you have the capability to send order to your device and as a consequence allowing you to kill the device remotely. This is a good solution !

Next you have a new scenario where your end user finally decide to reuse your service and want to reactivate the device. At this step you won’t be able to communicate with it and you will have to find another way to reset its state to normal. You can eventually add a “factory reset” button or request to reflash it. There is another funny when : playing with the reboot time.

This post will describe how to lock a device to stop emit on network and how to play with the startup sequence to reset it. Read more !

Continue reading

Posted in Programming, sigfox | Tagged , , , , | 4 Comments

Download Arduino 1.5.8 Beta for Mac Os X

arduino_logoAfter having update my Mac Os X, the java 6 have been removed and unfortunately Arduino request to use it. Personally I’m not really happy to install this not even more supported version of Java on my machine.

I was looking for the 1.5.8 Beta made for Java 7. I was not able to download it as the download stops in the middle even if I have a really good transfer rate at the beginning.

It seems that there is no mirror for Arduino (waouhou !! what that sh*t ?!?) and it seems this download problem is not really new. Here is the solution obtained from here. Use command line curl program:

curl -LOGC -

The last step to be able to use it is to install Java from

Posted in Programming | Tagged , , | Leave a comment

Telecom Design sdk – track your stack usage

When trying to see what is happening with your code, you could try to follow stack size and current running time. Here is a simple function for doing the work :

void dsk_printDebug() {
#ifdef DEBUG
    uint64_t time;
    uint32_t msec, t;
    uint16_t hour, min, sec;
    time = TD_SCHEDULER_GetTime();

    msec = time & 0x3FFF;
    time >>= 15;
    t = time;

    sec = t % 60;
    t = t / 60;
    min = t % 60;
    t = t / 60;
    hour = t % 24;
    t = t / 24;

    #ifndef __ICCARM__
        extern char __cs3_stack[];
        char *limit=__cs3_stack;
        extern char CSTACK$$Limit[];
        char *limit = CSTACK$$Limit;
        uint32_t *sp = (uint32_t *) __get_MSP();

    tfp_printf("[debug] Time:%d.%02d:%02d:%02d.%3d || Stack size : %d / %d \r\n",
        (uint32_t) t, hour, min, sec, (msec * 1000) >> 15,
        ((uint32_t)limit - (uint32_t)sp), CONFIG_STACK_SIZE
Posted in Programming, sigfox | Tagged , , | Leave a comment