Community discussions

MikroTik App
 
karaYusuf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Wed Oct 12, 2022 11:07 am

I need help with syntax

Fri Feb 10, 2023 2:22 pm

Hello Guys,
I am sorry for this stupid question but I just could not figure it out.
I wanted to add a virtual wireless interface like the following code. My problem is that i want as ssid the name of the router plus this sign : /2
/interface/wireless/add name=wlan3 master-interface=wlan1 mode=ap-bridge ssid="[/system/identity/get name] + /2" security-profile=default disabled=no;

/interface/bridge/port/add interface=wlan3 bridge=bridgeLAN;
I just do not know how to make that possible. As you can see in the code I tried some things out, but it did not work. The challenge also is that I do not use any variables.
I hope someone can help me with this thing.
 
User avatar
Sertik
Member
Member
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: I need help with syntax

Fri Feb 10, 2023 2:36 pm

/interface/wireless/add name=wlan3 master-interface=wlan1 mode=ap-bridge ssid="[/system/identity/get name] + /2" security-profile=default disabled=no;

/interface/wireless/add name=wlan3 master-interface=wlan1 mode=ap-bridge ssid=("[/system/identity/get name]"."\/2") security-profile=default disabled=no;
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: I need help with syntax

Fri Feb 10, 2023 2:46 pm

???
Simply:
/interface wireless add […] ssid="$[/sys id get name]/2" […]
on your example
ssid=("[/system/identity/get name]"."\/2")
must be writed:
ssid=([/system/identity/get name]."/2")
without quotas, [/system/identity/get name] is a "command", not a string, and why "escape" the "/" ???

I suggest you to not use extra characters on SSID but use only "standard" -, 0-9, A-Z, a-z and _ for prevent problems with iSewer phone...
And not just on MikroTik products. I still have problems with iSewer and other old smartphones if are used "strange" characters (from smartphone point of view).
 
User avatar
Sertik
Member
Member
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: I need help with syntax

Fri Feb 10, 2023 3:05 pm

Yes, you don’t need to screen, I overdid it here ... But let the topcaster try it himself, so he will remember better ... :)
 
karaYusuf
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Wed Oct 12, 2022 11:07 am

Re: I need help with syntax

Fri Feb 10, 2023 4:19 pm

/interface/wireless/add name=wlan3 master-interface=wlan1 mode=ap-bridge ssid=("[/system/identity/get name]"."\/2") security-profile=default disabled=no;
I also saw that mistake and made this:
/interface/wireless/add name=wlan3 master-interface=wlan1 mode=ap-bridge ssid=([/system/identity/get name]."/2") security-profile=default disabled=no;
Yes, you don’t need to screen, I overdid it here ... But let the topcaster try it himself, so he will remember better ... :)
Yes, I learned something because I saw the other posts to late.
Thank you guys very much for you help.
 
CarmosKarrvx
just joined
Posts: 3
Joined: Fri Jan 20, 2023 10:53 am

Re: I need help with syntax

Wed Feb 15, 2023 1:13 pm

My recommendation is to avoid using non-standard characters in your SSID and only use "-", 0-9, A-Z, a-z, and "_" to prevent issues with older smartphones like iSewer.

Who is online

Users browsing this forum: nickcarr and 24 guests