OpenSeaMap-dev:HW-logger/Victor.en: Unterschied zwischen den Versionen

Aus OpenSeaMap-dev
Wechseln zu: Navigation, Suche
K
K
Zeile 53: Zeile 53:
  
 
Caution: The MR3020 will be flashed with a new software. You will loose all garanty.
 
Caution: The MR3020 will be flashed with a new software. You will loose all garanty.
Während des Flashprozesss darf die Stromversorgung nicht unterbrochen werden.
+
During the flash process the power must not broken.
 
 
 
== Configuration of the hardware ==
 
== Configuration of the hardware ==
  

Version vom 30. April 2013, 16:53 Uhr

NMEA-0183 Logger

Safety issue

Connecting NMEA0183 devices to a an RS232-USB-Converter may cause problems. As we use the converter only for reading it may run without further problems.

Functions
  • Collects data from serial devices
    GPS, AIS, Plotter, Sounder with NMEA-0183 can be connected via a RS232-USB-Converter.
    Several devices (up to 4) may be plugged in an 4-Port USB-Hub.
    Sounder with seatalk-1 may be connected via a Seatalk-NMEA-Converter.
  • logs NMEA-Data to an USB-Memory-Stick, starts and stops by pressing a button
  • has an build-in Wifi-access point and make the nmne-data available on a tablet or a phone
  • nmea-dat are available via LAN/Ethernet as an TCP-IP-Stream.
  • UMTS-Connection to the internet with an additional 3G-Stick
    All crew members may have access to the internet with theit tablet or smartphone in the habour.

Hardware

Nr Device Price Remarks
1 TP-Link MR3020 30-35 € Das device must be flashed and configured with a new software.
1 4-Port USB-Hub 7 €
1 4GB USB-Memory-Stick 3 € with 4 Unix partitions und Unix-ext3-File-System
x Seriell-USB-Converter 10 € one for each nmea-device needed
Attention: only the FTDI and the PL2303 Chip is supported
x Seatalk-NMEA0183 Konverter for all devices on the SeaTalk-1-Bus, should have galvanic
x RS-232-Buchse 1 € one for each device

Data sources on the boat

  1. GPS-Receiver with NMEA0183-Data at 4800 Baud
  2. AIS-Receiver with VDM Data at 38400 Baud
  3. Raymarine-Seatalk-Convetre from Gadgetpool or another Seatalk NMEA-Conveter.

These data-streams are mixed together

Output

  1. as a TCP-IP-Data-stream via WIFI or Ethernet
  2. as a textfile on the usb-memory-stick.

The data-stream may be read with an android-app or a Windows 8 app and displayed

Caution: The MR3020 will be flashed with a new software. You will loose all garanty. During the flash process the power must not broken.

Configuration of the hardware

For Beginners

  • Contact Victor . Mail: vklogger at arcor.de
  • Buy the described parts (Box und USB-Menory-Stick) und assure that the version of the hardware is: Version TL-MR3020 Ver. 1.7.
  • Send the TP-Link and the USB-Stick to Victor, add 5 € for the sending back.

Victor will configure both and send it back within two weeks.

Anschrift:

vklogger at arcor.de

for linux experts

You need the file factory.bin and the folder gpsdToolsAR77xx. Please contact "vklogger at arcor.de", you will get it per mail.

This tutorial assumes that you have a home-network with dsl. The local subnet should have the ip-range 192.168.1.xxx. The new flashed router will have the ip 192.168.1.1. You can change to another static adress for the router later. You new some linux-basics and a running linux-machine. There are three critical points: Es gibt drei kritische Stellen:

1. the flashing must not broken
2. the new flashed box must be reached in the local net on 192.168.1.xxx .
3. Thre muts be a usb-memory-stci with four linux partitions.

The following steps are necessary:

prepare the usb-memory-stick
1. copy the folder gpsdToolsAR77xx to a running linux-machine, within the folder is a directory tree we use later
2. you have to partioning the usb-stick and format with ext3
3. Create four partitions:
Partition size for format with
part1 1 GB copy of the os ext3
part2 100 MB swap linuxSwap
part3 scripts and log-Data ext3
part4 ext3
4. Format in this way: part1 with ext3, part2 with linuxSwap, part3 with ext3, part4 with ext3
5. Copy the data from gpsdToolsAR77xx to the partition part3.
6. you may throw out the stick from the linux-machine.
We only need part3 , we prepare the stick for further use.
make the box
1. Assume that the "factory.bin" is on the PC.
2. Connect PC and the Router direct with the short white networkcable Netzwerkkabel
power upthe router. The router starts up and gives the pc a ip-adresse.
3. Use the browser with:
 http://192.169.1.254
you will see the original webinterface of the router.
4. Now you make a firmaware update, use as the new firmware factory.bin from 1.
5. It takes about two minutes to flash, the the router reboots. This is critical, wait.
6. The baisis-ip of the Software has changed to 192.168.1.1. Use the browser:
http://192.168.1.1
you will see the gui LUCI from OpenWrt.
"go to password configuration" and click login, the change the password.
7. if you the the gui from openwrt, the box is configured in the basis.
8. Connect via ssh(putty) to the box, check for the password.
9. I assume that your local network has 192.168.1.xxx, and you local router has adress 192.168.1.251 hat.
First we change the configuration in the box, the box must use you local router as the gateway and provider for the dns .
We will disable DHCP in the new box,
This is critical, you will not be able to access the box, it will be bricked.
Here you can choose another basis adress for the router.
In LUCI --> Network-->Interfaces-->LAN-->Edit :
IP4 gateway:set it to 192.168.1.251, Use custom DNS servers : 192.168.1.251, Disable DHCP
please check twice, then Save&Apply, check again.
10. Connect the Box to your home router and make a reboot of the box.
11. do a http://192.168.1.1 in the browser eingeben, do we have LUCI LUCI ??, we finished the critical part.
12. connect again with ssh (putty) and login as root, this is a good second controll-window, do a "dmesg" you will see the kernel messages.
we continue with the gui, but you can also do everything from the root-console.
13. Test the internet-connection: Network-->Diagnostics-->Ping, if successfull we go further.
14. install software packages:System-->Software,
at the begiining about 81% are free, we will have only few space, please install only the necessary things.
Click Update lists.
15. choose "availabe packages" we install first the support for the USB-Stick
15.1 k : choose "kmod-usb-storage" and install , 72% free
15.2 plugin the USB-Stick with the 4 Linuxpartitions and issue a dmesg on the console: ... sda: sda1 sda2 sda3 sda4
15.3 see k: choose "kmod-fs-ext3"4 and install, 54 % free
15.4 use the console: /mnt then cd /mnt
15.5 mkdir sd1, mkdir sd3, test with ls
15.6 mount -t ext3 /dev/sda1 /mnt/sd1 and mout -t ext3 /dev/sda3 /mnt/sd3, test with dmesg
15.7 change to /mnt/sd3: cd /sd3, now you should see the directories on the stick
16. we install the packet gpsd using LUCI: see g: gpsd install, 30% free
17. we install the driver for USB-RS232-converter
17.1 install: k-mod-usb-serial 30%
17.2 install: k-mod-usb-serial-ftdi 27%
18. we change to /mnt and unmount the stick: umount /mnt/sd3
19. plug in the 4-port-hub and a FTDI-Converter, do a "dmesg",
there should be an entry with " usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB0", you can also read it in Status-->System-log.
20. we test the gpsd
20.1. LUCI-->System -->Startup : click "gpsd Start", read the System log you should find "user.notice.gpsd Starting.." , you can ignore the IPv6-message.
20.2 make a "pgrep gpsd" on the console, if the gpsd is running you get a process number.
21. install the gps-Client Paket, now the flash memory get low: System-Software, we have 10% left.
22. test gpspipe on the console
 gpspipe -h 
if no error try
 gpspipe -r 
the gpsd gives you an information about the connected devices.
if there are nmea-data , the data will be displayed. Wait if you do not see further data. gpsd will explore the right communication setting for you. If you have 38400 baud data, this may take 2 minutes.

Now you have the basis running.


Extensions
1. configure the WPS-Button, a log-file will be written to /mnt/sd3/nmea_data/ .
mount -t ext3 /dev/sda3 mnt/sd3
install the scripts und configuration for gpsd and LUCI :
first for the gpsd and the strat of gpspipe by pressing the WPS-button on the Router
2.from the root-prompt: cd /mnt/sd3/installer , then ls. You will see some scripts with self-explaining names.
These scripts copy scripts from the directory-structure on the stick to the right places in the flash.
2.1 set "option globally" . With this you can access gpsd not only form local host but from a Tablet or another PC
configure gpsd that several converters are possible:
 ash replace_gpsd_scripts 
2.2 configure WPS-Button:
ash create_50_wps 
if the WPS-Button is pressed , gpspipe logs the NMEA-Data, check in the System-log and search in /mnt/sd3/nmea_data for the last log-file.
tail -f gpsd_nmeaxx.log
2.3 a second press on the WPS-Button terminates the logging, controll in syslog.
3. Configure the gpsd-gui in LUCI , ther will be a item in the Network-gui .
3.1 ash install_model_luci_gpsd_gui
3.2 ash install_controller_luci_gpsd_gui
3.3 gpsd is now able to get data from several converters:LUCI--> System-->Network--> gps devices.


Now we have 10% des Flash free. If you want support for a 3G-Modem you should delete the not used programms from the gps-client Packet. They are in /usr/bin. you can delete cgps, gpsctrl, gpsdecode, gpsmon and lcdgps.


4. Configuration of a 3-G Modem
see dazu http://wiki.openwrt.org/doc/recipes/3gdongle
to be installed:
kmod-usb-serial-option,
kmod-usb-serial-wwan,
luci-proto-3g

Now you can configure in luci-Network-interfaces a new Interface.

Name: 3g
Protocoll: UMTS, then submit

Now set Modem-Device, Servic Servicetype, APN, Username and Password. Watch the ttyUSB- /dev/ttyUSBx, if the stick is plugged in, he searches for a new interface typically ttyUSB2 und ttyUSB3. You can read it in the system log.We use the first inteface. If you get a messsage like "link is not 8-Bit clean" you shouls check the authetication. Try the other interface.

Parameter für e-plus:

Modem device: aus der Auswahlliste ttyUSBx
Service Type : UMTS/GPRS
APN: internet.eplus.de
username: eplus
password: eplus

This configuration was tested with a Huawei E160.