Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Uart RaspPi

  1. #11
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by PaulH View Post
    I hope I have made myself clearer. I should have started there!
    Much clearer.

    I don't know about PCP and as you are doing development, I'd start with LMS on a full Raspbian/Max2play system to have full flexibility rather than cut down piCore.
    Once you have a workign system, then figure a way to get it goingon on PCP as you may need to do a custom build if an extension is not available.

    Simplest scenario:

    Enable serial console on pi (e.g. https://medium.com/@sarala.saraswati...e-44d7df95f03e )

    Then using arduino - login into Pi (i.e.codes wait for "Login:" prompt, code replies with userid and then wait for "password:" prompt and replied with password. Once in run telnet command.

    If this is too complicated then a reverse telnet or maybe socat can connect serial port direct to LMS port 9090. You'd have to find out how to get the /dev/tty type driver running on GPIO pins to acts as serial port on the Pi for "reverse telnet" or socat to access (e.g. https://spellfoundry.com/2016/05/29/...luding-pi-3-4/) although probably much easier to buy a cheap USB-serial adaptor.

  2. #12
    Quote Originally Posted by bpa View Post
    Much clearer.

    I don't know about PCP and as you are doing development, I'd start with LMS on a full Raspbian/Max2play system to have full flexibility rather than cut down piCore.
    I'm ok with C but not with Linux.

    PCP is perfect for me. Restart perfectly after power supply failure, easy to use and efficient!

    What about using an Hardware RS232-Ethernet adapter ? It should be possible to send any commands?

  3. #13
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by PaulH View Post
    I'm ok with C but not with Linux.
    if you can do C - python P erl , bash etc. is just a bit of reading.

    PCP is perfect for me. Restart perfectly after power supply failure, easy to use and efficient!
    Limited.
    I reckon if you could build socat for PCP a single command line would do what you need. However you'd need to build socat for PCP which may be possible as there is a socat extension for Tinycore (http://www.tinycorelinux.net/9.x/armv7/tcz/)

    What about using an Hardware RS232-Ethernet adapter ? It should be possible to send any commands?
    What do you mean
    * something that implements TCP/IP over a serial line such as PPP - doesn't solve your problem.
    * a serial server (e.g. nc601b type) - probably works but only if device is supported by PCP kernel but may need an extension for it. Still would need code on Arduino to login and issue CLI commands - same as my earlier suggestion

  4. #14
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by bpa View Post
    i* a serial server (e.g. nc601b type) - probably works but only if device is supported by PCP kernel but may need an extension for it. Still would need code on Arduino to login and issue CLI commands - same as my earlier suggestion
    After looking at LMS CLI code - it just connects to a TCP port and expected line by line of text on a TCP port. The CLI code does not connect to a tty/serial device
    An RS232-Ethernet connection usually creates tty devices and this is irrelevant to the CLI plugin and nothing gained in using it as application access the rs232 line will still have to issue "telnet" command to talk to CLI application or run something like socat to connect serial line to CLI's TCP port..

  5. #15
    Quote Originally Posted by bpa View Post
    After looking at LMS CLI code - it just connects to a TCP port and expected line by line of text on a TCP port. The CLI code does not connect to a tty/serial device
    An RS232-Ethernet connection usually creates tty devices and this is irrelevant to the CLI plugin and nothing gained in using it as application access the rs232 line will still have to issue "telnet" command to talk to CLI application or run something like socat to connect serial line to CLI's TCP port..
    To summarize (with the knowledge I have) , external communication it's not so easy as I thought :-(

    No issue for metadatas output.

    The only issue I founded to control the player is using the SqueezeButtonPi. Instead buttons I could connect it to digital outputs from my Arduino.

  6. #16
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,014
    Quote Originally Posted by PaulH View Post
    To summarize (with the knowledge I have) , external communication it's not so easy as I thought :-(

    No issue for metadatas output.

    The only issue I founded to control the player is using the SqueezeButtonPi. Instead buttons I could connect it to digital outputs from my Arduino.
    External communication is easy over TCP/IP. socat which woudl connecte a TCP/IP socket to s errtial line is easy - just there is no socat readily available for PCP - but is there for Raspbian or Max2play.
    All player control and metadata is done via LMS.
    The player knows nothing about displays or control.

    SqueezeButtonPi - uses the similar CLI command interface I have been suggesting except I think it uses http/json/curl rather than telnet.

  7. #17
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,417
    I think socat is similar to netcat which is similar to nc. pCP has busybox nc installed. Type busybox to get a list of commands.

    pCP doesn't include bash by default, pCP uses sh. pCP doesn't include python by default, pCP uses microPython (with only a couple of libs)

  8. #18
    Quote Originally Posted by Greg Erskine View Post
    I think socat is similar to netcat which is similar to nc. pCP has busybox nc installed. Type busybox to get a list of commands.

    pCP doesn't include bash by default, pCP uses sh. pCP doesn't include python by default, pCP uses microPython (with only a couple of libs)
    Greg,

    Are my wishes achievable ? Redirect text output on UART. Control some feature by UART ?
    Or definitely uart is not at all supported by tinylinux ?

    Thanks for your opinion and precious experience !

  9. #19
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,417
    hi PaulH,

    It's probably possible and because LMS is so mature it probably has already been done. There is Slimmer, with interfaces LMS to a HD44780. I have read a couple of threads about interface LMS into HA.

    Using pCP just adds another layer because when you research the web, most of the info will refer to Raspbian or Raspberry Pi OS. Example code will probably be python.

    regards
    Greg

Posting Permissions

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