{"action":"created","issue":{"url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands/issues/1","repository_url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands","labels_url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands/issues/1/comments","events_url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands/issues/1/events","html_url":"https://github.com/ppedro74/Arduino-SerialCommands/issues/1","id":306135864,"number":1,"title":"SoftwareSerial and WifiESP","user":{"login":"andrekiba","id":12699760,"avatar_url":"https://avatars2.githubusercontent.com/u/12699760?v=4","gravatar_id":"","url":"https://api.github.com/users/andrekiba","html_url":"https://github.com/andrekiba","followers_url":"https://api.github.com/users/andrekiba/followers","following_url":"https://api.github.com/users/andrekiba/following{/other_user}","gists_url":"https://api.github.com/users/andrekiba/gists{/gist_id}","starred_url":"https://api.github.com/users/andrekiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrekiba/subscriptions","organizations_url":"https://api.github.com/users/andrekiba/orgs","repos_url":"https://api.github.com/users/andrekiba/repos","events_url":"https://api.github.com/users/andrekiba/events{/privacy}","received_events_url":"https://api.github.com/users/andrekiba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-17T07:27:10Z","updated_at":"2018-03-17T15:35:46Z","closed_at":null,"author_association":"NONE","body":"I and thanks in advance. Nice idea this library but it doesn't work with SoftwareSerial and WifiEsp.\r\nCan you confirm this? Otherwise can you provide a working example?\r\nI tried something like this without success.\r\n\r\n```c++\r\nSoftwareSerial wifiSerial(2, 3);\r\n\r\nchar serialCommandBuffer[32];\r\nSerialCommands serialCommands(&wifiSerial, serialCommandBuffer, sizeof(serialCommandBuffer), \"\\r\\n\", \" \");\r\n\r\nvoid unrecognizedCmd(SerialCommands* sender, const char* cmd)\r\n{\r\n  Stream* serial = sender->GetSerial();\r\n  serial->print(\"ERROR: Unrecognized command [\");\r\n  serial->print(cmd);\r\n  serial->println(\"]\");\r\n}\r\n\r\nvoid execHelloCmd(SerialCommands* sender)\r\n{\r\n  sender->GetSerial()->println(\"Hello!\");\r\n}\r\n\r\nvoid execLedOnCmd(SerialCommands* sender)\r\n{\r\n  digitalWrite(13, HIGH);  \r\n  sender->GetSerial()->println(\"Led is on\");\r\n}\r\n\r\nvoid execLedOffCmd(SerialCommands* sender)\r\n{\r\n  digitalWrite(13, LOW);  \r\n  sender->GetSerial()->println(\"Led is off\");\r\n}\r\n\r\nSerialCommand helloCmd(\"HELLO\", execHelloCmd);\r\nSerialCommand ledOnCmd(\"ON\", execLedOnCmd);\r\nSerialCommand ledOffCmd(\"OFF\", execLedOffCmd);\r\n\r\nvoid setup()\r\n{\r\n  Serial.begin(115200);\r\n  wifiSerial.begin(9600);\r\n\r\n  WiFi.init(&wifiSerial);\r\n\r\n  status = WiFi.beginAP(ssid, 10, pass, ENC_TYPE_WPA2_PSK, true);\r\n\r\n  server.begin();\r\n\r\n  serialCommands.SetDefaultHandler(unrecognizedCmd);\r\n  serialCommands.AddCommand(&helloCmd);\r\n  serialCommands.AddCommand(&ledOnCmd);\r\n  serialCommands.AddCommand(&ledOffCmd);\r\n}\r\n\r\nvoid loop()\r\n{\r\n  WiFiEspClient client = server.available();\r\n  if (client)\r\n  { \r\n    if (client.connected()) \r\n      serialCommands.ReadSerial();\r\n    delay(10);\r\n    client.stop();\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands/issues/comments/373929158","html_url":"https://github.com/ppedro74/Arduino-SerialCommands/issues/1#issuecomment-373929158","issue_url":"https://api.github.com/repos/ppedro74/Arduino-SerialCommands/issues/1","id":373929158,"user":{"login":"ppedro74","id":13179560,"avatar_url":"https://avatars0.githubusercontent.com/u/13179560?v=4","gravatar_id":"","url":"https://api.github.com/users/ppedro74","html_url":"https://github.com/ppedro74","followers_url":"https://api.github.com/users/ppedro74/followers","following_url":"https://api.github.com/users/ppedro74/following{/other_user}","gists_url":"https://api.github.com/users/ppedro74/gists{/gist_id}","starred_url":"https://api.github.com/users/ppedro74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppedro74/subscriptions","organizations_url":"https://api.github.com/users/ppedro74/orgs","repos_url":"https://api.github.com/users/ppedro74/repos","events_url":"https://api.github.com/users/ppedro74/events{/privacy}","received_events_url":"https://api.github.com/users/ppedro74/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T15:35:46Z","updated_at":"2018-03-17T15:35:46Z","author_association":"OWNER","body":"The original SoftwareSerial has poor performance and is very sensitive to code implementations (e.g delays and other code logics). \r\n\r\nyou can read more here:\r\nhttps://www.pjrc.com/teensy/td_libs_AltSoftSerial.html\r\n\r\nI did an example: \r\nhttps://github.com/ppedro74/arduino-playground/blob/master/SerialSoftwareTest/SerialSoftwareTest.ino\r\n\r\nusing both SoftwareSerial and AltSoftSerial (commented) and both libraries are work with my Arduino UNO."}}
{"actor":{"display_login":"ppedro74"}}