Tiny Core Linux
Tiny Core Extensions => TCE Talk => Extension requests => Topic started by: olivier.com on January 25, 2022, 07:11:37 AM
-
Hello all
Is it possible to add ser2net as an extension ?
1. Which flavor, Tinycore or piCore. > piCore v13
2. Which version. Provide the result of the version command. > 13.0
3. Which architecture. Provide the result of the uname -a command. > armv7l GNU/Linux
4. A link to the applications web site, if you have one. > http://ser2net.sourceforge.net/
I found a way to build the extension (with this post http://forum.tinycorelinux.net/index.php/topic,16731.msg100399.html#msg100399 (http://forum.tinycorelinux.net/index.php/topic,16731.msg100399.html#msg100399), and the last version) but at last i cannot connect to my serial device(which work whith ser2net for raspbian). So Ithink there a problem with TC version and/or dependancies.
For information, This extension is needed in order to connect a raspberry pi 2 (picore Player v8) to my DENON AVR with an USB to Serial link (FTDI chipset). The cable link is Ok with lsusb command ans is set to ttyUSB0.
Many thanks.
Olivier
-
Hi olivier.com
Welcome to the forum.
See if these instructions work for you:
http://forum.tinycorelinux.net/index.php/topic,19333.msg143296.html#msg143296
-
Hi Rich,
Thank you for your message.
I made a mistake in my first post. The link you gave me is the one I have followed. Sorry.
So this workaround does not give good result.
I modified the build script in order to match with new version of ser2net. Compiling seems to be ok and the extension is created. I have added the conf file into /etc/, persit this file by addind it in filelist and i do a backup.
I am able to start the ser2net program BUT I cant use it to connect to my serial device, whereas I can connect with the same RPi with raspbian and ser2net. So I think I made some bad thing with compiling and especially with piCore version.
Extension I built is to run with piCore v13, but script I have taken is from v8 repo... As we said in France "ya de la pluie qui a coulé sous les ponts depuis"... (Since then, much water has flowed under the bridge).
I made some moding in build script but with no change.
-
Hi olivier.com
Maybe you need a driver? Possibly something from the usb-serial extension.
-
The link I use is a USB to serial cable with FTDI chip.
With usb-util extension and usb-serial extrension installed, a lsusb command give me this :
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
...
So i consider my USB device drivers are Ok. Am I wrong ?
-
Hi olivier.com
No, that just means lsusb found ID 0403:6001 in its database. Run this command:
lsmod
This will list which modules (drivers) are currently loaded. The driver you are looking for id ftdi_sio.
-
Hum you are right.
lsmod does not gave me the ftdi driver.
Another fact I just discover (with your hint) is that the "dmesg | grep tty" command does not gave me a line like " FTDI ... is attached to /dev/ttyUSB0...".
So you are may be right with this driver issue...
Can you tell me how I can add this driver ? ( ftdi_sio ) . just for infortmation extension "usb-serial-5.10.42" is loaded.
-
Hi olivier.com
Try:
sudo modprobe ftdi_sio
-
After few moments of insanity...I realise I have forgotten to back up my changes.... so I confirm driver is correctly loaded
dmesg | grep tty
[ 0.000000] Kernel command line: coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbdepth=16 bcm2708_fb.fbsw ap=1 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000 tz=CET-1CEST,M3.5.0,M10.5.0/3 dwc_otg.fiq_fsm_mask=0xF host=pCP dwc_otg.lpm_enable=0 console=tty1 root=/dev/ram0 rootwait quiet nortc lo glevel=3 noembed smsc95xx.turbo_mode=N noswap consoleblank=0 waitusb=2
[ 0.000335] printk: console [tty1] enabled
[ 2.549527] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2
[ 19.549312] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUSB0
and
lsmod
Module Size Used by
spidev 20480 0
snd_soc_bcm2835_i2s 16384 0
snd_soc_core 229376 1 snd_soc_bcm2835_i2s
ftdi_sio 45056 0
usbserial 36864 1 ftdi_sio
snd_compress 20480 1 snd_soc_core
snd_bcm2835 28672 0
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_pcm 114688 5 snd_compress,snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
snd_timer 36864 1 snd_pcm
snd 77824 5 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
raspberrypi_hwmon 16384 0
i2c_bcm2835 16384 0
spi_bcm2835 20480 0
fixed 16384 0
squashfs 40960 72
zram 28672 1
zsmalloc 28672 1 zram
ser2net is now started but it doesnt connect to my serial device. (this step is OK with raspbian.)
I don't have very good knowledge of TC so does port on TC are all open? (the port I use to connect to ser2net ethernet side is 11111), I guess yes but I can send message to it... but they dont arrive to the serial device..
Status given by ser2net control port command is already not connected.
-
Hi olivier.com
... I modified the build script in order to match with new version of ser2net. ...
Maybe try building the older version found here with no modifications to the script:
http://tinycorelinux.net/8.x/armv6/tcz/src/ser2net/
and see if that behaves any better.
-
Thanks for your answer.
I forgot to tell that I really try all to make this extension work, including compiling without any change.
The extension I built, seems to be OK (It starts, I can see it with ps command...) but the serial side does not work at all.
ser2 net extension for TC v8 does not appears to have any dependancy. Is this fact already ok for TC v13 ?
-
If it works, it is probably OK...
-
If it works, it is probably OK...
As I said before, I cant connect to my serial device, whereas it is working with the same Rpi, with the same cable but under Raspbian. In fact, a thing is missing with TC. But i cant say what.
-
I thought you were speaking of the version of ser2net from piCore 8.x, not the version that you'd compiled.
-
I will try the extension on piCore v 8.x but it is not my goal.
I need ser2net with piCore v13.
-
Did you try ser2net from 8.x in 13.x?
-
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.
-
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)
-
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)
ls -l /dev/ttyUSB0
crw-rw---- 1 root uucp 4, 64 26 jan 16.20 ttyUSB0
usermod -a -G uucp tc
-
Hi olivier.com
To see which dependencies a module has:
modinfo ftdi_sio
To see which dependencies a program has:
ldd Path/To/ProgramName
Posting the results of lsmod from Raspbian might also be useful.
-
Thank you for your answers
-
I cant post my message... Internal server error.. so I attached the text to this message.. Sorry..
-
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.
-
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 :
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)
-
My first line is from the picore and the second line from rasbian.
And you can see both LiSTEN to ipv6 addresses, not ipv4:
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:
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.
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.
-
As you can see in your raspbian netstat command sshd LISTEN on both ipv6 and ipv4.
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.
-
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.
-
@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 :
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:
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.
-
SO, ser2net have a -u option that disable UUCP locking :
-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..
-
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
-
Can you make a new netstat command to the both, from rasbian and picore.
So you can see now that ser2net LISTEN to ipv4 instead of ipv6, so you don't need
ipv6-netfilter-xxx.tcz any more.
-
Can you make a new netstat command to the both, from rasbian and picore.
So you can see now that ser2net LISTEN to ipv4 instead of ipv6, so you don't need
ipv6-netfilter-xxx.tcz any more.
@patrickg, yes I will remove ipv6 extension. Thanks for your hint
Now I'm on the way understand how uucp can be disabled on piCore in order to work as on Raspbian.
-
Does anybody have some hints about UUCP ?
-
Probably you need to look into ser2net's source, what it's doing with uucp. Or just use the -u option ;)
-
Probably you need to look into ser2net's source, what it's doing with uucp. Or just use the -u option ;)
He doing what is he doing and it doesn't matter at all. With Raspbian it is no need to add the -u option. So, i want to know why piCore has not the same behavior.
There is rights problem ? piCOre configuration problem ? ...
-
You may read little of this, to understand how the serial device locking feature working.
https://tldp.org/HOWTO/Serial-HOWTO-13.html
Is ser2net some deamon or application ?
You can test to strace if its a application, to see if the application tries to make some type of lock file, and can't create if because of lack of file rights.
-
Hi olivier.com
Before you built ser2net , you had to build gensio , right?
When you run ./configure for gensio , include --with-uucp-locking=no
-
He doing what is he doing and it doesn't matter at all. With Raspbian it is no need to add the -u option. So, i want to know why piCore has not the same behavior.
There is rights problem ? piCOre configuration problem ? ...
Of course it matters. If you don't know what it's doing, how will you find out why the behavior differs?
You're asking us, but none of us know. We don't have the hw, and it seems none have ever used ser2net.
-
Hi olivier.com
Before you built ser2net , you had to build gensio , right?
When you run ./configure for gensio , include --with-uucp-locking=no
You are right Rich !
The thing I have missed is gensio part.
I'll give it a try.
Many many thanks for your help and your advice. It helped me so much.
-
He doing what is he doing and it doesn't matter at all. With Raspbian it is no need to add the -u option. So, i want to know why piCore has not the same behavior.
There is rights problem ? piCOre configuration problem ? ...
Of course it matters. If you don't know what it's doing, how will you find out why the behavior differs?
You're asking us, but none of us know. We don't have the hw, and it seems none have ever used ser2net.
Ok Sorry. I thought (but it is not right) that piCOre has these type of locking activated by default. Thank you for your answer and hints.
-
So I achieve my extension building with success and it is working like a charm.
I give a little walkthrough if some people want to build and use the ser2net extension with piCore (and specially with with piCorePlayer in order to control old DENON AVR)
I cant post the message so I add it in attachment.
-
I'll add this to the piCorePlayer projects documentation if you like? See https://docs.picoreplayer.org/projects/ (https://docs.picoreplayer.org/projects/)
-
I'll add this to the piCorePlayer projects documentation if you like? See https://docs.picoreplayer.org/projects/ (https://docs.picoreplayer.org/projects/)
Hum... Why not.
It would a way that this little tiny walkthrough don't get lost on this forum.... and may help someone.
Please correct my obvious english fault.. As I am a french guy, my english is quite good..
Many thanks Greg.
Olivier
-
Hi olivier.com
A couple of minor points:
You misspelled export:
xport CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
I was under the (possibly mistaken) impression that piCorePlayer like piCore compiled 32 bit apps to be
armv6 compatible:
export CFLAGS="-O2 -pipe -march=native -mfpu=vfp"
export CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=native -mfpu=vfp"
-
Please confirm potential typos.
3.9 Add the ser2net conf file
sudo touch /etc/ser2net.conf
sudo echo protocol,src_ip,port_to_reach_onRpi:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT >> ser2net.conf
Missing directory. Should be ">>/etc/ser2net.conf"
3.10 We have to tell piCorePlayer to save these setting for future reboots :
sudo echo /etc/ser2name.conf >> /opt/.filetool.lst
Extra / and ser2name should be ser2net. Should be "etc/ser2net.conf"
Ready for review: https://docs.picoreplayer.org/projects/using-ser2net/
-
Please confirm potential typos.
3.9 Add the ser2net conf file
sudo touch /etc/ser2net.conf
sudo echo protocol,src_ip,port_to_reach_onRpi:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT >> ser2net.conf
Missing directory. Should be ">>/etc/ser2net.conf"
3.10 We have to tell piCorePlayer to save these setting for future reboots :
sudo echo /etc/ser2name.conf >> /opt/.filetool.lst
Extra / and ser2name should be ser2net. Should be "etc/ser2net.conf"
Ready for review: https://docs.picoreplayer.org/projects/using-ser2net/
you are right Greg! I have to wear glasses...or sleep a little bit more..
Just one mistake. the last comand is "pcp bu" not "pcp br".
Many thanks !
-
Hi olivier.com
A couple of minor points:
You misspelled export:
xport CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
I was under the (possibly mistaken) impression that piCorePlayer like piCore compiled 32 bit apps to be
armv6 compatible:
export CFLAGS="-O2 -pipe -march=native -mfpu=vfp"
export CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=native -mfpu=vfp"
You are certainly right.
I done my idea with this article : https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu (https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu)
...As long as you’re not cross compiling, the simplest and easiest way to get the best performance on Arm with both GNU compilers and LLVM-compilers is to use only -mcpu=native and actively avoid using -mtune or -march....
So in my mind, compiling with armv6 flag is the best way if you want to share you compiled extension. In our case, everyone can build the extension using their own Rpi spec (ie: native). I agree with you, if i build the extension with native option on Rpi4, the result would give certainly strange result on a Rpi2. Tell me if I mistaken.
-
Hi olivier.com
No, you are not mistaken. As long as everyone builds their own version, then -march=native is fine.
-
OK. Thank you.
-
Just one mistake. the last comand is "pcp bu" not "pcp br".
The last command does a backup and reboot. I combined your last 2 commands.
-
Perfect!