api - Arduino+WiFly shield failing to communicate to xively -
i have problem in delivering sensor data xively api via arduino uno v3 , sparkfun wifly shield. problem not in hardware, or in wifly shield library since can deliver data paraimpu server fine.
the fundamental problem xively library not work sparkfun wifly library. relevant declarations (suggested xively in documentation) are:
wiflyclient client; xivelyclient xivelyclient(client);
this not work since wiflyclient declaration expects server , port, hence modified to:
byte server[] = {173,203,98,29}; //api.xively.com ip address wiflyclient client(server,80); xivelyclient xivelyclient(client);
this gives me error on compilation of :
xively_sketch2_aug20a:60: error: no matching function call 'xivelyclient::xivelyclient(wiflyclient&)' /users/paultravers/documents/arduino/libraries/xively/xivelyclient.h:11: note: candidates are: xivelyclient::xivelyclient(client&) /users/paultravers/documents/arduino/libraries/xively/xivelyclient.h:9: note: xivelyclient::xivelyclient(const xivelyclient&)
at point stuck, , attempts modify various libraries try reconcile issue have come no avail - because above skill level , don't know doing.
to round this, have written code build put request , send api, using template of code runs send data paraimpu.
i open connection (either api.xively.com or 173.203.98.29; makes no difference @ stage) , send following :
put /v2/feeds/<feed id redacted>.json host: api.xively.com content-type: application/json user-agent : xively-arduino-lib/1.0 x-apikey: < api key redacted > content-length: 197 {"version":"1.0.0","datastreams" : [{"id":"temperature_channel" , "current_value" : "29.00"},{"id":"light_sensor_channel","current_value":"541.00"},{"id":"alarm_channel","current_value":"0.00"}]}
terminating blank line.
needless have set channels in xively names. not work - don't expected return, , channels don't update. if read returning input on connection long string of numbers. can see wrong in format of request?
i might take @ wiflyclient
's documentation...maybe need set port/etc in other way...than extend wiflyclient
class wiflyclient2 : public wiflyclient { wiflyclient2(int[] ip,int port) : wiflyclient() { //setup parent calling it's functions here } }
then should work like:
byte server[] = {173,203,98,29}; //api.xively.com ip address wiflyclient client(server,80); xivelyclient xivelyclient(client);
note: never use wifly/etc, use arduino...and run troubles :)
Comments
Post a Comment