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
Results 1 to 10 of 19
Thread: Uart RaspPi
-
2022-01-14, 06:19 #1
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
Uart RaspPi
-
2022-01-14, 07:21 #2
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 5,458
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
-
2022-01-14, 07:49 #3
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,508
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.Last edited by bpa; 2022-01-14 at 08:11.
-
2022-01-14, 11:53 #4
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
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
-
2022-01-14, 12:58 #5
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,508
-
2022-01-15, 02:57 #6
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
I discovered that there is a RS232 plugin in the LMS plugin
But I didn't find any documentation.
Could this do the trick?
-
2022-01-15, 03:11 #7
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,508
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.
-
2022-01-15, 04:21 #8
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
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!
-
2022-01-15, 05:03 #9
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 21,508
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
-
2022-01-15, 05:37 #10
- Join Date
- Jan 2022
- Location
- Switzerland
- Posts
- 146
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!