Provisioning problem and MAC addresses

denyych
Posts: 4
Joined: 08 Feb 2016, 21:15

Provisioning problem and MAC addresses

Post by denyych » 10 Feb 2016, 18:24

Hello all,

I am trying to set up a provisioning server. I managed to make the TVIP to download the firmware from my own server, but I can't manage to make it download settings from the server.
I read the article in wiki.tvip.tv about it, but couldn't do it. I want to make it possible when a TVIP looks up the server for firmware/settings, depending on it's unique MAC address, to download specific xml settings file.

Thank you,
Denyych

TMC
Администратор
Posts: 925
Joined: 16 Jan 2014, 13:34

Re: Provisioning problem and MAC addresses

Post by TMC » 11 Feb 2016, 12:36

Could you, please, explain in more detail what steps you've already completed during server setup process?
What kind of provision server redirect did you use: manual, DNS, DHCP?

I suppose, first you need to have at least all your boxes get one config. When you will have success with that, you can move forward and add MAC-validation.

denyych
Posts: 4
Joined: 08 Feb 2016, 21:15

Re: Provisioning problem and MAC addresses

Post by denyych » 15 Feb 2016, 12:17

I used manual provision server. I managed to have all the boxes with one config, only the MAC validation is left. Where should I put the code exactly? How will the boxes access their configs? The MAC addresses need to be in database?

TMC
Администратор
Posts: 925
Joined: 16 Jan 2014, 13:34

Re: Provisioning problem and MAC addresses

Post by TMC » 16 Feb 2016, 11:13

If you are talking about example on this document: http://wiki.tvip.ru/en/provisioning
Then, you need to use provided config with NGINX web server.
The template on that page ("/var/www/tvipstb.net/prov.mac/$http_mac_address/") means that you create subdirectories in "prov.mac" named as MAC addresses.
So, if you create config like this: /var/www/tvipstb.net/prov.mac/00:00:00:00:00:01/tvip_provision.xml , it will apply to the STB with MAC address 00:00:00:00:00:01.

denyych
Posts: 4
Joined: 08 Feb 2016, 21:15

Re: Provisioning problem and MAC addresses

Post by denyych » 17 Feb 2016, 15:21

I use Apache 2 on Debian and I can not deal with the "template".

TMC
Администратор
Posts: 925
Joined: 16 Jan 2014, 13:34

Re: Provisioning problem and MAC addresses

Post by TMC » 17 Feb 2016, 16:59

denyych wrote:I use Apache 2 on Debian and I can not deal with the "template".
We only have a ready solution for NGINX.

Basically, you should check "Mac-Address" HTTP header when STB requests XML file and match it to your config. You can do this with PHP, for example.

denyych
Posts: 4
Joined: 08 Feb 2016, 21:15

Re: Provisioning problem and MAC addresses

Post by denyych » 19 Feb 2016, 10:51

I ran an NGINX server, it's working now. Can you please give me example config for the MAC filtering?

TMC
Администратор
Posts: 925
Joined: 16 Jan 2014, 13:34

Re: Provisioning problem and MAC addresses

Post by TMC » 19 Feb 2016, 12:04

denyych wrote:I ran an NGINX server, it's working now. Can you please give me example config for the MAC filtering?
The example is near the top of that page: http://wiki.tvip.ru/en/provisioning
You just need to put provided code into
server { ... }

block of your web-site config and change /var/www/tvipstb.net to your actual path to web-site directory.

dutch_boontje
Posts: 6
Joined: 23 Nov 2017, 09:56

Re: Provisioning problem and MAC addresses

Post by dutch_boontje » 23 Nov 2017, 10:38

Hi,

I am working on above configuration, but no luck at this moment

It seems that the variable $http_mac_address is not available on my version of nginx:
---
edwin@ubuntu-dl360:/var/www/html$ nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
---

Or are there any additional configs needed for nginx, besides the 'script' ?

I use this configuration, short version:

server {
... default stuff like servername, root, index, etc

# Make use of MAC-directories for TVIP
if ($http_mac_address) {
set $tvipmac M;
}
if (-d "/var/www/html/prov.mac/$http_mac_address/") {
set $tvipres F$tvipmac;
}
if ($tvipres = FM) {
rewrite ^/prov/(.*)$ /prov.mac/$http_mac_address/$1 break;
}

... rest of stuff aka:

location /prov/*\.xml$ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

... additional stuff /w php and other locations, but default config from installation
)

when I overrule if-statements, I see a request to the sub-directory, but de MAC-address part is missing:
nginx-config script replaced by:
---
set $tvipmac M;
set $tvipres F$tvipmac;
rewrite ^/prov/(.*)$ /prov.mac/$http_mac_address/$1 break;
---

nginx-logs:
==> /var/log/nginx/access.log <==
192.168.2.4 - - [23/Nov/2017:08:33:59 +0100] "GET /prov/tvip_provision.xml HTTP/1.1" 404 136 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"

==> /var/log/nginx/error.log <==
2017/11/23 08:33:59 [error] 20658#0: *1 open() "/var/www/html/prov.mac//tvip_provision.xml" failed (2: No such file or directory), client: 192.168.2.4, server: _, request: "GET /prov/tvip_provision.xml HTTP/1.1", host: "ubuntu-dl360"

I think some thing on the used variables is changed, related to the nginx you are using.

Any suggestions ??

dutch_boontje
Posts: 6
Joined: 23 Nov 2017, 09:56

Re: Provisioning problem and MAC addresses

Post by dutch_boontje » 23 Nov 2017, 12:08

Sorry, Sorry...

It's working, my test were faulty.

(For those want to know: I tested via a (wifi-)router. so no MAC address is available)

Post Reply