The Navigatrix has been updated. The new website can be found at navigatrix.net.




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
Following that, i did
Code:
$ lsmod | grep ftdi
which returned no hits.
So I did
Code:
$ sudo modprobe ftdi_sio
. Now ftdi shows up in lsmod, along with its dependency, usbserial. So far so good.

Code:
$ lsmod | grep ftdi
ftdi_sio               39986  0
usbserial              38902  1 ftdi_sio


Then I unplugged, waited, and replugged the usb connection to the mux. Here is the result of
Code:
dmesg | tail -20
after that (still no /dev/usbttyx). The usbcore and usbserial events were after I modprobed and before I unplugged/replugged.

Code:
[  730.609140] sd 4:0:0:0: [sdb] No Caching mode page found
[  730.609154] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 1007.349840] usbcore: registered new interface driver usbserial
[ 1007.349866] usbcore: registered new interface driver usbserial_generic
[ 1007.349885] usbserial: USB Serial support registered for generic
[ 1007.352222] usbcore: registered new interface driver ftdi_sio
[ 1007.352251] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 1016.967772] usb 2-1.2: USB disconnect, device number 4
[ 1071.113595] usb 2-1.2: new full-speed USB device number 5 using ehci-pci
[ 1071.214495] usb 2-1.2: New USB device found, idVendor=0403, idProduct=fd4a
[ 1071.214506] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1071.214514] usb 2-1.2: Product: ShipModul MiniPlex-2Wi
[ 1071.214521] usb 2-1.2: Manufacturer: CustomWare
[ 1071.214527] usb 2-1.2: SerialNumber: 25001350


Question - isn't the second number in the lsmod listing supposed to be the device type code? Is 0 the right device type?


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
I just re-read belle-isle's later post, http://navigatrix.net/viewtopic.php?p=3714#p3714, where he was working on the same problem again, this time with the same kernel and version of Navigatrix that I am running.

I noticed that his system was behaving the same way mine is.

So I did what he said he did to fix his problem with this version of Navigatrix. I am not getting any errors. I am also not getting ttyusbx.

But I am not sure that means it is not 'fixed'. Belle-Isle said that the device was recognized by gpsd. I don't know how to use gpsd or test whether or not it is talking to it. But I like the idea of using gpsd. Thoughts?

Thanks again, Moe!


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 04 Nov 2010, 20:51
Posts: 1062
Hang tight.

For example, this is the log output when I attach things
Quote:
[102866.616458] usb 2-1.1: new full-speed USB device number 14 using ehci-pci
[102866.704416] usb 2-1.1: New USB device found, idVendor=10c4, idProduct=ea60
[102866.704420] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[102866.704423] usb 2-1.1: Product: CP2104 USB to UART Bridge Controller
[102866.704424] usb 2-1.1: Manufacturer: Silicon Labs
[102866.704426] usb 2-1.1: SerialNumber: 001BC735
[102866.705165] cp210x 2-1.1:1.0: cp210x converter detected
[102866.705910] usb 2-1.1: cp210x converter now attached to ttyUSB1 <-------------------- GPS register at /dev/ttyUSB1
[102877.871471] usb 1-1.2: new full-speed USB device number 31 using ehci-pci
[102877.957909] usb 1-1.2: New USB device found, idVendor=058f, idProduct=9720
[102877.957916] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[102877.958641] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device <----------------------------Serial converter registered at /dev/ttyACM1
Now, compare it to your output....

It looks like your device is not getting picked up by udev and assigned a device on the system (/dev/whatever).

We need to create a udev device rule. It will look something like
Quote:
ACTION=add, ATTRS{idVendor}=="0403", ATTRS{idProduct}=="fd4a", RUN+="/sbin/modprobe", RUN+="/bin/sh -c 'echo 0403 fd4a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"
but I've not sat down and puzzled out the actual rule yet.

Try this fun thing
Code:
 udevadm monitor
plug and unplug the multiplexer. If the output is interesting
Quote:
moe@io:~$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[104164.460450] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1/tty/ttyUSB1 (tty)
KERNEL[104164.460600] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1 (usb-serial)
KERNEL[104164.460667] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0 (usb)
KERNEL[104164.460732] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1 (usb)
UDEV [104164.461674] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1/tty/ttyUSB1 (tty)
UDEV [104164.465307] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1 (usb-serial)
UDEV [104164.465775] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0 (usb)
UDEV [104164.477161] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1 (usb)
KERNEL[104169.845881] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1 (usb)
KERNEL[104169.846848] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0 (usb)
KERNEL[104169.846936] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1 (usb-serial)
KERNEL[104169.847117] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1/tty/ttyUSB1 (tty)
UDEV [104169.865345] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1 (usb)
UDEV [104170.876162] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0 (usb)
UDEV [104170.877374] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1 (usb-serial)
UDEV [104170.883066] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1/tty/ttyUSB1 (tty)
^Cmoe@io:~$ udevadm monitor > ~/Desktop/udev



Code:
 udevadm monitor > ~/Desktop/udev-monitor-output.txt
Plug and unplug the device (blind terminal with no output on screen), and then <ctrl><c> to kill the monitor. Attach the file to a post.


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
Output of udevadm attached.


Attachments:
udev-monitor-output.txt [1.49 KiB]
Downloaded 256 times
Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi
Site Admin

Joined: 05 Nov 2010, 01:00
Posts: 185
Hello Everybody,
can you try if this solves the problem:

1. open a root terminal with sudo su

2. copy and paste this into the terminal
Code:
cat << EOF>/etc/udev/rules.d/shipmodul.rules
ATTRS{idProduct}=="fd4a", ATTRS{idVendor}=="0403", RUN+="/lib/udev/shipmodul"
EOF

cat << EOF>/lib/udev/shipmodul
#!/bin/bash
/sbin/modprobe ftdi_sio
echo 0403 fd4a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
EOF

chmod ugo+x /lib/udev/shipmodul

udevadm control --reload-rules



3. reattach the shipmodule


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
Hi David,

Thanks for your help.

What you said to try had some results. As you can see, it is now attached to /dev/ttyusbx, which is progress. However, despite the applications listening on /dev/ttyusb0 at 115,200, none of them can access it. (I don't know how to just list it out to a raw terminal window so I have to use OpenCpn, GPS Panel, or something like that to 'see' if it is talking and the pc is ready to listen.)

results of dmesg after plugging it in:
Code:
[   92.345841] usb 2-1.2: new full-speed USB device number 5 using ehci-pci
[   92.446237] usb 2-1.2: New USB device found, idVendor=0403, idProduct=fd4a
[   92.446249] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   92.446257] usb 2-1.2: Product: ShipModul MiniPlex-2Wi
[   92.446264] usb 2-1.2: Manufacturer: CustomWare
[   92.446270] usb 2-1.2: SerialNumber: 25001350
[   92.450076] ftdi_sio 2-1.2:1.0: FTDI USB Serial Device converter detected
[   92.450179] usb 2-1.2: Detected FT232RL
[   92.450189] usb 2-1.2: Number of endpoints 2
[   92.450199] usb 2-1.2: Endpoint 1 MaxPacketSize 64
[   92.450208] usb 2-1.2: Endpoint 2 MaxPacketSize 64
[   92.450217] usb 2-1.2: Setting MaxPacketSize 64
[   92.450869] usb 2-1.2: FTDI USB Serial Device converter now attached to ttyUSB0


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi
Site Admin

Joined: 05 Nov 2010, 01:00
Posts: 185
You can listen with sudo cat /dev/ttyUSB0. Is there any output ?


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
I did sudo cat /dev/ttyUSB0 and it did not return anything. It just paused for a split-second, then returned the regular command prompt, no other result. (I checked dmesg to make sure ttyUSB0 was the right connection.)


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
As written before, I tried what Belle-Isle put in (his) last post, after he switched to the Nx kernel/version that I am also running. His solution also involved creating a rule file in /etc/udev, and I wondered whether what I had done there might conflict with what you told me to do. I went to delete them, but found I had copied what he wrote literally, including the product id he had. Instead of deleting them, I corrected them to reference the correct product id of my unit (fd4a, instead of fd49), then used udevadm to re-read the rule sets the way you instructed.

Now, when I sudo cat /dev/ttyUSB0, I DO get a feed. It is gibberish characters, probably because it is the wrong baud rate. According to the vendor my unit should be 115,200. I don't know how to change that in cat. But it looks promising!

dmesg also showed something new after I did this (I unplugged the replugged):
Code:
ben@fleet-L:~$ dmesg | tail -20
[ 8531.013173] usb 2-1.1: USB disconnect, device number 7
[ 8531.013364] pps pps0: removed
[ 8531.013557] ftdi_sio ttyUSB0: error from flowcontrol urb
[ 8531.014010] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[ 8531.014022] ftdi_sio 2-1.1:1.0: device disconnected
[ 8535.327752] usb 2-1.1: new full-speed USB device number 8 using ehci-pci
[ 8535.428690] usb 2-1.1: New USB device found, idVendor=0403, idProduct=fd4a
[ 8535.428702] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8535.428710] usb 2-1.1: Product: ShipModul MiniPlex-2Wi
[ 8535.428717] usb 2-1.1: Manufacturer: CustomWare
[ 8535.428724] usb 2-1.1: SerialNumber: 25001350
[ 8535.432417] ftdi_sio 2-1.1:1.0: FTDI USB Serial Device converter detected
[ 8535.432519] usb 2-1.1: Detected FT232RL
[ 8535.432528] usb 2-1.1: Number of endpoints 2
[ 8535.432538] usb 2-1.1: Endpoint 1 MaxPacketSize 64
[ 8535.432547] usb 2-1.1: Endpoint 2 MaxPacketSize 64
[ 8535.432556] usb 2-1.1: Setting MaxPacketSize 64
[ 8535.433195] usb 2-1.1: FTDI USB Serial Device converter now attached to ttyUSB1
[ 8536.548419] pps pps0: new PPS source usbserial1   <-------------- new
[ 8536.548463] pps pps0: source "/dev/ttyUSB1" added <------------ new


these PPS lines are something new.

Please advise how you want me to proceed. Should I get rid of the rule files created following belle-isles' approach, or not? Thanks again.


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
More progress - I rebooted. Now sudo cat /dev/ttyUSB0 shows a clear stream of NMEA sentences. Excellent!!

Strangely, when I go into OpenCpn and add connection /dev/ttyUSB0, baud rate 115200 (or any other rate), there is still nothing. The NMEA debug window does not show any traffic at all.


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
Both GPS Panel and Instrument Panel (Polar.com) work. They seem to be getting their data via gpsd, which is running. OpenCpn does not get anything. There is no longer a gpsd connection in OpenCpn, I apparently blew it away some time ago. What should that look like?

Thanks!! We are very close to the end, here.


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 04 Nov 2010, 20:51
Posts: 1062
What happens to OpenCPN when you put the gpsd connection back?
Attachment:
Selection_007.png
Selection_007.png [ 89.28 KiB | Viewed 15225 times ]


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 30 Oct 2014, 17:01
Posts: 21
Thanks, Moe. At first, openCpn didn't pick it up. But it also threw some errors when I started it. So I rebooted and started again. Then it worked great! Woo Hoo!!

I promised at the outset to post a concise 'what worked for me' for this product, and will also send it to the vendor. I'm away from the boat again now, but as soon I get back I will test it, with and without Belle-Isle's additional rules at the same time as David's, to see what the minimum config is.

Thanks again to you, Moe, and to David, for your assistance on this.


Top
   
 
 Post subject: Re: ShipModul MiniPlex-2Wi

Joined: 04 Nov 2010, 20:51
Posts: 1062
David's instructions are cleaner than anything I'd come up with. They are what you're looking for. It tells the udev system that when it sees product fd4a from vendor 0403 run /lib/udev/shipmodul

This loads the ftdi_sio module, and insert 0403 fd4a into a magic spot /sys/bus/usb-serial/drivers/ftdi_sio/new_id so it can be assigned to place in the system.

The concern I have is the gpsd will swallow some of your multiplex data. AIS and gps data is fine. I just don't know about the other stuff. (A reason Shipmodul should send a couple of testers to someone like David.)

So check it, and if it is a problem we can re-route the gpsd to virtual connections so there is maximum function possible.

Just to expound on David's cool solution.

There are four things it provides.
  • Creates the rule file /etc/udev/rules.d/shipmodul.rules and puts the following text into it :
    ATTRS{idProduct}=="fd4a", ATTRS{idVendor}=="0403", RUN+="/lib/udev/shipmodul"
  • Creates the udev script, /lib/udev/shipmodul, and puts in the following text:
    #!/bin/bash
    /sbin/modprobe ftdi_sio
    echo 0403 fd4a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
  • make that script executable to the 'group' who will access it (you)
  • Reloads the udev rules...the two files you've just created.


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2


Search for:
cron

Credits © 2010 - 2024