Community discussions

MUM Europe 2020
 
maciejz
just joined
Topic Author
Posts: 3
Joined: Mon Nov 18, 2019 10:48 pm

Image on the vouchers

Tue Nov 19, 2019 12:12 am

Hi guys,

I have Mikrotik Hex S working as internet router with the following setup:
- Interface Eth1: WAN with public IP address provided by the ISP
- Interface Eth2-5: LAN (all these interfaces are members of the same Bridge with with 192.168.9.1/24 address assigned to it)
- Additionally, there's VLAN20 configured on Eth5 that's used for guest wifi with 192.168.10.1/24 address assigned to that interface

There's external AP (Ubiquiti) connected to Mikrotik's interface Eth5 with 2 SSIDs: LANWifi and GuestWifi. Traffic from both SSIDs is running from the AP to Eth5: LANWifi as untagged and GuestWifi as VLAN20. Both wifi networks work well. LANWifi allows access to both LAN and internet without any authentication. There's Hostspot configured on MT on interface VLA2N0 and each client connecting to GuestWifi is getting customized Hotspot captive screen and can access internet only after succesful login. So far so good.

I've developed new voucher template with image and QRcode. Initially, I stored both *.png image and *.js QRCode scripts on external web server (192.168.9.11) and used such command in voucher template header/row sections: <img class="logo" src="http://192.168.9.11/logo.png">. Everything worked fine - I was able seeing and printing the vouchers with logo and QRCode.

Then I decided to store the image and script files on Mikrotik to eliminate external web server dependency. Unfortunately, with the files stored on MT, I can't display the vouchers with graphics anymore, just the text is displayed. I've run Chrome Inspect funtions and I can see error 'Failed to load resource: the server responded with a status of 404 (Not Found)'. I guess the path to the files specificd in voucher template is incorrect. I tried either directly pointing thr file: <img class="logo" src="/logo.png"> or via Mikrotik IP. Although I'm connected to LAN (192.168.9.x IP on my PC), I've tried pointing both MT interfaces: <img class="logo" src="http://192.168.9.1/logo.png"> or <img class="logo" src="http://192.168.10.1/logo.png">. I tried also various foldel combinations: /flash/img/logo.png, /img/logo.png etc. either directly or with MT IP address. None of the combination works well.

Could you please shut any tip how the issue could be fixed/investigated or maybe just provide working solution, i.e. what exactly command should be used in voucher template to refer specific file stored om MT.

Thanks
Maciej
 
maciejz
just joined
Topic Author
Posts: 3
Joined: Mon Nov 18, 2019 10:48 pm

Re: Image on the vouchers

Sat Nov 30, 2019 7:48 pm

Guys, come on - none has working hotspot with logo/image hosted on Mikrotik itself? :)
If anyone had such setup then please share the template or just the specific line in your voucher template that's pointing the image on MT box.

Thanks
Maciej
 
Zacharias
Forum Guru
Forum Guru
Posts: 1083
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Image on the vouchers  [SOLVED]

Sat Nov 30, 2019 10:58 pm

Well am not sure if enabling the SMB on mikrotik would help...
https://wiki.mikrotik.com/wiki/Manual:IP/SMB
 
maciejz
just joined
Topic Author
Posts: 3
Joined: Mon Nov 18, 2019 10:48 pm

Re: Image on the vouchers

Sat Dec 07, 2019 11:15 am

@Zacharias, thank you for the tip, it solved my problem. I configured SMB on Mikrotik and allowed access from specific IPs in LAN only.

If anyone else wanted using that solution, then note please that due to security reasons newer web browsers (e.g. Chrome) do not allow linking remote files in html code. I don't know if there's any tweak, I switched to IE11 for now and it works well.

Thanks
Maciej.
 
Zacharias
Forum Guru
Forum Guru
Posts: 1083
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Image on the vouchers

Sat Dec 07, 2019 2:58 pm

@Zacharias, thank you for the tip, it solved my problem. I configured SMB on Mikrotik and allowed access from specific IPs in LAN only.
Great, you can mark the post as solved..

Who is online

Users browsing this forum: No registered users and 4 guests