{"action":"closed","issue":{"url":"https://api.github.com/repos/ediazal/sky-boards-collect/issues/1","labels_url":"https://api.github.com/repos/ediazal/sky-boards-collect/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ediazal/sky-boards-collect/issues/1/comments","events_url":"https://api.github.com/repos/ediazal/sky-boards-collect/issues/1/events","html_url":"https://github.com/ediazal/sky-boards-collect/issues/1","id":125448276,"number":1,"title":"Problem reactivating sensors in collect_view_arch_read_sensors","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ediazal/sky-boards-collect/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/ediazal/sky-boards-collect/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/ediazal/sky-boards-collect/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-07T17:40:31Z","updated_at":"2016-01-07T22:46:11Z","closed_at":"2016-01-07T22:46:11Z","body":"```\n\nIn this test program \n\nhttp://code.google.com/p/sky-boards-collect/source/browse/trunk/contiki/examples\n/sky/test/test-DS1000.c \n\nthere is no problem with running SENSORS_ACTIVATE _after_ a previous \nSENSORS_DEACTIVATE, it works without problems. However, in collect-view, this \nwill cause the node to sends repeatly the same CO value, so I guess that once \nSENSOR_DEACTIVATE is executed first time, SENSORS_ACTIVATE won't work in \nsuccesive calls.\n\n\n// This code will send always the same CO value to sink\nvoid collect_view_arch_read_sensors(struct collect_view_data_msg *msg)\n{\n\tSENSORS_ACTIVATE(ds1000); // sky adc12 config (sky-sensors.c)\n  \tmsg->sensors[CO_SENSOR] = ds1000.value(SENSOR_CO);\n\tSENSORS_DEACTIVATE(ds1000);\n}\n\nI solved this issue doing this:\n\nchar sensors_activate=0;\nvoid collect_view_arch_read_sensors(struct collect_view_data_msg *msg)\n{\n\tif (!sensors_activate){\n  \t\tSENSORS_ACTIVATE(ds1000);\t\n\t\tsensors_activate=1;\n\t}\n  \tmsg->sensors[CO_SENSOR] = ds1000.value(SENSOR_CO);\n}\n\nBut I don't like this, because it doesn't really solve the problem. And it is \nvery inefficient.\n\ncollect-view-z21.c apparently have the same problem, because it is only \ninitilized.\ncollect-view-sky.c works ok.\n\nAny ideas?\n\n```\n\nOriginal issue reported on code.google.com by `eldial@gmail.com` on 8 Aug 2012 at 11:58"}}