Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Uart RaspPi

  1. #1

    Uart RaspPi

    I move my question from HW to SW thread:

    Hi,


    The Raspberry has TxD and RxD lines. Is it possible to control the player (play, next, pause,...) from the serial line (RS232) ?

    Is it possible get the metadata outputs (title, track, artist) on this line ?

    Thanks

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    5,098
    RPi not RS232 ... and if you connected the serial port pins directly to RS232 device then you could damage the RPi.
    The RPi pins are 3.3v and RS232 is 5V and 12V ... expect major problems if you simply wire them together.

    You can get an adapter or connect via USB.

    However, I do not know of a built-in way to control or get song info out of that port.

    I expect that it could be done if you write some software (or find someone to do it for you).
    Paul Webster
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
    and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

  3. #3
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    I don't know specific about Pi but generally serial on Linux

    To use a serial interface on a Linux box - 2 option.
    1. Dumb async terminals mode tty.
    2. PPP - TCP/IP over a serial link. (edit PPP not SLIP https://www.instructables.com/Connec...rk-using-UART/ )

    I think dumb terminal would be simplest.

    Serial line could be setup so user could then login with a shell.

    Then user could any of the usual command line stuff to communicate with LMS (e.g. CURL command to POST/GET JSON request to get info / do command)
    Alternative could be to use CLI interface to LMS (i.e. telnet localhost 9090) but I think is is deprecated so may have limited functionality.

    Look at LMS WebUI Help -> Technical Information > The Logical Media Command Line interface

    The help provides details (maybe a bit out of date) on CLI and JSON.

    For CLI it says
    the Logitech Media Server provides a command-line interface to the players via TCP/IP. After starting the server, commands and queries may be sent by connecting to a specific TCP/IP port. The server will reply echoing the request (for commands) or by returning the requested data (for queries). By default, the server will listen for connections on TCP/IP port 9090. This format is designed for ease of integration into AMX, Crestron and other automation systems.

    The end of line separator is line feed (<LF> ASCII decimal 10, hexadecimal 0x0A). The server accepts LF, CR or 0x00 (or any combination thereof) as end of line, and replies with whatever was used for the command. For strings, Logitech Media Server uses the UTF-8 character-set encoding.

    To use the command line interface interactively, use the telnet command from your system's command prompt: telnet localhost 9090 and when it connects, you can start typing commands. Beware that the server expects parameters to be encoded using percent-style escaping (see below); " and \ are not supported as in shell-like environments.
    Better options may be available, if more info on what is on the other end of the serial line is supplied.
    Last edited by bpa; 2022-01-14 at 08:11.

  4. #4
    Quote Originally Posted by Paul Webster View Post
    RPi not RS232 ... and if you connected the serial port pins directly to RS232 device then you could damage the RPi.
    The RPi pins are 3.3v and RS232 is 5V and 12V ... expect major problems if you simply wire them together.

    You can get an adapter or connect via USB.

    However, I do not know of a built-in way to control or get song info out of that port.

    I expect that it could be done if you write some software (or find someone to do it for you).
    Thanks Paul but I did not explain myself well. I would like to control the picoreplayer (play/pause,next,...) and to get metadata output via UART.

    Of course Paul, I'm fully aware about HW interfacing (3,3V/12V, MAX232...). I'm totally new about Linux, but no problem about HW !


    I founded this thread about connecting an HD44780 LCD display to show metadatas. if we could redirect the datas into the UART instead of LCD...
    https://forums.slimdevices.com/showt...layer-%A32-LCD


    Thanks

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by PaulH View Post
    I founded this thread about connecting an HD44780 LCD display to show metadatas. if we could redirect the datas into the UART instead of LCD...
    https://forums.slimdevices.com/showt...layer-%A32-LCD
    IIRC the LCD display is done using a small python script which talks to LMS on the CLI port using telnet. The script then converts the metadata into pixel etc for display using Pi GPIO.

    look at readsq.py

  6. #6
    I discovered that there is a RS232 plugin in the LMS plugin
    But I didn't find any documentation.
    Could this do the trick?

  7. #7
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by PaulH View Post
    I discovered that there is a RS232 plugin in the LMS plugin
    But I didn't find any documentation.
    Could this do the trick?
    IIRC = No. I think it was about control of amps - LMS to device - you want a device to LMS.

    Look at the readsq.py application - it deal with CLI commands - you can rip out the text to graphics stuff or just use a reverse telnet application or maybe minicom

    There is a copy (no sure which version as it is posted in many threads)) attached to this post https://forums.slimdevices.com/showt...l=1#post816678

    All the "self.request" seem to be CLI command to LMS via telnet (i.e a serial link) - such as poweron, etc. All detailed in the WebGUI Help pager I posted earlier.

  8. #8
    Name:  Capture d’écran 2022-01-15 à 12.16.00.jpg
Views: 69
Size:  86.5 KB
    Quote Originally Posted by bpa View Post
    IIRC = No. I think it was about control of amps - LMS to device - you want a device to LMS.
    You are right it's to control the Logitech Transporter (I never saw this unit)


    Otherwise I'm not able to write any program on Linux :-(. Maybe I can use an RS232 -> IP converter. It's probably working to send any basic commands (play, stop,....). For metadata, probably some programming skills is necessary!

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by PaulH View Post
    Name:  Capture d’écran 2022-01-15 à 12.16.00.jpg
Views: 69
Size:  86.5 KB

    You are right it's to control the Logitech Transporter (I never saw this unit)


    Otherwise I'm not able to write any program on Linux :-(. Maybe I can use an RS232 -> IP converter. It's probably working to send any basic commands (play, stop,....). For metadata, probably some programming skills is necessary!
    You have not described your use case.

    I think you are over complicating things.

    If the Pi running has a TCP/IP connection - just telnet to the LMS system portr 9090 and try a fewe of the LMS CLI command

    Example on my LMS - telnet from a Ubuntu system - but it can be Windows, Android etc.
    Red Command . All command ended with LF = CTRL/J and not Carriage Return (CTRL/M).
    Code:
    $ telnet localhost 9090
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    status
    7c%3A9e%3Abd%3A2b%3A52%3A94 status   player_name%3AMyDAC32 player_connected%3A1 player_ip%3A192.168.0.143%3A59045 power%3A1 signalstrength%3A0 mode%3Astop mixer%20volume%3A50 playlist%20repeat%3A0 playlist%20shuffle%3A0 playlist%20mode%3Aoff seq_no%3A0 playlist_tracks%3A0 digital_volume_control%3A1
    player count ?
    player count 2
    player name 1 ?
    player name 1 Squeezebox%20Receiver
    albums 0 4
    albums 0 4 id%3A2 album%3A20th%20Century%20Blues id%3A12 album%3AAlright%2C%20Still id%3A4 album%3AAtlantic%20Soul%20-%20CD1 id%3A3 album%3ABetty%20Blue%2037%C2%B02%20Le%20Matin count%3A15

  10. #10
    Quote Originally Posted by bpa View Post
    You have not described your use case.

    I think you are over complicating things.

    [/code]
    Your are right, I had to explain first how I would like to use Picoreplayer.

    I would like to integrate it on my small home made home automation. It's using Arduino, that's why it doesn't speak ethernet. But it speaks serial. 

    I would like to control (start, stop, next, select a radio,...) the picoreplayer from it by sending an RS232 strings as "PLAY" for exemple.

    My HA has a display and I can display some informations (temperature,...) also title and tracks. It could be perfect if the picore send a string when new metadata are coming (the same string displayed on the LCD is perfect for me).

    I hope I have made myself clearer. I should have started there!

Posting Permissions

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