OpenMarine

Full Version: Data Dongle or tethered phone for remote MQTT ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all
I want to setup a mobile/GSM data connection so that I can remotely monitor my boat. 
I've setup the MQTT stuff on the Pi and I can monitor it when the Pi is connected to a WiFi network but I now want to connect the Pi to the internet using GSM 3G or 4G.
I have a Vodafone/Huawei K4203 dongle and a number of old phones which I could use but have no idea how to connect/set them up on Raspbian/Linux/OpenPlotter
Bye the way, I am in the UK and the boat is in Greece

So ... if you have this sort of connection setup Id be very interested to hear how you set it up. 

Thanks
Steve
(2018-07-01, 08:29 AM)affinite Wrote: [ -> ]Hi all
I want to setup a mobile/GSM data connection so that I can remotely monitor my boat. 
I've setup the MQTT stuff on the Pi and I can monitor it when the Pi is connected to a WiFi network but I now want to connect the Pi to the internet using GSM 3G or 4G.
I have a Vodafone/Huawei K4203 dongle and a number of old phones which I could use but have no idea how to connect/set them up on Raspbian/Linux/OpenPlotter
Bye the way, I am in the UK and the boat is in Greece

So ... if you have this sort of connection setup Id be very interested to hear how you set it up. 

Thanks
Steve

I've done this  before with a Huawei K3772 on OpenWRT (Linux with only 4MB footprint) installed on a cheap travel router (having an USB port).
It was quite hard to do. With a smartphone, the config would be zero on Openlotter, just connect and activate USB tethering.

Here below how I did for the Huawei.
Starting point: openwrt-15.05.1-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin (= very basic Linux kernel with router function)
Installed following packages from
http://archive.openwrt.org/chaos_calmer/...ages/base/

chat
comgt
librt
libpthread
libusb
usb-modeswitch
kmod-usb-serial
kmod-usb-serial-wwan
kmod-usb-serial-option

http://www.draisberghof.de/usb_modeswitc...php?t=1006

Changed the file /etc/usb-mode.json
Replaced a Huawei (vendor 4817) its product number (eg. 5321) to 5327 (HEX
for 14cf), HuweiNew left in place
Executed usbmode -s -v -c /etc/usb-mode.json

Add lines to /etc/config/network

config interface 'wan'
        option proto '3g'
        option service 'umts_only'
        option device '/dev/ttyUSB0'
        option apn 'www.iamgprs2.ma'
        option pincode '0000'

Change dial number in /etc/chatscripts/3g.chat to *99#

Reboot router, wait, if needed, execute manual usb_modeswitch command, try
to connect, wait, try again

Last step: create zone WAN, set forwarding from lan to wan

Useful commands: dmesg, cat /sys/kernel/debug/usb/devices, usbmode -l,
ifup wan, logread