Temboo works with Spark

Hello fellow sparkies. I know that a few of you were trying to work with Google Spreadsheets and other web services. I was not able to get it to work reliable see also my blog http://bentuino.com/google-polls-spark-core/ However I was able to port the Temboo Arduino Library to Spark. For detailed instructions see http://blog.temboo.com/

The code is available on Github https://github.com/Bentuino/temboo

Polling a Spark Core from Google in regular intervals requires the core to be powered on. However, using the Temboo solution Spark can push the measurements to Google Spreadsheets and then completely shut down. This way the power consumption is dramatically reduced.

Temboo also supports an incredible amount of internet services that are all very easy to be controlled from your Spark.

10 Likes

Temboo looks pretty cool. Thank you for sharing! This will definitely make it easier to integrate with other services.

I’m thinking I can set up a Spark to monitor my living room and can post to Facebook when my wife walks away and leaves the TV on for hours. I’ll embarrass her into remembering to turn it off!

4 Likes

Cool, thanks for sharing! I look forward to projects that use this! :slight_smile:

Can this be used with the Web IDE?

2 Likes

I have not tried this. However with the new Web IDE library feature released it might not be to hard to do. Then everyone could use it. It depends on how restrictive the guidelines for community libs are and how close the temboo is to this. I am not sure I can do this in the next few days. But maybe someone from the community steps up.

I was too tempted to try make the library available to the community in the web IDE. Looks like it will work but right now there is an issue in the firmware (see also https://community.spark.io/t/why-is-this-line-in-spark-wiring-ipaddress-h-commented-out/4836/6) that is fixed but appears not yet being released in the Web IDE. I will keep an eye on this and once the fix is included in the web IDE I will let you know.

3 Likes

I am still working on the Temboo library to compile under IDE. The latest SPARK FIRMWARE V0.2.3 (JUNE 17) firmware release now fixed the type issues with IP addresses. However I am still having issues with c-source code not getting upladed as part of the library (see my post here https://community.spark.io/t/c-source-files-not-picked-up-during-library-import/5260 ).

Some progress, by renaming the .c file to .cpp the library import works and I was able to successfully test the Temboo access with the Spark Cloud IDE. So starting from Temboo library version 1.2.7 everything works. This makes it now pretty easy to use Temboo in the cloud. There are two examples included that demonstrate gamil and google spreadsheet applications.

2 Likes

I’m having some trouble with this Temboo library. I forked the APLICATION_GXLS and after adding my own Temboo info, I tried to compile and it failed with this error:

In file included from ../inc/spark_wiring.h:29:0,
    from ../inc/application.h:29,
    from Temboo/Temboo.h:32,
    from Temboo/Temboo.cpp:87:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/strstream:51:0,
from Temboo/Temboo.h:69,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
In file included from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/char_traits.h:39:0,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/ios:40,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/strstream:53,
from Temboo/Temboo.h:69,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from Temboo/ChoreoInputSet.h:26:0,
from Temboo/Temboo.h:76,
from Temboo/Temboo.cpp:87:
Temboo/TembooGlobal.h:29:0: warning: "pgm_read_byte" redefined [enabled by default]
#define pgm_read_byte(address) (*address)
^
In file included from Temboo/Temboo.cpp:87:0:
Temboo/Temboo.h:29:0: note: this is the location of the previous definition
#define pgm_read_byte(address_short) (*address_short)
^
In file included from ../inc/application.h:29:0,
from Temboo/Temboo.h:32,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected unqualified-id before 'const'
min(const _Tp& __a, const _Tp& __b)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected initializer before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected unqualified-id before 'const'
max(const _Tp& __a, const _Tp& __b)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected initializer before 'const'
In file included from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/char_traits.h:39:0,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/ios:40,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/strstream:53,
from Temboo/Temboo.h:69,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:5: error: 'std::min' declared as an 'inline' variable
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:5: error: template declaration of 'const _Tp& std::min'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:242:7: error: expected primary-expression before 'if'
if (__comp(__b, __a))
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:242:7: error: expected '}' before 'if'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:244:7: error: expected unqualified-id before 'return'
return __a;
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:5: error: 'max' declared as an 'inline' variable
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:5: error: template declaration of 'const _Tp& max'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:263:7: error: expected primary-expression before 'if'
if (__comp(__a, __b))
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:263:7: error: expected '}' before 'if'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:265:7: error: expected unqualified-id before 'return'
return __a;
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:266:5: error: expected declaration before '}' token
}
^
make: *** [Temboo/Temboo.o] Error 1

Any suggestions for how to troubleshoot?

Just want to check, are you using the cloud compiler or a locally installed toolset?

I’m using the web IDE.

I got reports from several users of this problem and finally found some time to look into this.

I was trying to recompile my original temboo examples and I get the same error. The examples use to compile and are now broken. This seem to be a compiler/library problem that was introduced with updates to the Spark SDK.

I don’t have a local spark compiler installation handy to debug it further. Maybe someone from the Spark Team has some insights what could cause the problem.

Hmm, I’ll add an issue for us to check this out. – looks like maybe it’s an issue with “strstream” being deprecated?

Thanks!
David

From the errors above you need to un-define the Wiring min and max macros to avoid a name conflict before including any libraries that may have their own min and max methods.

#undef min
#undef max

I know that @mdma will be fixing this in the future.

1 Like

Hi @bko I too am trying to bring my temboo apps back to life. If all I was supposed to do was add those two lines to the top of the sketch, I’m afraid my error message didn’t change. Was there something more I needed to do?


In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from Temboo/Temboo.h:32,
from Temboo/Temboo.cpp:87:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/strstream:51:0,
from Temboo/Temboo.h:69,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
#warning \
^
In file included from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/char_traits.h:39:0,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/ios:40,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/strstream:53,
from Temboo/Temboo.h:69,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from Temboo/ChoreoInputSet.h:26:0,
from Temboo/Temboo.h:76,
from Temboo/Temboo.cpp:87:
Temboo/TembooGlobal.h:29:0: warning: "pgm_read_byte" redefined [enabled by default]
#define pgm_read_byte(address) (*address)
^
In file included from Temboo/Temboo.cpp:87:0:
Temboo/Temboo.h:29:0: note: this is the location of the previous definition
#define pgm_read_byte(address_short) (*address_short)
^
In file included from ../inc/application.h:29:0,
from Temboo/Temboo.h:32,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected unqualified-id before 'const'
min(const _Tp& __a, const _Tp& __b)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:193:5: error: expected initializer before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected unqualified-id before 'const'
max(const _Tp& __a, const _Tp& __b)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected ')' before 'const'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:216:5: error: expected initializer before 'const'
In file included from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/char_traits.h:39:0,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/ios:40,
from /opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/backward/strstream:53,
from Temboo/Temboo.h:69,
from Temboo/Temboo.cpp:87:
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:5: error: 'std::min' declared as an 'inline' variable
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:239:5: error: template declaration of 'const _Tp& std::min'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:242:7: error: expected primary-expression before 'if'
if (__comp(__b, __a))
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:242:7: error: expected '}' before 'if'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:244:7: error: expected unqualified-id before 'return'
return __a;
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:5: error: 'max' declared as an 'inline' variable
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:260:5: error: template declaration of 'const _Tp& max'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:263:7: error: expected primary-expression before 'if'
if (__comp(__a, __b))
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:263:7: error: expected '}' before 'if'
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:265:7: error: expected unqualified-id before 'return'
return __a;
^
/opt/gcc_arm/arm-none-eabi/include/c++/4.8.4/bits/stl_algobase.h:266:5: error: expected declaration before '}' token
}
^
make: *** [Temboo/Temboo.o] Error 1

Hi @techbutler

The undef lines have to come before any include lines in the file. If that’s already the case, then you may need to turn off the Spark preprocessor and include application.h after the other includes.

No change I’m afraid. Same errors… this is what the top of the sketch now looks like:

#pragma SPARK_NO_PREPROCESSOR

#undef min
#undef max

#include "Temboo/Temboo.h"
#include "TembooAccount.h" // contains Temboo account information
#include "application.h"

OK so I had a look at the library on github and it includes application.h bring back in the definitions for min and max that are screwing things up.

I also found it in TembooSession.cpp

I put in a pull request for @kkaiser to review on github–hopefully you guys can test out this fix.

If this gets resolved I’d love to know. I’m a new user to the spark community and was just trying to get Temboo to work and couldn’t figure out what I’ve been doing wrong. Just did a search here and found that apparently the web interface is broken… Really interested in getting this working - would appreciate any help!

Thanks,

Evan

Is there any way to compile for Temboo with the current state of the tools?