{"action":"closed","issue":{"url":"https://api.github.com/repos/TMRh20/RF24/issues/190","repository_url":"https://api.github.com/repos/TMRh20/RF24","labels_url":"https://api.github.com/repos/TMRh20/RF24/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/TMRh20/RF24/issues/190/comments","events_url":"https://api.github.com/repos/TMRh20/RF24/issues/190/events","html_url":"https://github.com/TMRh20/RF24/issues/190","id":125793968,"number":190,"title":"Problem with my code","user":{"login":"joihn","id":11663917,"avatar_url":"https://avatars.githubusercontent.com/u/11663917?v=3","gravatar_id":"","url":"https://api.github.com/users/joihn","html_url":"https://github.com/joihn","followers_url":"https://api.github.com/users/joihn/followers","following_url":"https://api.github.com/users/joihn/following{/other_user}","gists_url":"https://api.github.com/users/joihn/gists{/gist_id}","starred_url":"https://api.github.com/users/joihn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joihn/subscriptions","organizations_url":"https://api.github.com/users/joihn/orgs","repos_url":"https://api.github.com/users/joihn/repos","events_url":"https://api.github.com/users/joihn/events{/privacy}","received_events_url":"https://api.github.com/users/joihn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TMRh20/RF24/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-10T02:28:57Z","updated_at":"2016-02-20T18:16:52Z","closed_at":"2016-02-20T18:16:52Z","body":"I'm trying to create an instant messenger using 2 arduino and NRF24L01 chips.\r\nhere's the problem with my messenger : most of the time, the receiver doesn't receive the message, and sometime he receive it but everything is mixed up, like a bad encoding error...\r\n\r\nhere is the code: http://pastebin.com/TP53VyeH\r\n```\r\n#include <SPI.h>\r\n#include \"RF24.h\"\r\n\r\nbyte addresses[][6] = {\"1Node\", \"2Node\"};\r\n\r\nchar character;\r\nint incomingByte = 0;\r\n/****************** User Config ***************************/\r\n/***      Set this radio as radio number 0 or 1         ***/\r\nbool radioNumber = 0;\r\n\r\n/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */\r\nRF24 radio(7, 8);\r\n/**********************************************************/\r\n\r\n\r\n// Used to control whether this node is sending or receiving\r\nbool role = 0;\r\n\r\n\r\nString message = \"\"; //message variable, empty until a message come\r\n\r\n\r\nvoid setup() {\r\n\r\n  Serial.begin(115200);\r\n  radio.begin();\r\n  radio.setPALevel(RF24_PA_LOW);\r\n  if (radioNumber) {\r\n    radio.openWritingPipe(addresses[1]);\r\n    radio.openReadingPipe(1, addresses[0]);\r\n  } else {\r\n    radio.openWritingPipe(addresses[0]);\r\n    radio.openReadingPipe(1, addresses[1]);\r\n  }\r\n  Serial.println(F(\"welcome in messenger\"));\r\n  Serial.println(F(\"enter a message\"));\r\n}\r\n\r\nvoid loop() {\r\n\r\n  while (Serial.available()) { //getting message from the serial\r\n\r\n    character = Serial.read();\r\n    message.concat(character);\r\n    delay (10);\r\n  }\r\n\r\n  if (message != \"\") {     //if there is a message, we send it\r\n    radio.stopListening();\r\n    Serial.print(\"you sent : \");\r\n    Serial.println(message);\r\n    if (!radio.write( &message, sizeof(message) )) {\r\n      Serial.println(F(\"failed\"));\r\n      message = \"\"; // reset the message variable\r\n    } else {\r\n      message = \"\";   // reset the message variable\r\n    }\r\n  }\r\n  radio.startListening();\r\n  while (radio.available()) {                          // While there is data ready\r\n    radio.read( &message, sizeof(message) );             // Get the payload\r\n  }\r\n  if ( message != \"\") {       //if we received a message, display it\r\n    Serial.print(\"friend sent : \");\r\n    Serial.println(message);\r\n    message = \"\"; //reset the message\r\n\r\n\r\n  }\r\n  delay (250);\r\n  message = \"\";   //reset the message\r\n\r\n}\r\n```\r\n(for one of the board, you have to change the number on line 10)\r\n\r\nps : if I try the \"GettingStarted_HandlingData\", everything work fine, so the problem isn't my arduinos...\r\n\r\nmaybe the nrf24l01 can't transmit string ?\r\n\r\nThank you very much for your useful library."}}