{"action":"created","issue":{"url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu/issues/1","repository_url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu","labels_url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu/issues/1/comments","events_url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu/issues/1/events","html_url":"https://github.com/sudomesh/disaster-radio-nodemcu/issues/1","id":225563266,"number":1,"title":"no multiline lua command line via TCP due to node.output() not redirecting error output","user":{"login":"Juul","id":122752,"avatar_url":"https://avatars0.githubusercontent.com/u/122752?v=3","gravatar_id":"","url":"https://api.github.com/users/Juul","html_url":"https://github.com/Juul","followers_url":"https://api.github.com/users/Juul/followers","following_url":"https://api.github.com/users/Juul/following{/other_user}","gists_url":"https://api.github.com/users/Juul/gists{/gist_id}","starred_url":"https://api.github.com/users/Juul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Juul/subscriptions","organizations_url":"https://api.github.com/users/Juul/orgs","repos_url":"https://api.github.com/users/Juul/repos","events_url":"https://api.github.com/users/Juul/events{/privacy}","received_events_url":"https://api.github.com/users/Juul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-02T00:44:42Z","updated_at":"2017-05-02T11:59:55Z","closed_at":null,"body":"We're currently using the custom-written interpret.lua to implement a lua command line. It is however sub-optimal since it can only handle single-line input, whereas the normal nodemcu serial terminal can handle multi-line input.\r\n\r\nYou're supposed to be able to use node.input() and node.output() from the nodemcu api to inject input to the interpreter but I was running into an issue where error output would still appear on the serial terminal after calling node.output() and would not be sent to the node.output() callback. \r\n\r\nLooking at the nodemcu code it looks like all calls to puts are defined to be calls to c_puts and c_puts is defined as calls to output_redirect().\r\n\r\noutput_redirect is part of the nodemcu `node` api module in `app/modules/node.c` and it simply checks if the output has been redirected (with a call to node.output) or not and if not it sends it to `uart0_sendStr()` which is a function in the uart driver `app/driver/uart.c`. \r\n\r\nI can see nothing wrong with this code so now I suspect it might have been an async error where node.output was called to un-redirect the output prematurely (before the error output occurred). More testing needed."},"comment":{"url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu/issues/comments/298615430","html_url":"https://github.com/sudomesh/disaster-radio-nodemcu/issues/1#issuecomment-298615430","issue_url":"https://api.github.com/repos/sudomesh/disaster-radio-nodemcu/issues/1","id":298615430,"user":{"login":"Juul","id":122752,"avatar_url":"https://avatars0.githubusercontent.com/u/122752?v=3","gravatar_id":"","url":"https://api.github.com/users/Juul","html_url":"https://github.com/Juul","followers_url":"https://api.github.com/users/Juul/followers","following_url":"https://api.github.com/users/Juul/following{/other_user}","gists_url":"https://api.github.com/users/Juul/gists{/gist_id}","starred_url":"https://api.github.com/users/Juul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Juul/subscriptions","organizations_url":"https://api.github.com/users/Juul/orgs","repos_url":"https://api.github.com/users/Juul/repos","events_url":"https://api.github.com/users/Juul/events{/privacy}","received_events_url":"https://api.github.com/users/Juul/received_events","type":"User","site_admin":false},"created_at":"2017-05-02T11:59:55Z","updated_at":"2017-05-02T11:59:55Z","body":"Redirecting the error output now seems to be working. We could try switching it back to using the the built-in multiline lua interpreter and see if it works."}}
{"actor":{"display_login":"Juul"}}