查看完整版本: [-- 先转帖过来慢慢玩 --]

哈罗CQ火腿社区 -> 计算机应用及数码产品 -> 先转帖过来慢慢玩 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

ba7ib 2015-08-31 21:30

先转帖过来慢慢玩


http://www.yo3ggx.ro/jAReC/doc08/index.html




jAReC



(j)ava (A)udio and (Re)mote(C)ontrol



(was jAS2SecNET, jSerialNET)



A Java multiplatform applicationto securely make your transceiver available for CAT and audio overthe LAN or WAN



Version 0.8


Dan Toma - YO3GGX -yo3ggx@gmail.com



Introduction


This is a very simple to usemulti-platform Java application which can be used to redirect one ofyour computer serial ports and one audio port to Ethernet. In thisway you will be able to connect to any serial port (embedded,USB/Serial modules or Bluetooth modules) remotely over the networkand transport audio too with a special client. Some of my Androidapplications, are able to serially connect over the Ethernet so thiscan be a nice addition. PocketRXTX Android application can use thesecure authentication feature to securely connect and control (CAT)your radio transceiver over Internet, with audio support.

Features


Current version of the applicationhas the following features:

  • Can be run on Windows, Linux orMac (with Java Runtime installed)

  • The application is fullyportable, nothing is modified in the Registry and contains only theexecutable (JAR) and a simple text configuration file

  • You can select any local serialport (COMx in Windows, /dev/ttySx or /dev/ttyUSBx in Linux, etc)

  • You can select Audio In andAudio Out devices from a list. Audio feature is bi-directional, witha mic level meter for better control;

  • Display your local IP address

  • You can set the TCP port whichwill allow remote connections. Next TCP port is used for audio, ifaudio activated.

  • Configurable Baudrate (from 110to 921600)

  • Settings are saved in aconfiguration file, so no need to enter values again at next start

  • Auto server start atapplication startup (unattended)

  • Auto disconnects if loosinglink going back to “wait for connection” mode


Limitations


Current version of the applicationhas the following limitations:

  • Cannot be run as a Service asit is (but you can simply do it with extra configuration);

  • Not tested, but most probablywork on Mac computers too.

WARNING!!!
Usethis application on your own risk. I cannot be held responsible forany damage caused to your system.

Starting theapplication



Windows


To start the application in Windows,if you have previously installed Java Runtime (from Oracle), justclick on the file (jAReC.jar). You will get the following window:





Linux


Using a terminal enter the followingcommand when you are in the folder containing the program:
java–jar jAReC.jar
You will get the following window:






ConfiguringAuthentication and Encryption





From the File menu select“Security”. You will get the following window.

Check to select/unselectauthentication. Encryption is not available in the current version,only secure authentication.  Authentication is selected by default.Enter a secret in the white field. This must be a string longer than3 chars and cannot contain ‘*’ char. When you’re ready click“OK”

Configuring Audio





From the File menu select “Audio”.You will get the following window.





You need to select Audio In andAudio Out device to point to the audio interface connected to thetransceiver.
Check “Use Audio” and press OK.

Using the mainapplication screen




In order to use the application youneed to configure the following parameters:

  • Serial port to be used (COMx forWindows or ttyUSBx / ttySx for Linux).


Windows
Linux
              



  • Serial Baudrate. You have thefollowing available values: 110, 300, 600, 1200, 2400, 4800, 9600,14400, 19200, 38400, 57600, 115200, 128000, 256000, 460800 and921600.




  • TCP Port. This can be any integervalue between 1 and 65535. The computer will listen on this port fornetwork connections to be redirected to the serial interface. If theport is in use, you will get an error message when trying to startlistening.

NOTE:Please be aware that if you use audio, next TCP port after theone you entered will be used for audio streaming, so it must be afree one.
After youconfigure all 3 parameters, click START button to start listening onthat port. If the chosen port is free, then the computer will startlistening on that port and the window background will go yellow:



The IP address of the computer will bedisplayed in the upper part of the window as “MyIP:xxx.xxx.xxx.xxx”
You can now remotely connect to thatsocket (pair of IP address and TCP port, in the upper example:192.168.33.2:9876).
The application window background willgo yellow when listening for remote connections.



When the remote connection isestablished successfully, the window background will go green and theremote IP address will be displayed instead of local IP, as in thefollowing picture:




All the parameters are now saved in theconfiguration file. If you close and then start again theapplication, the form will be automatically filled with the savedparameters, so no need to configure them again.
If you want that the application toautomatically go into the listening mode when started, check“Autostart”.
At any time, if you click on STOPbutton, the connection will be dropped and the window background willgo back gray.


When audio is used and a connection isestablished, the microphone level will be shown in a bar graph, inthe lower right part of the window.


You can simultaneously start severalinstances of the application, one for each serial port you want toaccess through the network. If you have multiple transceivers, youcan start one instance if the application for each of them. The onlyrequirement is to use different TCP port for each connection, inorder to have unique sockets.
Serial Port can be not only a localphysical serial port (like COM on the motherboard or USB/Serialinterface) but even a virtual COM port, for example the one createdby a Bluetooth interface. You can connect in this way to yourBluetooth device over the network.

The configurationfile





When you first download the applicationfrom my web site, there is no configuration file. This isautomatically created at first run, in the same folder as the jarfile. You can edit that configuration file using a simple text editor(do not use Word as it can render the file unusable). The filename isjsn.cfg and the format is the following:


#SunAug 23 15:36:45 EEST 2015
bUseAuthentication=true
bUseEncryption=false
sBaudrate=38400
bAutostart=true
iPlayInterface=8
iRecInterface=13
sCOMport=COM1
bUseAudio=true
sHSecret=2743C71E3828333B277A8FE65050595BF13DD669
nwPort=4444


Each parameter is self-explanatory,corresponding with the ones from the GUI. Theauthentication/encryption password (secret) is stored as a SHA-1hash, so you have no way to read it from the configuration file.





Application history





Version0.1 (Feb 27th, 2014). Firstpublic release of the application



Version0.4 (Aug 20th, 2014)
- add secureauthentication support - cand be used only with Pocket RXTX Androidapplication as a network client
- add full dataencryption support (experimental, buggy)
- add audiosupport (for the moment only in the GUI, not functional yet)
- detectdisconnection and go back to "waiting for connection" mode(yellow background)
Version0.8 (Aug 23rd, 2015)
- bidirectionalaudio support with mic level meter
- name changed tojAReC, From (j)ava (A)udio and (Re)mote (Control)
- version numberin sync with the Pocket RxTx Android application (for compatiblefeatures)
- deactivateSTART button when already started and STOP button when alreadystopped.
- changed andbigger icons for security and audio settings
- autostartfunction added
- reconnect toCOM port and restart server if any parameter changed and previouslyconnected
- 128 bytessymmetric key used for password encryption (instead of 64 in theprevious version)
- compatible withJava 8
jAReC_v0.8.pdfBucharest, Aug 23th2015  –  © Dan Toma – YO3GGX – yo3ggx@gmail.com
6





查看完整版本: [-- 先转帖过来慢慢玩 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Time 0.018772 second(s),query:5 Gzip enabled