Skip to content

Serial connection only over relay (socat) #5

Open
@PickManInTheMiddle

Description

A JeeLink is connected to /dev/ttyUSB0.

Everything described below is executed with a user has full access to /dev/ttyUSB0:

When I try to scan the sensors using the following command, there is no response from pylacrosse:
pylacrosse -r 1 -d /dev/ttyUSB0 scan

To monitor the behavior, I created a relay with socat:
socat /dev/ttyUSB0,raw,echo=0 SYSTEM:'tee in.txt |socat - "PTY,link=/tmp/ttyUSB0,raw,echo=0,waitslave" |tee out.txt'

Started pylacrosse again using the relay:

pylacrosse -r 1  -d /tmp/ttyUSB0 scan
id=16 t=-0.100000 h=85 nbat=0 name=unknown
id=32 t=0.700000 h=83 nbat=0 name=unknown

Strangely now pylacrosse is displaying my sensors...

Terminal programs (tested with picoterm and here with pythons minicom) are also working:

python -m serial.tools.miniterm /dev/ttyUSB0 57600
--- Miniterm on /dev/ttyUSB0  57600,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
␀

[LaCrosseITPlusReader.10.1s (RFM69CW f:868300 r:17241)]
1r
v

[LaCrosseITPlusReader.10.1s (RFM69CW f:868300 r:9579)]
OK 9 43 1 4 116 53
OK 9 16 1 3 231 85

--- exit ---

Info:The commands "1r" and "v" were not echoed and added manually.

The info-command also works with pylacrosse (for /dev/ttyUSB0 and /tmp/ttyUSB0):

pylacrosse -d /dev/ttyUSB0 info
name:     LaCrosseITPlusReader
version:  10.1s
rfm1name: RFM69CW
rfm1frequency: 868300
rfm1datarate: 17241
rfm1toggleinterval: None
rfm1togglemask: None

Used versions:

  • pylacrosse: 0.3.1 (as shown in version.py)
  • python: 3.7.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions