{"action":"created","issue":{"url":"https://api.github.com/repos/JvanKatwijk/eti-stuff/issues/37","repository_url":"https://api.github.com/repos/JvanKatwijk/eti-stuff","labels_url":"https://api.github.com/repos/JvanKatwijk/eti-stuff/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/JvanKatwijk/eti-stuff/issues/37/comments","events_url":"https://api.github.com/repos/JvanKatwijk/eti-stuff/issues/37/events","html_url":"https://github.com/JvanKatwijk/eti-stuff/issues/37","id":303008782,"number":37,"title":"[WIP] eti-cmdline: FIFO controller file","user":{"login":"lars18th","id":9989964,"avatar_url":"https://avatars1.githubusercontent.com/u/9989964?v=4","gravatar_id":"","url":"https://api.github.com/users/lars18th","html_url":"https://github.com/lars18th","followers_url":"https://api.github.com/users/lars18th/followers","following_url":"https://api.github.com/users/lars18th/following{/other_user}","gists_url":"https://api.github.com/users/lars18th/gists{/gist_id}","starred_url":"https://api.github.com/users/lars18th/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lars18th/subscriptions","organizations_url":"https://api.github.com/users/lars18th/orgs","repos_url":"https://api.github.com/users/lars18th/repos","events_url":"https://api.github.com/users/lars18th/events{/privacy}","received_events_url":"https://api.github.com/users/lars18th/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-07T08:40:41Z","updated_at":"2018-03-07T09:51:09Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nThis is a Work-In-Progress. But I like to know your opinion about this idea:\r\n\r\n- After a lot of trials with the objective of a \"remote\" control for the `eti-cmdline` tool (mainly for changing the frequency) I found a \"simple\" solution. The solution is to add support for a **FIFO contoller file**. This file is passed as a parameter to the tool and when it exists you can send control commands. The protocol will be identical to the well known RTL_TCP (5 bytes for each packet, first byte the 'cmd' and the last four bytes an int32 as 'param'). So, when your send to this FIFO the command for changing the frequency, the tool will change the value _internally_. This file can be a FIFO file or a '3' PIPE between two programs (note that even file descriptors 0,1,2 exists for STDOUT, STDIN & STDERR I/O streams, you can use upper values like '3' if you like).\r\n\r\nHere some comments about this solution:\r\n\r\n- If you don't use this file nothing changes, so it will be transparent and not disturbing.\r\n- Using this solution, and when `eti-backend` and `DABlin` (or others) will have support to this, then you can run something like `eti-cmdline -c /tmp/eti-cmd.sock | dablin -x /tmp/eti-cmd.sock`. And you have the option for changing the frequency.\r\n- As the protocol is unidirectional, the client process needs only to write 5 bytes in the control file for sending a command.\r\n- In the `eti-cmdline` is only required to check regulary if new data comes to the control file. You can read it from time to time, so you don't disturb threads.\r\n- And finally the `eti-cmdline` requires that all driver handlers implement the corresponding functions for changing the frequency at any time.\r\n\r\nI hope that you will agree with this approach this time. Your comments are welcome. The idea is to put this into practice on my own.\r\n\r\nAnd regarding the question _Why you need to change the frequency instead of restart the tool?_ the answer is: _Because restarting will consume a lot of time. Specifically using the RTL_TCP driver this implies more than 1 second only for reconnecting to the server. Plus the time to restart the eti-cmdline process. So sending only a message to change the frequency will be much more efficient_.\r\n\r\nRegards.\r\n"},"comment":{"url":"https://api.github.com/repos/JvanKatwijk/eti-stuff/issues/comments/371084081","html_url":"https://github.com/JvanKatwijk/eti-stuff/issues/37#issuecomment-371084081","issue_url":"https://api.github.com/repos/JvanKatwijk/eti-stuff/issues/37","id":371084081,"user":{"login":"lars18th","id":9989964,"avatar_url":"https://avatars1.githubusercontent.com/u/9989964?v=4","gravatar_id":"","url":"https://api.github.com/users/lars18th","html_url":"https://github.com/lars18th","followers_url":"https://api.github.com/users/lars18th/followers","following_url":"https://api.github.com/users/lars18th/following{/other_user}","gists_url":"https://api.github.com/users/lars18th/gists{/gist_id}","starred_url":"https://api.github.com/users/lars18th/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lars18th/subscriptions","organizations_url":"https://api.github.com/users/lars18th/orgs","repos_url":"https://api.github.com/users/lars18th/repos","events_url":"https://api.github.com/users/lars18th/events{/privacy}","received_events_url":"https://api.github.com/users/lars18th/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T09:51:09Z","updated_at":"2018-03-07T09:51:09Z","author_association":"NONE","body":"Hi @JvanKatwijk ,\r\n\r\nThank you for your comment! I'm glad to hear it. :smile: \r\n\r\nRegarding your suggestions:\r\n\r\n1. The use of a listening socket, in my personal opinion, is less elegant and more complex to implement. For sure, it will be more flexible. But using an _unidirectional_ protocol it's in fact irrelevant. If you need to use the network, then you can use tools like NetCat or SoCat to achive it. In any case I'll review the example 6. Perhaps I'll modify my opinion.\r\n\r\n2. Instead of adding a new thread, just to receive only control commands, my idea is to use the main thread. The checking of new commands can be done only time to time. Perhaps each 100ms (10 times a second). So, this doesn't disturbs any other process. What you think?\r\n\r\n3. My concern now is about the \"re-tune\" when changing the frequency. You think that the current code will work as expected when I call to `deviceHandler::setVFOFrequency()` from the main thread?\r\n\r\nRegards.\r\n\r\n"}}
{"actor":{"display_login":"lars18th"}}