Hi,
I’ve managed to connect my Intel Edison to Thinger using the linux client. When I try and run even basic tests by adding resources to the main.cpp though I am getting compilation errors, e.g. digitalPin or digitalWrite not declared.
What am I missing, do I need to include some more libraries? Are there more examples of how to create resources using the linux client? I’m just trying to read the state of a digital pin in the code below.
Cheers
M.
#include "thinger/thinger.h"
#define USER_ID "xxx"
#define DEVICE_ID "xxx"
#define DEVICE_CREDENTIAL "xxx"
int main(int argc, char *argv[])
{
thinger_device thing(USER_ID, DEVICE_ID, DEVICE_CREDENTIAL);
// define thing resources here
thing["Float"] >> digitalPin(3);
thing.start();
return 0;
}
root@HydroPo01:~/Linux-Client-master# ./run.sh
-- OpenSSL Version: 1.0.1m
-- Configuring done
-- Generating done
-- Build files have been written to: /home/root/Linux-Client-master/build
Scanning dependencies of target thinger
[ 50%] Building CXX object CMakeFiles/thinger.dir/src/main.cpp.o
/home/root/Linux-Client-master/src/main.cpp: In function 'int main(int, char**)':
/home/root/Linux-Client-master/src/main.cpp:36:35: error: 'digitalPin' was not declared in this scope
thing["Float"] >> digitalPin(3);
^
CMakeFiles/thinger.dir/build.make:62: recipe for target 'CMakeFiles/thinger.dir/src/main.cpp.o' failed
make[3]: *** [CMakeFiles/thinger.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/thinger.dir/all' failed
make[2]: *** [CMakeFiles/thinger.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/thinger.dir/rule' failed
make[1]: *** [CMakeFiles/thinger.dir/rule] Error 2
Makefile:118: recipe for target 'thinger' failed
make: *** [thinger] Error 2
[4229521.095000]: Not connected!
[4229521.307000]: Connecting to iot.thinger.io:25202 ...
[4229522.467000]: Connected!
[4229522.467000]: Authenticating...
[4229522.614000]: Authenticated!