# Streaming video over LTE

Source: https://forum.modalai.com/topic/111/streaming-video-over-lte
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2021-01-23 11:28:44 UTC by Aldo Castro Freire
Replies: 14 · Views: 2194

## Aldo Castro Freire · 2021-01-23 11:28:44 UTC

Is there any tutorial on how to do that? Or is there any recommendation on how to get started. Wifi is not good enough for long distances.  
Is there a way to modify voxl-rtsp or do I have to forward the stream somewhere?

## Reply by Chad Sweet (ModalAI staff) · 2021-01-23 19:06:12 UTC

If the VOXL is connected to a VPN via LTE, then you should use the VOXL's endpoint IP as the RTSP video server for a video client (QGC, VLC, etc) connected to the same VPN. voxl-rtsp would be one way to stream the video

## Reply by Aldo Castro Freire · 2021-01-23 23:41:36 UTC

Hi Chad, how do I change the endpoint for the voxl-rtsp I think right now is only sending to the local area network 192.168.8.1.  I am not sure of where to change that ?

## Reply by Aldo Castro Freire · 2021-01-24 00:13:40 UTC

Nevermind As long as the setup is fine, the rtsp will send it using the LTE.
PS: you need to connect your local machine to the VPN also.

Now my question is: is this the order I must follow To allow streaming over LTE  I have to connect to the VPN and then start streaming ?   is there a way to set up a script to activate like a minute after LTE connection is established to connect to the VPN and then start streaming. Otherwise, if I start streaming before I connect to the VPN it won't work. ? if so is there documentation on how to write a service?

## Reply by Chad Sweet (ModalAI staff) · 2021-01-24 01:25:43 UTC

It's a standard Linux service, take a look at the [voxl-modem service](https://gitlab.com/voxl-public/utilities/voxl-modem/-/blob/master/service/voxl-modem.service) for an example

## Reply by tom (ModalAI staff) · 2021-01-25 20:37:52 UTC (in reply to Aldo Castro Freire)

@Aldo-Castro-Freire The services that we use to start LTE and VPN on bootup are voxl-modem, as Chad mentioned, [voxl-time-sync](https://gitlab.com/voxl-public/utilities/voxl-utils/-/blob/master/service/voxl-time-sync.service) which is a simple script which loops until the date / time is correct, meaning a connection to the internet has been established, and [voxl-vpn](https://gitlab.com/voxl-public/utilities/voxl-vpn/-/blob/master/service/vpn-start.service), which will then start the OpenVPN service after voxl-time-sync has finished.

## Reply by Aldo Castro Freire · 2021-01-25 22:10:08 UTC

Does voxl-vpn works with the new version of openvpn because I update mine to the 2.4.6

Also is this a service? Or does voxl-vpn sets up the service as voxl-configure-modem does?  I haven't seen anu documentation for voxl-vpn.

## Reply by tom (ModalAI staff) · 2021-01-25 22:18:24 UTC

voxl-vpn is just a wrapper for calling OpenVPN, it's not required, you can use OpenVPN on its own. We haven't tested with 2.4.6 but I don't see why it wouldn't work. All you should need to do is modify the key path in the service file.

## Reply by Aldo Castro Freire · 2021-01-25 22:28:30 UTC

Okay. So basically use voxl-modem.service as a sample and exec voxl-vpn instead voxl-modem-start.sh  .And start this service after voxl-modem.service

## Reply by tom (ModalAI staff) · 2021-01-25 22:35:16 UTC

All the voxl-modem.service does is call `voxl-modem-start.sh`.

So what I would recommend and what works for us is:

Start `voxl-modem` service -> Gets LTE connection up and running
Start `voxl-time-sync` sevice -> Verifies connection to internet
Start `vpn-start` service -> Connects to VPN

If you have all three of these enabled they should start at the correct times to get you going.

## Reply by tom (ModalAI staff) · 2021-01-25 22:37:07 UTC (in reply to tom)

@tom OpenVPN will fail if the date / time is not set correctly, that is why we use `voxl-time-sync` to have OpenVPN wait until the date / time is correct. This sometimes takes a couple seconds after the modem has connected to the network

## Reply by Aldo Castro Freire · 2021-01-25 23:01:20 UTC

Is there a command called vpn-start? I cannot find it in my voxl. Or should I make a script that opens the vpn?

## Reply by tom (ModalAI staff) · 2021-01-25 23:29:53 UTC

vpn-start is a service file that you can find at `/etc/systemd/system/vpn-start.service`. You can modify the KEY_FILE parameter with the path to your OpenVPN key file and enable the service using `systemctl enable vpn-start`.

## Reply by Aldo Castro Freire · 2021-01-26 15:40:51 UTC

Hi is there an easy way to open and read a file in Voxl such as nano and vim ??  it is a pain to have to transfer files between machines

## Reply by tom (ModalAI staff) · 2021-01-26 15:43:46 UTC

Yes you can use `vi` on VOXL
