WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Ser2net  (Read 10137 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Ser2net
« Reply #15 on: January 26, 2022, 02:51:14 AM »
Did you try ser2net from 8.x in 13.x?

Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #16 on: January 26, 2022, 04:39:35 AM »
Yes with the same behavior.
It is for that I asked for adding this extension (made by a competent contributor, not like me..) to repo of v13.

Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #17 on: January 26, 2022, 06:59:07 AM »
Another i've tested with same Rpi but with raspbian.. and it is OK.
There is a way to see what dependancies a program is using? I would do a diff between this 2 configuration. ( piCore / raspbian)

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Ser2net
« Reply #18 on: January 26, 2022, 07:42:58 AM »
Can it be like another problems with serial devices with /dev/ttyUSB0.
The user you try to access the serial port, has not correct privileges.

You have to try to see what group the serial device been attached to.
(see the code below)

Like uucp and you have to add this group to that specific user like "tc".
(see the code below)

Code: (bash) [Select]
ls -l /dev/ttyUSB0
crw-rw----  1 root   uucp      4,  64 26 jan 16.20 ttyUSB0

usermod -a -G uucp tc

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Ser2net
« Reply #19 on: January 26, 2022, 07:43:59 AM »
Hi olivier.com
To see which dependencies a module has:
Code: [Select]
modinfo ftdi_sio
To see which dependencies a program has:
Code: [Select]
ldd Path/To/ProgramName
Posting the results of  lsmod  from Raspbian might also be useful.

Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #20 on: January 26, 2022, 09:07:08 AM »
Thank you for your answers

Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #21 on: January 26, 2022, 09:12:15 AM »
I cant post my message... Internal server error.. so I attached the text to this message.. Sorry..

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Ser2net
« Reply #22 on: January 26, 2022, 09:54:43 AM »
What I can see there some differences between this two lines.

First line saying its ipv4 with "tcp" and with ipv6 address ?? Strange..
tcp        0      0 :::11111                :::*                    LISTEN      10527/ser2net
tcp6       0      0 :::11111                :::*                    LISTEN      936/ser2net

How do you connect with putty ??
Are you remotely connecting to the pi with putty to port 11111 with some ipv6 address, or you connect with some hostname so you can't see it's using the ipv6 address.

Are you using the loopback ipv6 address ??
Is your intention to use ipv6 ??

The line in netstat should be something like this, if you using ipv4.
tcp        0      0 0.0.0.0:11111               0.0.0.0         LISTEN         926/ser2net.

Can you configure the ser2net to use the ipv4 instead of ipv6.
 


Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #23 on: January 26, 2022, 10:15:50 AM »
I have noticed this fact.

My connection test with putty is basic (see capture) : IP of my Rpi with raspbian or the other with piCore and both with the "11111" port declared in the ser2net conf file.

I connect (or try to connect to ) the 2 Rpi with the same PC on my local network, the raspbian one is connected via WIFI and the other via ethernet.

I confirm it is not my intention to use ipv6 as I disabled it into my router for traffic from internet.
The line with ipv6 info is provided by the working unit (Raspbian with ser2net)

the ser2net configuration dont seems to allow me specify the ip version. The only conf provided to ser2net is this line :

Code: [Select]
11111:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT
11111: the port to reach on the Rpi
raw : the type of connection (raw or telnet)
0 : timeout
/dev/ttyUSB0 : USB device attached to tty
9600 : bauds
Last settings are for my serial device (my AVR)



Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Ser2net
« Reply #24 on: January 26, 2022, 12:16:03 PM »
My first line is from the picore and the second line from rasbian.
And you can see both LiSTEN to ipv6 addresses, not ipv4:

Code: (bash) [Select]
tcp        0      0 :::11111                :::*                    LISTEN      10527/ser2net

tcp6       0      0 :::11111                :::*                    LISTEN      936/ser2net
Because if the application is LISTEN to the ipv4, the line should be like this from netstat:

Code: (bash) [Select]
tcp        0      0 0.0.0.0:11111               0.0.0.0         LISTEN         926/ser2net.

What I can see in the manpage.
You could provide in the application configuration, only bind to ipv4.
https://manpages.debian.org/buster/ser2net/ser2net.8.en.html#CONFIGURATION

What I can see your config line should be something like this, and this should bind the application to LISTEN only on 0.0.0.0 on ipv4 on port 11111.

Code: (bash) [Select]
ipv4,0.0.0.0,11111:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT
Something in me saying that the rasbian may bridge the ipv4 traffic to ipv6 internally.
And after you set the config, restart the application and use your netstat to confirm it's LISTEN to 0.0.0.0 on tcp.
« Last Edit: January 26, 2022, 12:37:05 PM by patrikg »

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 661
Re: Ser2net
« Reply #25 on: January 26, 2022, 01:02:10 PM »
As you can see in your raspbian netstat command sshd LISTEN on both ipv6 and ipv4.

Code: (bash) [Select]
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      574/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      574/sshd

With correct tcp in the beginning.
And picore has wrong tcp in the beginning of the line.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Ser2net
« Reply #26 on: January 26, 2022, 01:50:55 PM »
Hi olivier.com
It appears the busybox version of  netstat  does not use a  tcp6  label when displaying  IPv6  results.

I noticed in reply #8  that  ipv6  is not listed in the results from the  lsmod  command.
Maybe you need to install  ipv6-netfilter-$KERNEL.tcz.

Posting the results of  lsmod  from Raspbian might also be useful.

Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #27 on: January 27, 2022, 12:07:46 AM »
@patrikg :
I have just changed my ser2net conf in order to accept only ipv4 from all ip but no change.

@Rich :

lsmod from piCore unit :
Code: [Select]
tc@pCP:~$ lsmod
Module                  Size  Used by
ipv6                  503808  21
spidev                 20480  0
ftdi_sio               45056  0
snd_soc_bcm2835_i2s    16384  0
usbserial              36864  1 ftdi_sio
snd_soc_core          229376  1 snd_soc_bcm2835_i2s
raspberrypi_hwmon      16384  0
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_bcm2835            28672  0
spi_bcm2835            20480  0
snd_pcm               114688  5 snd_compress,snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
snd_timer              36864  1 snd_pcm
i2c_bcm2835            16384  0
snd                    77824  5 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
fixed                  16384  0
squashfs               40960  38
zram                   28672  1
zsmalloc               28672  1 zram

and from raspbian unit:
Code: [Select]
pi@SERIALSERVER:~ $ lsmod
Module                  Size  Used by
cmac                   16384  1
bnep                   20480  2
hci_uart               40960  1
btbcm                  16384  1 hci_uart
bluetooth             393216  24 hci_uart,bnep,btbcm
ecdh_generic           16384  2 bluetooth
ecc                    40960  1 ecdh_generic
ftdi_sio               45056  0
usbserial              36864  1 ftdi_sio
8021q                  32768  0
garp                   16384  1 8021q
stp                    16384  1 garp
llc                    16384  2 garp,stp
brcmfmac              327680  0
brcmutil               20480  1 brcmfmac
sha256_generic         16384  0
cfg80211              761856  1 brcmfmac
rfkill                 32768  6 bluetooth,cfg80211
raspberrypi_hwmon      16384  0
bcm2835_v4l2           40960  0
bcm2835_isp            32768  0
bcm2835_codec          40960  0
v4l2_mem2mem           36864  1 bcm2835_codec
bcm2835_mmal_vchiq     32768  3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
videobuf2_vmalloc      16384  1 bcm2835_v4l2
videobuf2_dma_contig    20480  2 bcm2835_isp,bcm2835_codec
videobuf2_memops       16384  2 videobuf2_dma_contig,videobuf2_vmalloc
snd_bcm2835            24576  1
videobuf2_v4l2         32768  4 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       61440  5 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_pcm               110592  1 snd_bcm2835
snd_timer              32768  1 snd_pcm
videodev              249856  6 bcm2835_isp,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
mc                     45056  6 bcm2835_isp,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2
snd                    77824  5 snd_timer,snd_bcm2835,snd_pcm
vc_sm_cma              32768  2 bcm2835_isp,bcm2835_mmal_vchiq
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq
fixed                  16384  0
ip_tables              28672  0
x_tables               32768  1 ip_tables
ipv6                  495616  24

Ipv6 are loaded at both side.
extension ipv6-netfilter-xxx.tcz is already installed.

Offline olivier.com

  • Newbie
  • *
  • Posts: 26
Re: Ser2net
« Reply #28 on: January 27, 2022, 01:29:28 AM »

SO, ser2net have a -u option that disable UUCP locking :
Code: [Select]
-u
If UUCP locking is enabled, this will disable the use of UUCP locks.


When Ilaunch ser2netwith -u option i CAN reach configured port and connect to my serial device. It works.
With raspbian unit, I never added the -u option..



Offline gadget42

  • Hero Member
  • *****
  • Posts: 657
Re: Ser2net
« Reply #29 on: January 27, 2022, 02:18:22 AM »
https://www.math.utah.edu/docs/info/uucp_5.html

whew!

20220127-0425am-modified-added another link, more whew(check out some of those names...are they for real?)

https://www.math.utah.edu/docs/info/uucp_7.html#SEC65
« Last Edit: January 27, 2022, 02:25:19 AM by gadget42 »
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580