## ## ## ## ## ## #### ## ## ## ##
_________ \__ __/ ) ( | | | | | | ___) (___ \_______/
____ / ___| | | _ | |_| | \____|
## ## ##### ## ## ## ## ## ##
## ## ## ## ## ## ## ## #####
IMPORTANT: enter the case-INsensitive alphabetic (no numbers) code AND WRITE SOME SHORT summary of changes (below) if you are saving changes. (not required for previewing changes). Wiki-spamming is not tolerated, will be removed, so it does NOT even show up in history. Spammers go away now. Visit Preferences to set your user name Summary of change: '''VemsTune Connection via TCP''' * possibly '''wireless''' ! * or ... ECU is '''over the ocean''', ECU is over the sea... OverTCPWifiModule VemsTune can connect to VEMS v3 ECU (or to [http://shop.vems.hu/catalog/engine-management-c-1.html VEMS Round gauge]) via TCP. '''LAN Requirements''' - local network * a PC/notebook or a smart wifi router device is required on the ECU side ** the IP address of the device must be known (ifconfig on unix, ipconfig /all on windows). IP can be any (including 10.x.x.x or 192.168.x.x ) * VemsTune (of course) If the ECU is distant instead of the local network (for experienced network-users), see WAN requirements way below. ---- '''Orange PI PC''' (Plus (2)) to '''listen on TCP port 9001''' Debian or Ubuntu commands, same on x86 or x86_64 notebooks * USB-RS232 is /dev/ttyUSB0 * internal serial is /dev/ttyAMA0 (??) but kernel serial console might be in the way (and RS232-serial to TTL-serial adapter is needed, of course) <code> sudo bash (or acquire root privilege some suitable way) apt-get install ser2net echo '9001:raw:600:/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT'>>/etc/ser2net.conf /etc/init.d/ser2net restart </code> should be similar for gentoo or other distro. Min 1.08 GHz, quadcore not necessary to tunnel TCP-serial data, but recommended for audio and video capturing/streaming and other usecases. See SocatOptions ---- '''LAN, Local Network Setup Example with TPLINK smart router''' (for openwrt only: using a PC for serial-TCP bridge is simpler to setup) http://www.vems.hu/files/pacsa/tplink-v3/tplink-v3.jpg # Need a wireless router with usb host and openwrt. ## Hardware: [https://www.epointsystem.org/trac/vending_machine/wiki/WR1043ND TP-Link TL-WR1043ND] https://www.epointsystem.org/trac/vending_machine/attachment/wiki/WR1043ND/wr1043nd.jpg?format=raw # Upgrade it to openwrt ## Openwrt installation: https://www.epointsystem.org/trac/vending_machine/wiki/HotSpotInstallation#InstructionsforTP-LinkTL-WR1043ND # open a browser and try open the admin page. # install packages: go System/software menu (of course the router needs internet connection to acomplish this step) ## kmod-usb-serial-pl2303 (if you have another vendor like FTDI try to find appropriate driver for it) ## kmod-usb2 ## ser2net #ssh to to the router and try to plug the usb-rs232 cable #after dmesg should see something like this: " ## usb 1-1: new full speed USB device using ar71xx-ehci and address 3 ## usb 1-1: configuration #1 chosen from 1 choice ## pl2303 1-1:1.0: pl2303 converter detected ## usb 1-1: pl2303 converter now attached to ttyUSB0" # To make ser2net listen on TCP port 9000, '''append 1 line to the end of the /etc/ser2net.conf file:''' ## 9000:raw:0:/dev/ttyUSB0:19200 ## alternatively (using a bit more options): ## 9000:raw:600:/dev/ttyUSB0:19200 8DATABITS NONE # start ser2net: ser2net '''VemsTune setup''' #Preferences/ECU Communication ## select tcp: and write the correct IP:PORT in my case 192.168.1.3:9000 press detect Enjoy your wireless V3. ---- I have tested this method with an Asus WL-500pP v2 router OpenWrt backfire 10.3 version, and with Pl-2303 usb serial converter succesfully. Installed packages: #kmod-usb-ohci #kmod-usb-serial-pl2303 #ser2net The vemstune works fine with tcp/ip connection but the communication is slower than native serial or usb-serial converter (19200baud). I have made some test: With wired connection the main overview group refresh about 17 Hz, and the calc model refresh more than 22 Hz. With wifi-connection tha main page below 10 Hz but calc model page sometimes go up to 22 Hz sometimes go to 3 Hz. ---- '''Router with serial port''' Ubiquiti produces RouterStation Pro [http://www.ubnt.com/rspro] that has a built in dB9 connector. It comes with OpenWrt installed and we would not need an USB-Serial cable with this setup. Although I have did not tested it yet, it should work well. ---- '''WAN Requirements''' - (ECU is at a remote internet location, possibly behind a firewall) This is only for experienced network-users for now. * a PC/notebook or a smart wifi router device is required on the ECU side ** the IP address of the internet connection must be known ([http://www.ipgeotool.com/ ipgeotool] or from router admin inerface) ** the IP address of the device must be known if different (ifconfig on unix, ipconfig /all on windows) ** currently the chosen TCP port of this device MUST be directly reachable by VemsTune: ** if the device is behind a firewall, a DNAT rule in the firewall is necessary, similar to: ** iptables -t nat -I PREROUTING -i ppp0 -p tcp --dport 9000 -j DNAT --to-destination 192.168.1.3 ** In short VemsTune is like a web browser (special network setup not required) and the ECU side (ser2net) acts like a web server so special network setup is needed there (note: using raw, not HTTP protocol). ** developers will work on a relay solution to go around this inconvenience * internet connection on VemsTune side ** nothing special here: VemsTune can be behind a firewall, since VemsTune will initiate the outbond TCP connection like a web browser ---- '''Setting up the ECU side PC or notebook''' (instead of smart-router) To connect the VEMS ECU to the network A PC (notebook) is also suitable instead of the smart router. Actually, with a linux PC it is easier than with a smart router. * ser2net on linux/unix with the following line in /etc/ser2net.conf ** ''3002:raw:0:/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT'' ** installation of programs on linux is easy with the package manager. Eg on debian, mepis, ubuntu: ''apt-get install ser2net'' * [http://lftr.dyndns.ws/del/ser2net/ ser2net on windows] (SerialTCPBridge.zip temporary location) ** could be bundled with VemsTune some day, with help and .bat files * TODO: [http://sourceforge.net/projects/net2com/ net2com] on windows * TODO: other options for windows users (search "putty serial.backend") Above ("ser2net") solutions allow only 1 TCP connection (1 VemsDisplay or 1 VemsTune or other). See * VemsTuneMulticast * BuildrootOrangePiPc Optional: Add document to category: Wiki formatting: * is Bullet list ** Bullet list subentry ... '''Bold''', ---- is horizontal ruler, <code> preformatted text... </code> See wiki editing HELP for tables and other formatting tips and tricks.