From owner-freebsd-java@freebsd.org Thu Dec 22 08:23:16 2016 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05B8BC8C630 for ; Thu, 22 Dec 2016 08:23:16 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smadev.internal.net", Issuer "smadev.internal.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB521F9E for ; Thu, 22 Dec 2016 08:23:14 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id uBM8N3Kh066668; Thu, 22 Dec 2016 10:23:04 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: can't connect GPSport 245 with BT747 To: Miroslav Lachman <000.fbsd@quip.cz>, freebsd-java@freebsd.org References: <5859B07F.1020403@quip.cz> <585A3148.7000507@matrix.gatewaynet.com> <585A6CB5.8010608@quip.cz> From: Achilleas Mantzios Message-ID: <585B8D67.8040304@matrix.gatewaynet.com> Date: Thu, 22 Dec 2016 10:23:03 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <585A6CB5.8010608@quip.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 08:23:16 -0000 On 21/12/2016 13:51, Miroslav Lachman wrote: > Achilleas Mantzios wrote on 2016/12/21 08:37: >> On 21/12/2016 00:28, Miroslav Lachman wrote: >>> I have Holux GPSport 245 (gps tracker). It uses USB connection with >>> serial (COM) emulation. It worked on Windows with Java based >>> application BT747 http://www.bt747.org/webinstall >>> But I can't use it on my FreeBSD 10.3 based desktop PC (PC-BSD) >>> I installed package comms/rxtx. >>> >>> Device is identified as >>> >>> kernel: ugen1.4: at usbus1 >>> kernel: uslcom0: on usbus1 >>> >>> These devices are created under /dev/ >>> >>> ugen1.4 >>> >>> ttyU0.lock >>> ttyU0.init >>> ttyU0 >>> >>> cuaU0.lock >>> cuaU0.init >>> cuaU0 >>> >>> BT747 cannot connect with this device. If I enabled "GPS connection >>> debug" in settings I see this trace: > > [...] > >>> >>> >>> I don't know where ports should be configured for Java based >>> applications. >>> >>> I tired to create symlinks like tty.usbserial@ -> cuaU0 >>> or ttyUSB0@ -> cuaU0 but BT747 still doesn't see any GPS device / port. >>> >>> Can somebody help me with this problem? >>> >> >> Try to get pure serial output from the port before anything else. Unless >> you are able to identify your port and do : >> # cat /dev/ttyXYZ >> and see NMEA stream, then you won't succeed with any java (or other) app. > > It works, I can connect to the device. Just the java app cannot. > > > sudo cu -l /dev/cuaU0 -s 38400 > Password: > Connected > $GPGGA,003530.800,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*4E > $GPGSA,A,1,,,,,,,,,,,,,,,*1E > $GPGSV,1,1,00*79 > $GPRMC,003530.800,V,8960.0000,N,00000.0000,E,0.00,0.00,060180,,,N*73 > $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 > $GPGGA,003531.800,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*4F > $GPGSA,A,1,,,,,,,,,,,,,,,*1E > $GPGSV,1,1,00*79 > $GPRMC,003531.800,V,8960.0000,N,00000.0000,E,0.00,0.00,060180,,,N*72 > $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 > $GPGGA,003532.800,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*4C > $GPGSA,A,1,,,,,,,,,,,,,,,*1E > > > > sudo cu -l /dev/ttyU0 -s 38400 > Password: > Connected > $GPGGA,000044.799,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*44 > $GPGSA,A,1,,,,,,,,,,,,,,,*1E > $GPGSV,1,1,00*79 > $GPRMC,000044.799,V,8960.0000,N,00000.0000,E,0.00,0.00,060180,,,N*79 > $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 > $GPGGA,000045.799,8960.0000,N,00000.0000,E,0,0,,137.0,M,13.0,M,,*45 > $GPGSA,A,1,,,,,,,,,,,,,,,*1E > $GPGSV,1,1,00*79 > > > I noticed that ttyU0 and cuaU0 are not accessible by my user so I changed permissions to 0666 but BT747 still don't see them: > > 24340 - isValidPort('/dev/cu.serial-0001')?: false -1 > 24341 - isValidPort('/dev/cu.SLAB_USBtoUART')?: false -1 > 24341 - isValidPort('/dev/cu.iBTAGPS-SPPslave')?: false -1 > 24341 - isValidPort('/dev/cu.usbmodem1b10')?: false -1 > 24341 - isValidPort('/dev/cu.usbmodem1d10')?: false -1 > 24341 - isValidPort('/dev/cu.usbmodem3d10')?: false -1 > 24342 - isValidPort('/dev/cu.usbmodem3a20')?: false -1 > 24342 - isValidPort('/dev/cu.usbmodem620')?: false -1 > 24342 - isValidPort('/dev/cu.usbmodemfd110')?: false -1 > 24342 - isValidPort('/dev/tty.usbmodemfd110')?: false -1 > 24342 - isValidPort('/dev/tty.usbmodemfd510')?: false -1 > 24344 - isValidPort('/dev/tty.usbserial')?: false -1 > Info: trying to open 'null' > > I don't know where these strange device names come from. If they are from rxtx package or BT747 itself and I don't know where to change them to /dev/cuaU0 or /dev/ttyU0 Some thoughts : - tweak /etc/devfs.conf - run your java app as root - run gpsd so that you can connect as a normal TCPIP client, making your app portable to many platforms > > Miroslav LAchman -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt