Raspberry write to DataBucket


#1

Hello,

When I would like to compile on my RaspberryPi th following code

==================================================
//thing.start();
double last_check = 3;
double elapsed_time = 0;
time_t end;

    while(1)
    {
        thing.handle();
        end = time(NULL);
        elapsed_time = double(end - last_check);
        if(elapsed_time >= 3)
        {
            last_check = double(end);
            thing.stream(thing["DeviceDateTime"]);
            thing.stream(thing["LoraDataStream"]);
            thing.write_bucket("LoraDataStream", elapsed_time);
            cout << elapsed_time << endl;
        }
    }
    return 0;

==================================================

I got the Following Error

/opt/PST-Smartcity/thinger_client/src/main.cpp: In function ‘int main(int, char**)’:
/opt/PST-Smartcity/thinger_client/src/main.cpp:728:23: error: ‘thinger_device {aka class thinger_tls_client}’ has no member named ‘write_bucket’; did you mean ‘to_socket’?
thing.write_bucket(“LoraDataStream”, elapsed_time);
^~~~~~~~~~~~

Which Library do I need to include to get knowwn the thing.write_bucket() function

Many thanks

Roman


#2

Hello,

I got the Answer right now…

When installing the Thinger Client on Raspberry Pi with the Following Command
git clone https://github.com/thinger-io/Linux-Client.git thinger_client
you will missing the write_bucket Function
you need to download the Following Sources
https://github.com/thinger-io/Client-Core/tree/master/src
and place it in the thinger_client/src/thinger/core Folder

Then the Compilation will work fine

Is there a reason why these sources are not in the main branch?

Many Thanks


#3

We are going to update the Linux clients quite soon with some new features. In the meantime, it is better to replace the thinger/thinger.h source code from the Arduino Libraries (which is the most recent one):

Best.