Home of the Squeezebox™ & Transporter® network music players.
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 37
  1. #21
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,543
    Quote Originally Posted by PaulH View Post
    And enter (Terminal send probably <CR><LF>
    No it won't, it will just send a single char <CR> which is CTRL/M

    The CLI client will not start processing (i.e no reply) until it see a <LF> i.e. CTRL/J

    Can you not use keyboard and press CTRL key simultaneously with J key ?

  2. #22
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by bpa View Post
    No it won't, it will just send a single char <CR> which is CTRL/M

    The CLI client will not start processing (i.e no reply) until it see a <LF> i.e. CTRL/J

    Can you not use keyboard and press CTRL key simultaneously with J key ?
    I wrote player count ?
    and press CTRL J.
    Nothing displayed neither on RS nor on Terminal
    Name:  Capture dĺÚcran 2022-01-24 Ó 13.57.55.jpg
Views: 28
Size:  20.3 KB

  3. #23
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,543
    Quote Originally Posted by PaulH View Post
    I wrote player count ?
    and press CTRL J.
    Nothing displayed neither on RS nor on Terminal
    OK possible problem with busybox nc or serialport or Terminal setup.
    Need to check to see what LMS sees.

    Use WebGUI Settings/Advanced/Logging/plugin.cli and set to DEBUG and click Apply.

    Try to do "nc" and "player count ?" command and then look in server.log (Webui Settings/Information) - do you see something like below.

    If "nc" works then "clock_socket_connect" and "cli_socket_read" will show.

    Code:
    [22-01-24 13:14:55.8967] Slim::Plugin::CLI::Plugin::cli_socket_accept (267) Accepted connection from 127.0.0.1:52242 (2 active connections)
    [22-01-24 13:15:01.5590] Slim::Plugin::CLI::Plugin::client_socket_read (315) Begin Function
    [22-01-24 13:15:01.5595] Slim::Plugin::CLI::Plugin::client_socket_read (349) 127.0.0.1:52242 - Buffered [player count ?
    ]
    [22-01-24 13:15:01.5599] Slim::Plugin::CLI::Plugin::client_socket_buf_parse (388) 127.0.0.1:52242
    [22-01-24 13:15:01.5604] Slim::Plugin::CLI::Plugin::client_socket_buf_parse (411) Using terminator "\r\n" for 127.0.0.1:52242
    [22-01-24 13:15:01.5607] Slim::Plugin::CLI::Plugin::cli_process (527) player count ?
    [22-01-24 13:15:01.5613] Slim::Plugin::CLI::Plugin::cli_process (602) Processing request [player]
    [22-01-24 13:15:01.5616] Slim::Plugin::CLI::Plugin::cli_process (636) Dispatching [player]
    [22-01-24 13:15:01.5621] Slim::Plugin::CLI::Plugin::cli_request_write (690) player count
    [22-01-24 13:15:01.5625] Slim::Plugin::CLI::Plugin::client_socket_buffer (506) 127.0.0.1:52242
    [22-01-24 13:15:01.5628] Slim::Plugin::CLI::Plugin::client_socket_write (450) 127.0.0.1:52242
    [22-01-24 13:15:01.5631] Slim::Plugin::CLI::Plugin::client_socket_write (463) 127.0.0.1:52242 - Sending response [player count 1...]
    [22-01-24 13:15:01.5633] Slim::Plugin::CLI::Plugin::client_socket_write (489) Sent response to 127.0.0.1:52242

  4. #24
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by bpa View Post
    Use WebGUI Settings/Advanced/Logging/plugin.cli and set to DEBUG and click Apply.
    Yes.... but humm... where is it ???

  5. #25
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,543
    Quote Originally Posted by PaulH View Post
    Yes.... but humm... where is it ???
    Using default UI and not Material UI.

    WebGUI = Browser Web Interface to LMS <ipaddressofp[i>:9000

    Click Settings button - bottom right.

    In Settings- Click the tab marked "Advanced" it is next to "Information" tab.

    Ther si a drop down menu on LHS - click the arrow to show all the options. Select the Logging one.

    Then find the plugin.cli drop down box - and change to DEBUG from ERROR

    Then click button Apply at Bottom right.

  6. #26
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Found!! Thanks!


    Code:
    [22-01-24 14:42:02.0907] Slim::Utils::Timers::__ANON__ (272) Error: Timer Slim::Networking::SqueezeNetwork::__ANON__ failed: 
    [22-01-24 14:42:17.8184] Slim::Networking::SqueezeNetwork::_error (431) Unable to login to SN: Timed out waiting for data
    [22-01-24 14:42:17.8192] Slim::Networking::SqueezeNetwork::_init_error (156) Unable to login to mysqueezebox.com, sync is disabled: Timed out waiting for data (https://www.mysqueezebox.com)
    [22-01-24 14:42:17.8201] Slim::Networking::SqueezeNetwork::_init_error (172) mysqueezebox.com sync init failed: Timed out waiting for data, will retry in 300 (https://www.mysqueezebox.com)
    [22-01-24 14:45:28.2695] Slim::Plugin::CLI::Plugin::cli_socket_accept (227) Begin Function
    [22-01-24 14:45:28.2709] Slim::Plugin::CLI::Plugin::cli_socket_accept (267) Accepted connection from 192.168.1.120:37219 (1 active connections)
    [22-01-24 14:46:52.6578] Slim::Plugin::CLI::Plugin::client_socket_read (315) Begin Function
    [22-01-24 14:46:52.6585] Slim::Plugin::CLI::Plugin::client_socket_read (340) Connection with 192.168.1.120:37219 half-closed by peer
    [22-01-24 14:46:52.6591] Slim::Plugin::CLI::Plugin::client_socket_close (287) Begin Function
    [22-01-24 14:46:52.6599] Slim::Plugin::CLI::Plugin::client_socket_close (305) Closed connection with 192.168.1.120:37219 (0 active connections)
    [22-01-24 14:46:53.9903] Slim::Plugin::CLI::Plugin::cli_socket_accept (227) Begin Function
    [22-01-24 14:46:53.9917] Slim::Plugin::CLI::Plugin::cli_socket_accept (267) Accepted connection from 192.168.1.120:46821 (1 active connections)

  7. #27
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,543
    Quote Originally Posted by PaulH View Post
    Found!! Thanks!
    OK - connection made - indicates that "nc" is working. So problem is CLI plugin is not processing data because it has not received a <LF>

    My guess the issues is Terminal. I don;t know Terminal. I assumed Terminal was a "console" type applications for Mac and not a TTY simulation and so it may be filtering keystrokes.

    You need to investigate Terminal settings. If Terminal in an an Apple system - how is Apple system connected to Pi serial line ?

  8. #28
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    At 14:42 nc 192.168.1.120 9090 </dev/ttyAMA0 >/dev/ttyAMA0 sent with ENTER
    At 15:02 nc 192.168.1.120 9090 </dev/ttyAMA0 >/dev/ttyAMA0 sent with CTRL J

    After some checks it seems that terminal send CR with Enter or CTRL J
    http://hints.macworld.com/article.ph...40107223331700

    From my MAC, USB to serial converter. I'm using CoolTerm to receive/send serial datas.
    It works because echo "hello" > /dev/ttyAMA0
    CoolTerm display "Hello"

    But I did everything wrong
    I should send player count ? from the RS232 side not from Terminal side!! And... it works !!!

    Code:
    player count ?
    
    player count 1
    
    
    player name ?
    
    player name %3F piCorePlayer
    Code:
    [22-01-24 15:22:27.8911] Slim::Plugin::CLI::Plugin::client_socket_write (463) 192.168.1.120:45781 - Sending response [...]
    [22-01-24 15:22:27.8920] Slim::Plugin::CLI::Plugin::client_socket_write (489) Sent response to 192.168.1.120:45781
    [22-01-24 15:22:33.6564] Slim::Plugin::CLI::Plugin::client_socket_read (315) Begin Function
    [22-01-24 15:22:33.6570] Slim::Plugin::CLI::Plugin::client_socket_read (349) 192.168.1.120:45781 - Buffered [
    ]
    [22-01-24 15:22:33.6575] Slim::Plugin::CLI::Plugin::client_socket_buf_parse (388) 192.168.1.120:45781
    [22-01-24 15:22:33.6581] Slim::Plugin::CLI::Plugin::cli_process (527) 
    [22-01-24 15:22:33.6590] Slim::Plugin::CLI::Plugin::cli_process (602) Processing request []
    [22-01-24 15:22:33.6595] Slim::Plugin::CLI::Plugin::cli_process (664) Request [] unknown or missing client -- will echo as is...
    [22-01-24 15:22:33.6600] Slim::Plugin::CLI::Plugin::cli_request_write (690) 
    [22-01-24 15:22:33.6607] Slim::Plugin::CLI::Plugin::client_socket_buffer (506) 192.168.1.120:45781
    [22-01-24 15:22:33.6616] Slim::Plugin::CLI::Plugin::client_socket_write (450) 192.168.1.120:45781
    [22-01-24 15:22:33.6621] Slim::Plugin::CLI::Plugin::client_socket_write (463) 192.168.1.120:45781 - Sending response [%1F%1E%08%08%08%0...]
    [22-01-24 15:22:33.6629] Slim::Plugin::CLI::Plugin::client_socket_write (489) Sent response to 192.168.1.120:45781
    [22-01-24 15:22:33.6636] Slim::Plugin::CLI::Plugin::client_socket_read (315) Begin Function
    [22-01-24 15:22:33.6641] Slim::Plugin::CLI::Plugin::client_socket_read (349) 192.168.1.120:45781 - Buffered [
    ]
    [22-01-24 15:22:33.6646] Slim::Plugin::CLI::Plugin::client_socket_buf_parse (388) 192.168.1.120:45781
    [22-01-24 15:22:33.6651] Slim::Plugin::CLI::Plugin::cli_process (527) 
    [22-01-24 15:22:33.6658] Slim::Plugin::CLI::Plugin::cli_process (602) Processing request []
    [22-01-24 15:22:33.6662] Slim::Plugin::CLI::Plugin::cli_process (664) Request [] unknown or missing client -- will echo as is...
    [22-01-24 15:22:33.6667] Slim::Plugin::CLI::Plugin::cli_request_write (690) 
    [22-01-24 15:22:33.6672] Slim::Plugin::CLI::Plugin::client_socket_buffer (506) 192.168.1.120:45781
    [22-01-24 15:22:33.6679] Slim::Plugin::CLI::Plugin::client_socket_write (450) 192.168.1.120:45781
    [22-01-24 15:22:33.6684] Slim::Plugin::CLI::Plugin::client_socket_write (463) 192.168.1.120:45781 - Sending response [...]
    [22-01-24 15:22:33.6692] Slim::Plugin::CLI::Plugin::client_socket_write (489) Sent response to 192.168.1.120:45781
    [22-01-24 15:22:34.8081] Slim::Plugin::CLI::Plugin::client_socket_read (315) Begin Function
    [22-01-24 15:22:34.8086] Slim::Plugin::CLI::Plugin::client_socket_read (349) 192.168.1.120:45781 - Buffered [
    ]
    [22-01-24 15:22:34.8091] Slim::Plugin::CLI::Plugin::client_socket_buf_parse (388) 192.168.1.120:45781
    [22-01-24 15:22:34.8095] Slim::Plugin::CLI::Plugin::cli_process (527) 
    [22-01-24 15:22:34.8102] Slim::Plugin::CLI::Plugin::cli_process (602) Processing request []
    [22-01-24 15:22:34.8106] Slim::Plugin::CLI::Plugin::cli_process (664) Request [] unknown or missing client -- will echo as is...
    [22-01-24 15:22:34.8110] Slim::Plugin::CLI::Plugin::cli_request_write (690) 
    [22-01-24 15:22:34.8119] Slim::Plugin::CLI::Plugin::client_socket_buffer (506) 192.168.1.120:45781
    [22-01-24 15:22:34.8126] Slim::Plugin::CLI::Plugin::client_socket_write (450) 192.168.1.120:45781
    [22-01-24 15:22:34.8130] Slim::Plugin::CLI::Plugin::client_socket_write (463) 192.168.1.120:45781 - Sending response [...]
    [22-01-24 15:22:34.8137] Slim::Plugin::CLI::Plugin::client_socket_write (489) Sent response to 192.168.1.120:45781
    [22-01-24 15:22:34.8143] Slim::Plugin::CLI::Plugin::client_socket_read (315) Begin Function
    [22-01-24 15:22:34.8148] Slim::Plugin::CLI::Plugin::client_socket_read (349) 192.168.1.120:45781 - Buffered [
    ]
    [22-01-24 15:22:34.8152] Slim::Plugin::CLI::Plugin::client_socket_buf_parse (388) 192.168.1.120:45781
    [22-01-24 15:22:34.8156] Slim::Plugin::CLI::Plugin::cli_process (527) 
    [22-01-24 15:22:34.8162] Slim::Plugin::CLI::Plugin::cli_process (602) Processing request []
    [22-01-24 15:22:34.8166] Slim::Plugin::CLI::Plugin::cli_process (664) Request [] unknown or missing client -- will echo as is...
    [22-01-24 15:22:34.8170] Slim::Plugin::CLI::Plugin::cli_request_write (690) 
    [22-01-24 15:22:34.8175] Slim::Plugin::CLI::Plugin::client_socket_buffer (506) 192.168.1.120:45781
    [22-01-24 15:22:34.8181] Slim::Plugin::CLI::Plugin::client_socket_write (450) 192.168.1.120:45781
    [22-01-24 15:22:34.8185] Slim::Plugin::CLI::Plugin::client_socket_write (463) 192.168.1.120:45781 - Sending response [...]
    [22-01-24 15:22:34.8192] Slim::Plugin::CLI::Plugin::client_socket_write (489) Sent response to 192.168.1.120:45781

  9. #29
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,543
    Quote Originally Posted by PaulH View Post
    I should send player count ? from the RS232 side not from Terminal side!! And... it works !!!
    Great. Sometimes the solution is simple once it is found.

    I think you'll now have question about how to use CLI (e.g. how to get notification of changes in metadata such as ytrack/artist etc).

    I don't have much practical knowledge of CLI but there are users/developers who have made plugins,connections etc making a lot of use of CLI so for any CLI questions I think open a new thread with a title which contains "CLI" to make sure you catch the eyes of those users.

    You can use this Apple setup to test & refine CLI commands/response processing before you put into your HA system.

  10. #30
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by bpa View Post
    I think you'll now have question about how to use CLI (e.g. how to get notification of changes in metadata such as ytrack/artist etc).
    You have right!!! Notification of change will be great.

    I thought that I must add:

    Code:
    nc 192.168.1.120 9090 </dev/ttyAMA0 >/dev/ttyAMA0
    into Tweaks "User command"

    The output is a little strange;
    What does dc%3Aa6%3A32%3A75%3A45%3A0a mean ?

    Code:
    title ?
    
    dc%3Aa6%3A32%3A75%3A45%3A0a title WOULD%20I%20LIE%20TO%20YOU
    it is also curious to see how the spaces are managed with %20 !
    Accented chars also: Ga%C3%ABtan
    What kind of coding is it ?
    Is it possible to configure it to ASCII ?

    Thank you very much bpa!!!
    Last edited by PaulH; 2022-01-24 at 09:06.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •