{"action":"created","issue":{"url":"https://api.github.com/repos/contiki-os/contiki/issues/1025","labels_url":"https://api.github.com/repos/contiki-os/contiki/issues/1025/labels{/name}","comments_url":"https://api.github.com/repos/contiki-os/contiki/issues/1025/comments","events_url":"https://api.github.com/repos/contiki-os/contiki/issues/1025/events","html_url":"https://github.com/contiki-os/contiki/issues/1025","id":67787494,"number":1025,"title":"CC2538 getting RSSI value","user":{"login":"dazhbog","id":1836262,"avatar_url":"https://avatars.githubusercontent.com/u/1836262?v=3","gravatar_id":"","url":"https://api.github.com/users/dazhbog","html_url":"https://github.com/dazhbog","followers_url":"https://api.github.com/users/dazhbog/followers","following_url":"https://api.github.com/users/dazhbog/following{/other_user}","gists_url":"https://api.github.com/users/dazhbog/gists{/gist_id}","starred_url":"https://api.github.com/users/dazhbog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dazhbog/subscriptions","organizations_url":"https://api.github.com/users/dazhbog/orgs","repos_url":"https://api.github.com/users/dazhbog/repos","events_url":"https://api.github.com/users/dazhbog/events{/privacy}","received_events_url":"https://api.github.com/users/dazhbog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/contiki-os/contiki/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-11T13:50:04Z","updated_at":"2015-04-13T10:17:00Z","closed_at":"2015-04-13T10:17:00Z","body":"Hi all,\r\n\r\nI am trying to get the RSSI value from the CC2538.\r\n\r\nWhen run the following code into the receiving function I get\r\n **RSSI: -104 dBm [0xff98]** sometimes  **RSSI: -105 dBm [0xff97]**\r\nwhich doesn't seem to change when I move the sensor. \r\n\r\n**Code**\r\n```C\r\nprintf(\"RSSI: \");\r\n  if(get_param(RADIO_PARAM_RSSI, &value) == RADIO_RESULT_OK) {\r\n    printf(\"%d dBm [0x%04x]\\n\", value, (uint16_t)value);\r\n  }\r\n\r\n\r\n//UTIL\r\nstatic radio_result_t\r\nget_param(radio_param_t param, radio_value_t *value)\r\n{\r\n  radio_result_t rv;\r\n\r\n  rv = NETSTACK_RADIO.get_value(param, value);\r\n\r\n  switch(rv) {\r\n  case RADIO_RESULT_ERROR:\r\n    printf(\"Radio returned an error\\n\");\r\n    break;\r\n  case RADIO_RESULT_INVALID_VALUE:\r\n    printf(\"Value %d is invalid\\n\", *value);\r\n    break;\r\n  case RADIO_RESULT_NOT_SUPPORTED:\r\n    printf(\"Param %u not supported\\n\", param);\r\n    break;\r\n  case RADIO_RESULT_OK:\r\n    break;\r\n  default:\r\n    printf(\"Unknown return value\\n\");\r\n    break;\r\n  }\r\n  return rv;\r\n}\r\n```\r\n\r\n**[EDIT]**\r\nI tried the following code and it seems to change now, not sure if its still a reliable way of reading the RSSI value.\r\n\r\n**Code**\r\n```C\r\nprintf(\"last_rssi %d\\n\",(signed short)packetbuf_attr(PACKETBUF_ATTR_RSSI));\r\n```\r\n\r\nAny input on the correct way of obtaining the RSSI value would be much appreciated. Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/contiki-os/contiki/issues/comments/92300771","html_url":"https://github.com/contiki-os/contiki/issues/1025#issuecomment-92300771","issue_url":"https://api.github.com/repos/contiki-os/contiki/issues/1025","id":92300771,"user":{"login":"dazhbog","id":1836262,"avatar_url":"https://avatars.githubusercontent.com/u/1836262?v=3","gravatar_id":"","url":"https://api.github.com/users/dazhbog","html_url":"https://github.com/dazhbog","followers_url":"https://api.github.com/users/dazhbog/followers","following_url":"https://api.github.com/users/dazhbog/following{/other_user}","gists_url":"https://api.github.com/users/dazhbog/gists{/gist_id}","starred_url":"https://api.github.com/users/dazhbog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dazhbog/subscriptions","organizations_url":"https://api.github.com/users/dazhbog/orgs","repos_url":"https://api.github.com/users/dazhbog/repos","events_url":"https://api.github.com/users/dazhbog/events{/privacy}","received_events_url":"https://api.github.com/users/dazhbog/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T10:17:00Z","updated_at":"2015-04-13T10:17:00Z","body":"Excelent, thanks George!\r\n\r\nI think for what I need, reading the packet's RSSI that only arrives in my process is more than enough.\r\n"}}