Community discussions

MikroTik App

Search found 222 matches

by DyadyaGenya
Tue Sep 03, 2024 2:00 pm
Forum: Scripting
Topic: PDU conversion
Replies: 1
Views: 586

Re: PDU conversion

I forgot the third question: is there a function for converting from PDU to Cyrillic characters?
by DyadyaGenya
Tue Sep 03, 2024 1:54 pm
Forum: Scripting
Topic: PDU conversion
Replies: 1
Views: 586

PDU conversion

Hi all. For a long time it was not possible to finalize the function for working with SMS reading. Essentially, all that remains is to deal with the recoding. Both with Latin and Cyrillic characters. To convert from PDU to Latin (can be sent immediately from telegram and printed normally in the Mikr...
by DyadyaGenya
Wed Mar 27, 2024 12:19 am
Forum: General
Topic: Connect two Mikrotik with gray IP using WireGuard
Replies: 9
Views: 1237

Re: Connect two Mikrotik with gray IP using WireGuard

What do you mean by gray addresses? I am only familiar with mauve addresses. https://help.mikrotik.com/docs/display/ROS/Back+To+Home Something I didn't think about. We have a tradition of calling them Grays. Gray ones are, in other words, dynamic Internet addresses. Which change after reconnection....
by DyadyaGenya
Tue Mar 26, 2024 9:46 pm
Forum: General
Topic: Connect two Mikrotik with gray IP using WireGuard
Replies: 9
Views: 1237

Connect two Mikrotik with gray IP using WireGuard

Hi all. There is a need to connect two Mikrotik that have gray IPs. I understand that I need to find a server/site that would provide a similar service, that is, build a WireGuard server on its own. Preferably free. Everything that I managed to look at gives the opportunity to set up a WireGuard VPN...
by DyadyaGenya
Mon Mar 25, 2024 11:37 pm
Forum: General
Topic: DNS and mDNS name conflict
Replies: 5
Views: 1271

Re: DNS and mDNS name conflict

Additionally, Mikrotik does not create static DNS entries based on DHCP leases (which you can use a script to fix). But what about the DNS names in my local DNS zone for other devices that do not have a configured mDNS name? I registered them in Mikrotik and can contact them by this name. They are ...
by DyadyaGenya
Mon Mar 25, 2024 6:49 pm
Forum: General
Topic: DNS and mDNS name conflict
Replies: 5
Views: 1271

Re: DNS and mDNS name conflict

Just adding a .local to a static DNS is not enough to enable it for mDNS I did not add ".local" in the domain zones of my local DNS server. This is configured on the Arduino device itself, and apparently on QNAP. In order for me to ping/address them by mDNS name, for example, sens.local ,...
by DyadyaGenya
Mon Mar 25, 2024 6:14 pm
Forum: General
Topic: DNS and mDNS name conflict
Replies: 5
Views: 1271

DNS and mDNS name conflict

On my Mikrotik, I configured a DNS server for a local domain zone. Everything seems to be working well, devices respond by name. Naturally, they have no access to the Internet. There are also several Arduino boards running on my network, which I initially configured to use mDNS. Previously I had not...
by DyadyaGenya
Thu Jan 25, 2024 11:54 pm
Forum: Beginner Basics
Topic: Is it worth using match-subdomain and how to do it correctly?
Replies: 0
Views: 565

Is it worth using match-subdomain and how to do it correctly?

Hi. I don’t really understand network settings, only very superficially, but I have certain wishes for setting up my three local networks. Let it be Lan1, Lan2, Lan3. I like to refer to some of my devices by name. In this case, I would like to divide the devices into groups like this: PCs, tablets, ...
by DyadyaGenya
Sat Dec 09, 2023 6:33 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Adguard is DNS service afaik (resolving hosts into IPs), it has nothing with traffic routing. I understand that AdGuard has nothing to do with redirecting traffic. That’s why I wrote that my question only theoretically partially concerns setting up the container. I assume that such traffic redirect...
by DyadyaGenya
Sat Dec 09, 2023 4:17 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Maybe DNS IP is manually set on that PC? Although I was sure that I had dynamic DNS registered, I decided to double-check and you were right. I forgot to clear persistent DNS in my PC settings. set only in ROS DNS (/ip/dns) and in Adguard configure conditional DNS forwarding for lan domain to be re...
by DyadyaGenya
Sat Dec 09, 2023 3:01 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

There is one more question that theoretically concerns container configuration. Suppose I want traffic from a certain site to first pass through some third-party VPN service, and then return to the AdGuardHome container and then to my network. Is it possible to do this and how?
by DyadyaGenya
Sat Dec 09, 2023 2:55 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Add to DHCP server network Adguard IP for DNS: /ip dhcp-server network add address=192.168.0.0/24 dns-server= 172.17.0.2, 192.168.0.2,192.168.0.1,8.8.8.8 gateway=192.168.0.2 Yes, it helped. It’s just strange why it worked on my PC even without these settings. And you can remove it from ROS DNS (unl...
by DyadyaGenya
Sat Dec 09, 2023 12:25 am
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Here you can se my scenario how I use additional DNS services with ROS. I wish I had found this topic sooner. Perhaps I would not have started my own topic. And since this happened, I’ll continue here, although it might be worth moving on to the topic you indicated. I connected a couple more PCs an...
by DyadyaGenya
Fri Dec 08, 2023 5:53 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

I guessing that since you didn't reveal configuration I believe that you meant this type of configuration, because I can’t draw as beautifully as you do, and I don’t understand everything, and I’m not sure whether my drawing will coincide with reality. # 2023-12-08 17:22:43 by RouterOS 7.10.2 # # m...
by DyadyaGenya
Fri Dec 08, 2023 3:06 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

I realized one mistake. The container’s DNS was registered at the end of the queue, I raised it higher and it seemed like the traffic went through the container. BUT I don’t see requests from devices via Wi-Fi. Although Wi-Fi seems to be involved in network bridge and there is Internet on the phones.
by DyadyaGenya
Thu Dec 07, 2023 12:08 am
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

I have different setup (IP firewall for bridge) and I need this rule Apparently I still have an error in setting up the firewall configuration. The fact is that although my adguard starts, the statistics show nothing. And it’s not clear whether this is a problem with Adguard or Mikrotik settings. A...
by DyadyaGenya
Wed Dec 06, 2023 9:09 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

If you added other rules from MT Container tutorial try with: /ip/firewall/filter/add chain=forward action=accept in-interface-list=LAN out-interface=containers If you have defconf configuration, order that rule below defconf: drop invalid rule. By the way, I tried to remove this rule and the conta...
by DyadyaGenya
Wed Dec 06, 2023 9:06 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Address subnet is missing for dockers bridge:
/ip address add address=172.17.0.1/24 interface=dockers
Yes, again my carelessness. Ping went. Thank you. I will try to further understand containers and adguard.
by DyadyaGenya
Wed Dec 06, 2023 8:53 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

I didn't know name you assigned to containers bridge, I assumed containers since is like that in tutorial, but in your case is dockers , then replace containers with dockers in that rule. in/out-interface in rules can be interface (not all) or bridge. That's what I thought, but unfortunately, the p...
by DyadyaGenya
Wed Dec 06, 2023 7:31 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

If you added other rules from MT Container tutorial try with: I will try to do as in the instructions. Here are the steps I did: /system device-mode update container=yes /container set 0 logging=yes /interface bridge add name=dockers /ip address add address=172.17.0.1 interface=dockers /interface v...
by DyadyaGenya
Wed Dec 06, 2023 7:03 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

If container VETH is on different bridge than LAN, then this is normal, you need firewall rule fo accept forward traffic in/out containers bridge or VETH IP (depends how you need to secure containers network). Of course it is on another bridge. I did as in the instructions. The bridge itself pings ...
by DyadyaGenya
Wed Dec 06, 2023 6:52 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Containers are stopped by default after deploying, needs to be started manually /container/run <container_number> and also you can set start-on-boot=yes to autorun container on ROS startup.
I just did this, but another problem appeared, voiced above.
by DyadyaGenya
Wed Dec 06, 2023 6:51 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Now I have another problem. The container was downloaded, installed, received the status “stopped”, I made a command so that it would start automatically after rebooting Mikrotik container set start-on-boot=yes 0 I overloaded the router, the logs show that the container has started, the status is “r...
by DyadyaGenya
Wed Dec 06, 2023 6:00 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Although I updated ROS and saw that the packages needed to be updated. The container installation is now successful. Although in the state it writes that it has been stopped. I think that the main problem has been solved, I will read further on how to start a container
by DyadyaGenya
Wed Dec 06, 2023 5:53 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

On which ROS version? There was issue with OCI manifest, fixed in ROS 7.10.
*) container - fixed "container pull" to support OCI manifest format;
7.9.1
Now I’ll try to update to 7.10.2 But I forgot, will I also need to update the packages that are installed on me?
by DyadyaGenya
Wed Dec 06, 2023 5:26 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Remove the container and re-create This was the first thing I tried after your advice to enable logging. You specify as root-dir=adguard => This will write on the local flash, you have enough space ?? Yes, I write directly to a local drive. In the topic header I wrote a model of my Mikrotik and wro...
by DyadyaGenya
Wed Dec 06, 2023 4:46 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

Add the logging=yes directive on the container-creation command and look in the logs. Might explain more about the error. Unfortunately, setting up logging is an unknown topic for me. I did as written in the Mikrotik wiki /container set 0 logging=yes The existing log was cleared and new entries lik...
by DyadyaGenya
Wed Dec 06, 2023 4:18 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Re: Error when mounting adguard container

First enable container functionality here: https://help.mikrotik.com/docs/display/ROS/Device-mode Strange, I seemed to do it as a command /system device-mode update container=yes but when checking it was only system device-mode print mode: enterprise Perhaps I reset the settings poorly. Now I repea...
by DyadyaGenya
Wed Dec 06, 2023 2:53 pm
Forum: Containers
Topic: Error when mounting adguard container
Replies: 41
Views: 9955

Error when mounting adguard container

I have RB4011iGS+5HacQ2HnD. It is based on arm architecture, and it seems that I can install containers on it. I understand that it is not the best idea to put a container on it, because it does not have an external drive. But I really want to filter out advertising for all devices on the network at...
by DyadyaGenya
Thu Nov 30, 2023 11:15 pm
Forum: Useful user articles
Topic: ZeroTier on Mikrotik – a rosetta stone [v7.1.1+]
Replies: 43
Views: 40611

Re: ZeroTier on Mikrotik – a rosetta stone [v7.1.1+]

Several points are not entirely clear. 1. About the compatibility of Mikrotik and LTE versions. If Mikrotik is not an Arm architecture, but MMIPS, but an LTE modem is inserted into it, will such a combination work? 2. If I understand correctly, without the central ZeroTier cloud it is impossible to ...
by DyadyaGenya
Sun Nov 26, 2023 4:49 pm
Forum: Scripting
Topic: Searching for words in an array.
Replies: 7
Views: 3030

Re: Searching for words in an array.

Why don't you provide the example of what you're trying to do. Or if you want to search strings, then don't make it an array type. I'm afraid I'm translating something wrong again. Actually, I gave an example of exactly how I wanted to get the result. It completely satisfies me. But as questions an...
by DyadyaGenya
Sun Nov 26, 2023 12:25 am
Forum: Scripting
Topic: Searching for words in an array.
Replies: 7
Views: 3030

Re: Searching for words in an array.

:local result [:find $months $searchWord -1] -1 was unnecessary))) I understand that you wanted to count the months, but I took the months only as an example, without being tied to their real number. The script on OP work correcly on both 6.48.7 and 7.12, so, no superfluos ( ) needed But this is ve...
by DyadyaGenya
Sat Nov 25, 2023 8:49 pm
Forum: Scripting
Topic: Searching for words in an array.
Replies: 7
Views: 3030

Re: Searching for words in an array.

I asked the question myself and answered it myself))) Again, my inattention and parentheses. Parentheses in Mikrotik constantly confuse me))) This is how it will work: :local months [ :toarray "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec"]; :local searchWord "nov";...
by DyadyaGenya
Sat Nov 25, 2023 8:38 pm
Forum: Scripting
Topic: Searching for words in an array.
Replies: 7
Views: 3030

Re: Searching for words in an array.

Apparently in Mikrotik there is no direct way to search using ":find", although the manual says what you should search for. Therefore, at the moment the only solution is this: :local months [ :toarray "jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec"]; :local searchWor...
by DyadyaGenya
Sat Nov 25, 2023 7:02 pm
Forum: Scripting
Topic: Searching for words in an array.
Replies: 7
Views: 3030

Searching for words in an array.

With some free time appearing, I've started trying to recall scripts. Unfortunately, I realize that I've forgotten a lot. For instance, I can't remember/write a simple function to find words in an array, although I think I did something like that in the spring. :local months [ :toarray "jan, fe...
by DyadyaGenya
Sun Nov 19, 2023 9:19 pm
Forum: Beginner Basics
Topic: Customizable name in the list of connected devices
Replies: 1
Views: 2589

Customizable name in the list of connected devices

Is it possible in Mikrotik to associate a name with a static address assigned in the DHCP Server on the Leases tab for a device? I understand that it is displayed there as the "native" name (Active Host Name). And I understand that I can write in comments what kind of device it is. However...
by DyadyaGenya
Mon Nov 13, 2023 9:00 pm
Forum: Scripting
Topic: Connection status is not checked [SOLVED]
Replies: 2
Views: 4132

Re: Connection status is not checked [SOLVED]

Use the correct syntax... Thank you.I haven't used Mikrotik for six months. I forget, plus inattention. and provide RouterOS version, everytime... Will try If must be a number, check if is a number, not if is nothing (or nil, etc.) What difference does it make what to check: a number or nothing? Wr...
by DyadyaGenya
Sun Nov 12, 2023 11:49 pm
Forum: Scripting
Topic: function convert UnicodeToURL
Replies: 3
Views: 1984

Re: function convert UnicodeToURL

Our one Russian forum member wrote this recoding function.
Isn't this Fly by any chance?

And one more clarification. As I understand it, this is for reading SMS. Can you show an example of use?
by DyadyaGenya
Sun Nov 12, 2023 11:05 pm
Forum: Scripting
Topic: Traffic monitor
Replies: 2
Views: 2209

Re: Traffic monitor

/interface monitor-traffic <iface> once do={ :put $"rx-bits-per-second" } Thus, a lot of unnecessary information is displayed. In my opinion it's easier like this: :put ( [ /interface monitor-traffic lte1 as-value once ] -> "tx-bits-per-second" ) How do I access values from /int...
by DyadyaGenya
Sun Nov 12, 2023 8:23 pm
Forum: Scripting
Topic: Connection status is not checked [SOLVED]
Replies: 2
Views: 4132

Connection status is not checked [SOLVED]

I'm trying to check the signal level of the modem, in particular rssi. It's pretty easy to do. :put ( [/interface lte monitor lte1 as-value once ] -> "rssi") But I can't check for a signal. In theory, if you check the data type like this :put [:typeof ( [/interface lte monitor lte1 as-valu...
by DyadyaGenya
Mon Nov 06, 2023 1:53 pm
Forum: Scripting
Topic: Parse data (ip adress) from a text file and from JSON. [SOLVED]
Replies: 2
Views: 4843

Re: Parse data (ip adress) from a text file and from JSON. [SOLVED]

or you can get from JSON from wtfismyip.com without blanks but you need parser script like: https://github.com/Winand/mikrotik-json-parser . Thank you, I was just planning to start working on scripts again closer to the New Year, and in particular parsing json. Now I will know what to focus on. you...
by DyadyaGenya
Sun Nov 05, 2023 10:19 pm
Forum: Scripting
Topic: Parse data (ip adress) from a text file and from JSON. [SOLVED]
Replies: 2
Views: 4843

Parse data (ip adress) from a text file and from JSON. [SOLVED]

There is such a site: wtfismyip.com, where you can conveniently get the address in a text file or json. I don’t know much about Linux (RouterOS is Linux after all) and I can’t figure out how to parse the IP address that this site gives out. I found an example of saving the address to a file. /tool f...
by DyadyaGenya
Sun Nov 05, 2023 12:12 am
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

If the goal is to test a connection... maybe netwatch would solve. The newer "icmp" check is pretty robust likely more than a script. Or perhaps using BFD might be a better approach than script. I almost figured out sending messages to Netwatch, but I noticed that checking and restoring t...
by DyadyaGenya
Sun Nov 05, 2023 12:02 am
Forum: Beginner Basics
Topic: POST send message to telegram from Netwatch
Replies: 1
Views: 1915

POST send message to telegram from Netwatch

I'm trying to send a message to Telegram from Netwatch. If I use a GET request, then this is quite easy. Looks like this:
/tool ​​fetch url="https://api.telegram.org/bot_id/sendMessage\?chat_id=xxxxxxxxxx&text=TelegramMessageText"
But I would like to make not a GET request, but a POST.
by DyadyaGenya
Sat Nov 04, 2023 10:40 pm
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

If I understand correctly, then this is a type of flag that was proposed to be made above. This is suitable if you are making a new script. But I was interested in stopping a script that does not have such a flag.
by DyadyaGenya
Sat Nov 04, 2023 10:36 pm
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

But basically the /system/script/jobs only tracks what was called by /system/script/run. If the action the /system/scheduler is a script name, as @optio suggests above, that still run/"invokes" the /system/script so that's why it's tracked in jobs. In principle, this is enough to interrup...
by DyadyaGenya
Sat Nov 04, 2023 10:30 pm
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

If the goal is to test a connection... maybe netwatch would solve. The newer "icmp" check is pretty robust likely more than a script. Or perhaps using BFD might be a better approach than script. I tried netwatch. Interesting thing. But: 1. I didn’t notice much difference in the processor ...
by DyadyaGenya
Fri Nov 03, 2023 12:40 am
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

/system/script/job> print Columns: SCRIPT, OWNER, STARTED # SCRIPT OWNER STARTED 0 admin 2023-11-02 23:02:12 1 tst admin 2023-11-02 23:12:00 2 admin 2023-11-02 23:12:00 /system/script/job> remove [find where script="tst"] That's what I need. I didn't even have to create a script with a lo...
by DyadyaGenya
Thu Nov 02, 2023 11:41 pm
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

You can make a loop script that test i a variable is true. Then you can just change the variable from 1 to 0 and the script stops. Are you suggesting I make a global variable? This is probably one of the options, to make some kind of flag (variable). But I still wanted to understand JOBS. The fact ...
by DyadyaGenya
Thu Nov 02, 2023 11:38 pm
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

If the goal is to test a connection... maybe netwatch would solve. The newer "icmp" check is pretty robust likely more than a script. Or perhaps using BFD might be a better approach than script. Thanks for the suggested option. I'll see if I can use it. But in any case, there is a desire ...
by DyadyaGenya
Thu Nov 02, 2023 10:33 pm
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Re: Stop a script running from the scheduler [SOLVED]

Or actually run the script only once on startup (use start-time=startup as per ROS scheduler manual ). Thanks, my second problem is solved thanks to your link. Before this, I almost never used the scheduler, and did not know that an interval equal to zero means launching only once. If it's run ever...
by DyadyaGenya
Thu Nov 02, 2023 12:56 am
Forum: Scripting
Topic: Stop a script running from the scheduler [SOLVED]
Replies: 17
Views: 7068

Stop a script running from the scheduler [SOLVED]

I made a script with an infinite loop. It doesn't matter what it does, what matters is that the cycle is endless. It’s easy to stop it in the terminal (Cntrl+C), but I decided to put it in the scheduler so that it starts when Mikrotik is rebooted. And set the interval to 1 minute. As a result, a bun...
by DyadyaGenya
Fri Sep 15, 2023 9:22 pm
Forum: RouterBOARD hardware
Topic: Beeper and RBM33G
Replies: 0
Views: 2541

Beeper and RBM33G

Unfortunately, the RBM33G does not have a built-in beeper. But there is a GPIO where, in theory, a beeper could be connected. Here is a page that describes the GPIO circuit and the pins that could theoretically be used https://help.mikrotik.com/docs/display/UM/RBM33G But I don’t quite understand whe...
by DyadyaGenya
Fri Sep 15, 2023 1:00 am
Forum: RouterBOARD hardware
Topic: Cooler for RBM33G
Replies: 8
Views: 4487

Re: Cooler for RBM33G

https://i.imgur.com/sDa2kRD.png There is a description of GPIO's pinout. You need some voltage + GND depending of the fan you will install. Probably you can use Pin 4 to positive and Pin 6 to negative using a 5v fan. Unfortunately, I can’t visit the forum often now, but I’m still interested in this...
by DyadyaGenya
Mon Aug 28, 2023 12:50 am
Forum: RouterBOARD hardware
Topic: Cooler for RBM33G
Replies: 8
Views: 4487

Re: Cooler for RBM33G

Of course you can.
Something like this:
https://www.amazon.com/Dorhea-Raspberry ... ef=sr_1_3#
Yes, I would like to connect something like such a fan. But where? What pins?
by DyadyaGenya
Mon Aug 28, 2023 12:48 am
Forum: RouterBOARD hardware
Topic: Cooler for RBM33G
Replies: 8
Views: 4487

Re: Cooler for RBM33G

Could you specify what "cooler" means for you as M33G has heatsink installed.
What and where do you want to add this "cooler"?
The radiator is not enough. Hot weather and a heavy load on the modem that is inserted into the router. Therefore, I would like a "fan".
by DyadyaGenya
Thu Aug 24, 2023 12:52 am
Forum: RouterBOARD hardware
Topic: Cooler for RBM33G
Replies: 8
Views: 4487

Cooler for RBM33G

Is it possible to somehow connect a cooler to the RBM33G? If possible, how to do it?
by DyadyaGenya
Tue Aug 22, 2023 9:50 am
Forum: Scripting
Topic: Monitoring the modem's status
Replies: 3
Views: 3341

Monitoring the modem's status

I have a Quectel EM12G modem in my MikroTik. It seemed to be working well. However, for the last week, possibly due to the hot temperature, it started freezing occasionally (about once a day). The link goes down. A simple power cycle of the modem helps. Perhaps the issue isn't just the temperature. ...
by DyadyaGenya
Wed Jul 05, 2023 1:39 am
Forum: Scripting
Topic: Check which index of the array is missing.
Replies: 1
Views: 1830

Check which index of the array is missing.

I'm trying to check which index is missing in the array. The array is associative, but the indexes are only numeric, although they may not be sequential. At the same time, the size of the array is known. Here is one of the approaches I've tried to implement. :local Array { "0"="Value ...
by DyadyaGenya
Thu Jun 29, 2023 1:04 pm
Forum: Beginner Basics
Topic: Just a couple of questions about KNOT LR8 and MiniPCI-e and LoRa
Replies: 1
Views: 1111

Just a couple of questions about KNOT LR8 and MiniPCI-e and LoRa

Is it true, as stated in the KNOT LR8 specification, that it has a MiniPCI-e slot? Is the slot occupied by a device such as a modem or is it empty? Can a Wi-Fi module be installed in it? Does anyone have a photograph showing the location of the slot? Is it possible to route an antenna from the inser...
by DyadyaGenya
Sun Jun 25, 2023 1:39 pm
Forum: Scripting
Topic: PDU transcoding
Replies: 6
Views: 2262

Re: PDU transcoding

Valid only for GSM-7 (or ASCII-8) since UCS-2 is already multilanguage. Good luck... https://en.wikipedia.org/wiki/GSM_03.38#National_language_shift_tables https://en.wikipedia.org/wiki/User_Data_Header Which UDH field can indicate the language of the SIM card? Or how can you read the language of t...
by DyadyaGenya
Sun Jun 25, 2023 12:29 pm
Forum: Scripting
Topic: PDU transcoding
Replies: 6
Views: 2262

Re: PDU transcoding

Is there any way to determine which language is used in an SMS?
by DyadyaGenya
Sun Jun 25, 2023 10:41 am
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

Safeguards regarding networking is MikroTik device domain, but for some advanced approach of data processing which will be provided to main system, I will suggest to run/create some software/scripts in container which is also on same device but you have more flexibility/ability to process data ther...
by DyadyaGenya
Sun Jun 25, 2023 12:28 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Earlier, I mentioned that there shouldn't be any major issues with concatenating SMS messages. However, I was mistaken. I can't figure out how to handle the situation when not all parts of a composite SMS are received. Here's an example of a simplified array that I receive when processing SMS messag...
by DyadyaGenya
Fri Jun 23, 2023 7:40 pm
Forum: Scripting
Topic: PDU transcoding
Replies: 6
Views: 2262

Re: PDU transcoding

It's time to explore the encoding functions. Despite the work done by Rextended , I would like to mention the option from Optio. Here's the link to their encoder. https://forum.mikrotik.com/viewtopic.php?p=1004704#p1004704 I would also like to mention a solution from someone who is not present on th...
by DyadyaGenya
Fri Jun 23, 2023 7:17 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

One way of "appending" to a file that may be suitable for your purpose is to use /log to log the message at some severity, and define a logging action and corresponding logging destination (for that severity and "script" topic) to write these messages to a file. Of course it wil...
by DyadyaGenya
Fri Jun 23, 2023 7:13 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

If you need to load large file from external system you can provide it over http and fetch it chunked or split file into segments and upload to device. I don't understand what you mean by an external system. Are you referring to my mention of IoT devices? These devices send brief information in sma...
by DyadyaGenya
Fri Jun 23, 2023 5:53 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

It is hard to understand what you want to accomplish with all this. It's probably my fault that I didn't describe in detail what I want. I have several objectives: 1. Occasionally save the contents of PDU to a file. 2. Occasionally save processed SMS to another file. 3. Sometimes save data from sma...
by DyadyaGenya
Thu Jun 22, 2023 6:37 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

This work for sure, but the file is created after some seconds, or you wait ":execute" to finish it's job, or you do not see instantly the file... I still don't understand how to read such a file. You're talking about exporting, and as I understood, using notes, but I still couldn't accom...
by DyadyaGenya
Thu Jun 22, 2023 6:23 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

in one of them, it has a very negative meaning )))) The sentence, on purpose , was meant to be negative, to give the appropriate emphasis to the concept: " I just keep seeing a Brother. ". Everything is fine, I understand simple things without a translator. And I understand where the tran...
by DyadyaGenya
Thu Jun 22, 2023 5:50 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

you can use flash of usb storage for persistence, depends on device, to save it on flash use
file="flash/sms"
Naturally, I tried that option right away. I saved the file to my SSD drive. It doesn't matter, after rebooting, it still disappears.
by DyadyaGenya
Thu Jun 22, 2023 5:40 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

Do you really think I give a damn if you're Russian, Polish or Ukrainian? That's why I mentioned tact. I don't know how the translator will render it, so let me explain it in different words. Don't feel compelled to voice everything you know. By the way, about those words. The translator translated...
by DyadyaGenya
Thu Jun 22, 2023 5:32 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

@DyadyaGenya try with this I tried it. Firstly, the pros. It seems visually faster and creates two files at once. As for the cons, there is more code and more "extra movements." But extra movements are a matter of personal preference. But what is your native language? This may answer http...
by DyadyaGenya
Thu Jun 22, 2023 5:06 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

What does it have to do with it, I wanted him to specify it, if he wanted... If you look closely you'll see that the Uncle Женя lives in Chernihiv, and was born on January 17.. :lol: (Женя жарт... ;) ) I don't put the year, if he wants he can put it there... :lol: You didn't guess my native languag...
by DyadyaGenya
Thu Jun 22, 2023 3:58 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

No, I wrote "It adds the default extension "txt" to the filename, here is that "test" ". :execute ":put ([/interface lte at-chat lte1 wait=yes input=\"AT+CMGL=4\" as-value ]->\"output\")" file="sms" In fact, both options work. An...
by DyadyaGenya
Wed Jun 21, 2023 9:12 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

Personally I will go with approach: In loop where records are appended to variable for file save, before append record to that variable I will first check size of that variable and if that length of that variable + length of record variable exceeds 4K then I will write current content value into fi...
by DyadyaGenya
Wed Jun 21, 2023 5:13 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

This was the startingpoint: https://forum.mikrotik.com/viewtopic.php?p=819118 I think that it is more correct to continue in this topic, and not in the one where the link is. I tried doing something like this: :local sms [/system script get "sms.txt" source]; :put $sms But it gives an err...
by DyadyaGenya
Wed Jun 21, 2023 4:56 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

I guess all (or most) these DyadyaGenya topics will not be unnecessary if sms tool is improved - https://forum.mikrotik.com/viewtopic.php?t=191963 , it was my first topic on this forum, I should probably need to add link to it into feature request topic. I subscribe to your every word. This is exac...
by DyadyaGenya
Wed Jun 21, 2023 4:49 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

b) Reading the contents of any file into /files and auto-sharing it as a file in ftp and putting it into a variable, is limited to 64512 Bytes. Very strange. I don't understand that case, but I can read a file that I may have copied from the computer to the Mikrotik and which has a size of 6.4 KiB....
by DyadyaGenya
Tue Jun 20, 2023 6:12 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

Why you for do 2 + 4 = 6 instead you do x1 = 2 / 2, x2 = 4 / 2, result = (x1 + x2) * 2 = 6 ?????????????? To be honest, I didn't do either. :put ( "\\$num" ) = print on screen the character "\" (and since is the escape character, must be writed twice) followed with the value of ...
by DyadyaGenya
Tue Jun 20, 2023 3:14 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

In the end it's just RouterOS , not "eXtendedOS". Either you use Containers so you do what you like, or you accept that in the end it's a Router , not one Synology or one of the many "SIM Manager" programs.... I understand that RouterOS is designed specifically for routers (and ...
by DyadyaGenya
Tue Jun 20, 2023 2:41 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

You can read large files by not using a script to read the file but put the script in the file in a form of a function and import the RSC file. Exporting large files is possible and rename it then to an RSC file so they can be imported again. Can you give a couple of links to this topic to read mor...
by DyadyaGenya
Mon Jun 19, 2023 11:58 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

Re: The maximum size of a read/written file.

The limit reading the file from /file is 4095 Bytes, but by fetch is 64512 Bytes But with my method, on supported hosts, the read is ulimited. Is time you read and study my posts.......................... https://forum.mikrotik.com/viewtopic.php?f=9&t=177530 I continue to attribute our misunder...
by DyadyaGenya
Mon Jun 19, 2023 6:15 pm
Forum: Scripting
Topic: The maximum size of a read/written file.
Replies: 71
Views: 12090

The maximum size of a read/written file.

I might have misunderstood, but in MikroTik there is a limitation on the size of the read and written files, which is 4 kB. This means that even a log file cannot be read by a script if it exceeds this size. Am I correct in understanding that one needs to somehow concatenate files when reading and s...
by DyadyaGenya
Mon Jun 19, 2023 4:48 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

0x41 is 65, so that way can not be used to print decimal "41" as character. 41 on hex is 0x29 and the correct character is the ) Can you tell me where is the error in my code? And here the question is not whether I want or do not want to leave my code. You were interested in what exactly ...
by DyadyaGenya
Sun Jun 18, 2023 2:35 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

If you really want convert DECIMAL number 41 to a character ")": :local num 41 :local numbyte2hex do={ :local input [:tonum $1] :local hexchars "0123456789ABCDEF" :local convert [:pick $hexchars (($input >> 4) & 0xF)] :set convert ($convert.[:pick $hexchars ($input & 0xF...
by DyadyaGenya
Sat Jun 17, 2023 11:10 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

:local num 41
:put [[:parse ":return \"\\$num\""]]
Thank you. I understand that this can only be done using the ":parse" command?
by DyadyaGenya
Sat Jun 17, 2023 9:59 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

Not quite on topic, but related.
Why can I print like this:
:put ( "\41" )
And get A.
And this is not how it works:
:local num 41
:put ( "\\$num"  )
And how can this be done?
by DyadyaGenya
Thu Jun 15, 2023 11:55 pm
Forum: Scripting
Topic: Is it possible to display characters from other languages in the MikroTik terminal?
Replies: 3
Views: 1879

Re: Is it possible to display characters from other languages in the MikroTik terminal?

You can try with external-non-winbox SSH client that support ansi-8bit. My parents aren't smart enough to do that. I was hoping that since it is impossible to read them in the SMS tool window, then at least in the terminal it can be done. RouterOS do not support at all 2 (or more) bytes charset lik...
by DyadyaGenya
Thu Jun 15, 2023 4:28 pm
Forum: Scripting
Topic: Is it possible to display characters from other languages in the MikroTik terminal?
Replies: 3
Views: 1879

Is it possible to display characters from other languages in the MikroTik terminal?

Hi everyone. Can MikroTik display characters other than Latin script on the terminal screen?
by DyadyaGenya
Sun Jun 11, 2023 11:08 pm
Forum: Scripting
Topic: PDU transcoding
Replies: 6
Views: 2262

Re: PDU transcoding

# but adding what YOU consider useless.... I didn't say I thought it was useless. On the contrary, I assumed that I did not take into account something. But I would like to understand why, in the case of a composite SMS, headers are also needed. The "é@øH5¿@" multipart header IS PART OF T...
by DyadyaGenya
Sun Jun 11, 2023 1:48 pm
Forum: Scripting
Topic: PDU transcoding
Replies: 6
Views: 2262

PDU transcoding

Hi all. I decided to start a separate topic. I understand that it seems that a lot has been written about transcoding SMS text, including using the functions from rextended . I mean the functions in the following posts: HexGSM7toCP1252 https://forum.mikrotik.com/viewtopic.php?t=177551#p992792 CP1252...
by DyadyaGenya
Sun Jun 11, 2023 12:57 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

how about
:put [$HexGSM7toCP1252 "C8329BFD065DDF72363904"] 
?
> :put [$HexGSM7toCP1252 "C8329BFD065DDF72363904"] 
Invalid 7-bit value (200)
Looks like I need to start a new thread.
by DyadyaGenya
Sat Jun 10, 2023 11:58 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

IED3 is actually part number, join messages with same IED1 ordered by IED3. I understand it. I can't write a function for this yet. Or insert the procedure into an existing function. And I have not yet wondered how to make such a function. For me, it's in the background. This was said only to demon...
by DyadyaGenya
Sat Jun 10, 2023 9:10 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

@DyadyaGenya If you still have troubles with parsing PDU, here is mine script if you find it useful: I can already parse SMS. I have two problems left: re-encode and glue if the SMS consists of several parts. These parts I can draw out separately. And when I print the array, they are clearly visibl...
by DyadyaGenya
Sat Jun 10, 2023 8:29 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

instead of constantly asking the same questions in a circle, it would be enough for you to read what has already been written... The situation with the explanation of the time zone field is repeated. I had to ask a lot of questions to get a description for the average person. Although I have alread...
by DyadyaGenya
Fri Jun 09, 2023 8:29 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

I wanted to clarify about the TP-UD field, that is, the text of the SMS itself. I can't figure out how to get the message length. It is clear that if the encoding is UCS2, then the length of the TP-UDL received in octets is multiplied by two. And if the encoding is 7-bit, and the length is obtained ...
by DyadyaGenya
Fri Jun 09, 2023 1:13 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

10.5.4.7 (not 6, the article is also wrong)

Possible plausible values used only on SMS (read the full guide to understand what are)...
Only now I'm starting to understand what it's all about.
by DyadyaGenya
Fri Jun 09, 2023 12:18 am
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

I have dealt with the previous issue. We need to take it in reverse order. But I would like to be specific about the type of sms. Do I need to read two bits or is it one bit? The fact is that in the table, if only one bit is taken into account, then the bits of the SMS-DELIVER and SMS-SUBMIT REPORT ...
by DyadyaGenya
Thu Jun 08, 2023 10:54 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

but I understand enough to adapt it for my purpose.
I hope you understand that I recently started doing this))) And I would like to clarify. Should the shift start from 0 or from 1?
by DyadyaGenya
Thu Jun 08, 2023 10:36 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

Shift n bits -1 right (bitwise >>) to get bit at position from right to left and check with bitwise & 1.
Now I'm starting to understand your PDU reading code.
by DyadyaGenya
Thu Jun 08, 2023 10:17 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

No, it appears you have some homework on the basics of conversion between binary and hex :lol: (damn, that's almost 40 years ago I learned that ...) Tip: Windows calculator in programmer mode can help. Or a stupid piece of paper. Write it down. Then you will see how it goes. I learned about this fo...
by DyadyaGenya
Thu Jun 08, 2023 10:08 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

Re: To determine the value of each bit in a byte.

Your hex values used for testing are wrong. /system/script> run test The value of the 0 bit.: false The value of the 1 bit.: false The value of the 2 bit.: false The value of the 3 bit.: false The value of the 4 bit.: false The value of the 5 bit.: true The value of the 6 bit.: true The value of th...
by DyadyaGenya
Thu Jun 08, 2023 8:27 pm
Forum: Scripting
Topic: To determine the value of each bit in a byte.
Replies: 24
Views: 3631

To determine the value of each bit in a byte.

How to check the value of a specific bit in a number expressed in hexadecimal format? For example, if the number is represented in hexadecimal as "0x60", in binary it would be "01100000". How can we determine the value of, let's say, the 2nd or 7th bit? Are there any built-in fun...
by DyadyaGenya
Thu Jun 08, 2023 1:03 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

And following the clarifications, if I understood correctly, it should look something like this: +----+--------+----------------------------------------+ |04 | Value | Explanation | +----+--------+----------------------------------------+ | | | | | 1. | = 0 | TP-MTI: SMS-DELIVER (since 0) | | 2. | =...
by DyadyaGenya
Thu Jun 08, 2023 1:17 am
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

I wanted to clarify about the TP-MTI field. Do I understand correctly that two digits of this field need to be converted from hex to a bit representation and in them to consider the value of each bit in accordance with the table? That is, "04" to do as "00000100", "40" ...
by DyadyaGenya
Wed Jun 07, 2023 3:10 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

In fact, it remains to understand how to work with the TP-UDL field. I understand that it indicates both the length of the message and the presence of message parts. But it is not clear which parameter determines this. Already in the field itself, it is more or less clear that if this is a composite...
by DyadyaGenya
Wed Jun 07, 2023 2:58 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

After reading many explanations on the topic of the time field in SMS, yet the best explanation turned out to be on this forum in these posts: https://forum.mikrotik.com/viewtopic.php?p=1006390#p1006390 https://forum.mikrotik.com/viewtopic.php?p=1006452#p1006452 https://forum.mikrotik.com/viewtopic....
by DyadyaGenya
Wed Jun 07, 2023 1:02 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

https://forum.mikrotik.com/viewtopic.php?t=177551#p993440 C8329BFD065DDF72363904 => 48656C6C6F20576F726C6421 => Hello World! :put [$pdutogsm7 ("\C8\34\88\FE\06\05\D9\EC\50\28\04")] :put [$HexGSM7toCP1252 ("48656C6C6F20576F726C6421")] Unfortunately I don't understand your example...
by DyadyaGenya
Wed Jun 07, 2023 12:52 am
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

simple, just read at least once the formula that I have put under your nose dozens of times.... https://forum.mikrotik.com/viewtopic.php?t=196637#p1006390 and also with explanations... https://forum.mikrotik.com/viewtopic.php?t=196637#p1006397 570 minutes = 570 / 60 = 9 hours ( because 570 / 60 is ...
by DyadyaGenya
Tue Jun 06, 2023 6:19 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

If, for example, we have on PDU 22 (India +05:30), is the same: x = 2, y = 2, timezone is positive, because x (0010) <= 7 (0111) so, "positive" + "2" + "2" = +22 = 22 times 15 = 330 minutes = 5 hours and ½ hour = 5 hours and 30 minutes If, for example, we have on PDU 8...
by DyadyaGenya
Mon Jun 05, 2023 9:27 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

# formula is wrong: if the timezone, for example, is 4h and 30m = 18 times 15 minutes,
# 18 / 4 = 4,5 and RouterOS do not suport decimal division.
Can you explain the correct algorithm in simple words? And preferably in another topic, so that it is in the right place.
by DyadyaGenya
Mon Jun 05, 2023 9:23 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

I already wrote it to you in another case, don't repeat the same instructions unnecessarily inside the cycles Now it's clear))) But this is only a starting option, I usually shorten it when I see that everything is working. I also use this starting option because I do a lot of debug printouts on th...
by DyadyaGenya
Mon Jun 05, 2023 9:20 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

I recommend you write some unit test function to call your function with the some of various PDU formats & see what breaks. Post the test function and results. ;) I don't quite understand what you are suggesting. I understand that you are proposing to do some tests, but I did not understand whi...
by DyadyaGenya
Mon Jun 05, 2023 8:11 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

Did you notice the ; between "useless" and "everywhere"?
I noticed, but I don't understand. That's why I'm asking you what it means.
by DyadyaGenya
Mon Jun 05, 2023 8:10 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

Perhaps bad word choice – "defined" meaning it has code vs "declared" mean code is somewhere else... Regardless, in your $getUTC function, you need :local getUTC do={ :local pair $1; :local sign ""; :local tZone ""; :global num2bin :global hex2num :put $pair;...
by DyadyaGenya
Mon Jun 05, 2023 8:03 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

:local pair $1; <<= useless ; everywhere You mean useless? Wasn't it necessary to declare this variable? Or do you mean that I needed to use $1 everywhere? If so, then I just left the variable as it is in the source code. Later I planned to shorten the code. :put $pair; # ignored, debug Is debuggin...
by DyadyaGenya
Mon Jun 05, 2023 7:37 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

Not need to list here the code here... but the globals must be declared in your new function with ":global hex2num" etc. That's at least one issue with your code. This goes without saying. I thought that it would be superfluous to indicate here, because I showed that in the code from whic...
by DyadyaGenya
Mon Jun 05, 2023 6:26 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

You don't need to list the functions here, but you don't need to use them either....
You have a good function, but I want mine.
by DyadyaGenya
Mon Jun 05, 2023 5:38 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

I again cannot translate the code into a function. Here's the code. It has several global functions. I don't think it's necessary to list them here. :global hex2num :global num2bin :local pair "A8"; :local sign ""; :local tZone ""; :local UTC [ $num2bin [ $hex2num $pair...
by DyadyaGenya
Sun Jun 04, 2023 1:55 am
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

Create one array with all 256 possible values with corresponding real value...
To create, we need to understand why.

Found a pretty good article on the subject
http://www.doubleblak.com/m/blogPosts.php?id=6
by DyadyaGenya
Sat Jun 03, 2023 11:39 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

You keep insisting, but there is no logic in what you write...
I don't know who doesn't understand whom and why. Maybe even chatGPT can't handle the translation. Let's point by point. Short messages. I'm talking about your version of the function. It's clear?
by DyadyaGenya
Sat Jun 03, 2023 10:55 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS) ...(bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field) represents the algebraic sign of this difference (0: positive, 1: negative). See https://www.etsi.org/deliver/etsi_ts/123000_123099/123040/16.00.00_60/ts_123040v160000p.pdf Hone...
by DyadyaGenya
Sat Jun 03, 2023 7:18 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Maybe also checking UDH header for joining splitted messages will be nice :)
Can you provide an example of multiple SMS messages that consist of several parts?
by DyadyaGenya
Sat Jun 03, 2023 7:08 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

But you didn't explain why the function should be work only with 12 telephone digits I apologize for the confusion. In your case, the length of the phone number can vary, and the current implementation of the function only works with 12-digit numbers. If you need to handle phone numbers of differen...
by DyadyaGenya
Sat Jun 03, 2023 1:28 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

There is another aspect that I don't fully understand. It's the SMS text header, which contains information about the encoding of the SMS, the number of parts it consists of, and which part is included in the current segment.
by DyadyaGenya
Sat Jun 03, 2023 1:25 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

I understand not knowing the programming language, but at least what is a Byte you should know... A Byte consists of 8 bits ranging from 00000000 to 11111111, because bits can only have 2 values, either 0 or 1, this so that there are 256 possible combinations, Fortunately, I found an easy way to co...
by DyadyaGenya
Fri Jun 02, 2023 8:14 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

For example, I know for sure that this snippet '4404810102' contains the SMS type, the length of the sender's number, the number type, and the actual number. I know for sure that the sender's number is '1020' and the number type is '81'. But how is its length encrypted? It seems like it has 4 charac...
by DyadyaGenya
Fri Jun 02, 2023 7:02 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

What would be the function limited to 12 characters only?
Phone translation. We don't know what other numbers are. You voiced some yesterday in another topic, but I have not had time to deal with them yet.
by DyadyaGenya
Fri Jun 02, 2023 7:00 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

Just don't post ChatGPT generated code here, rextended will not love you after that :) I doubt that I will quickly figure out how this chatGPT works. Moreover, I heard that it generates code poorly, especially if the programming language is rare. But I have a request for you, which I voiced above. ...
by DyadyaGenya
Fri Jun 02, 2023 5:22 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

@DyadyaGenya: for what it's worth, ChatGPT is way better than Google Translate at understanding important nuances of the language which is also the real strength of a language modell like GPT (as opposed to facts that shouldn't be trusted at all).
Okay, I'll try to register in the GPT chat today
by DyadyaGenya
Fri Jun 02, 2023 5:07 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

In addition, there are TP-MMS, TP-SRI, TP-UDHI, TP-RP fields. Where are their data located? How do they appear in the digital representation for an ordinary person? https://www.activexperts.com/serial-port-component/tutorials/smstechnical/ see how PDU Type is encoded. I have tried reading this post...
by DyadyaGenya
Fri Jun 02, 2023 4:27 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

How many time same question? Sorry, I don't have time to read all the replies in different threads. A few hours ago I read there and answered. Now it's time to read this thread. If you do not know waht $1, $2, etc, are inide one function, at least deign to read what already exists on scripting. Som...
by DyadyaGenya
Fri Jun 02, 2023 3:06 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

You still haven't figured out what the individual values are for and you keep talking about encrypted text messages... I understand now. Thank you. Only now I don’t understand why, after I started working at the beginning of the garden, I need to run to the end of the garden, if in the end I need t...
by DyadyaGenya
Fri Jun 02, 2023 12:12 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

This is just a starting point for one complete function, on this function you have all needed example for decode everything inside. You never said what 48 is on a line :put [$PDUdecode 07912180958739F1040B917120069876F000009140503223218A21D4F29C0E6A97E7F3F0B90CA2BF41412A68F86EB7C36E32885A9ED3CB72 4...
by DyadyaGenya
Fri Jun 02, 2023 12:04 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

I understand not knowing the programming language, but at least what is a Byte you should know... I know people who write programs / applications perfectly, but do not understand bits and bytes. A program is just an algorithm and syntax, and it doesn't care what information to process, even a comma...
by DyadyaGenya
Thu Jun 01, 2023 11:46 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

It's obvious... 0x07 is 7 bytes and 0x0B are 11 characters, because 0x0B = 11... That is, "07" is not the length of characters, but bytes? Does "0B" count characters, not bytes? If so, am I right in thinking that 7 bytes means 7 pairs of characters? That is, one pair of characte...
by DyadyaGenya
Thu Jun 01, 2023 10:47 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

10.5.4. 7 (not 6, the article is also wrong) I don't understand what article you are talking about. Perhaps there is described work with text numbers of the sender. The possible total not-reserved values combination for that field are ~48. Approx, not counted exactly. So, must be checked every BIT,...
by DyadyaGenya
Thu Jun 01, 2023 10:27 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

Step 1) we have aldeady the length of the PDU, 48, and the PDU itself from this: To be honest, I did not think that this topic would turn into a topic for creating a number processing function in the SMS body. But good. you use the number 48. But I still do not understand why, if it is not used in ...
by DyadyaGenya
Thu Jun 01, 2023 10:01 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

It's obvious... 0x07 is 7 bytes and 0x0B are 11 characters, because 0x0B = 11... Unfortunately, it's not obvious to me. And first of all, it is not clear when bytes are used, when something else is used. The length of the number in both cases is 11 characters. At the 12th character, we add "F&...
by DyadyaGenya
Thu Jun 01, 2023 9:54 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

you have already your reply, and is not encrypted anything at all https://forum.mikrotik.com/viewtopic.php?t=196637#p1005497 I haven't looked at this thread yet. After your post, I did it. But apparently again my google translator is to blame. It was about a number consisting of letters, ie like &q...
by DyadyaGenya
Thu Jun 01, 2023 8:19 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

0x91 and 0x81 do not exist (everytime use hex when the number are hex...) are BIT 10010001 and 10000001 and must be checked what each bit is. How does it not exist? It's even mentioned in the link above. Here is a screenshot from the article. Is not encrypted, and you are forced to check BIT by BIT...
by DyadyaGenya
Thu Jun 01, 2023 8:11 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

https://www.activexperts.com/serial-port-component/tutorials/smstechnical/ see how PDU Type is encoded. If you notice, one of my screenshots is taken from there. Unfortunately, I do not understand all the information in this article. And first of all, how bits are translated. That's why I asked to ...
by DyadyaGenya
Thu Jun 01, 2023 8:04 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

The TP-UDL field. 1. Length of the user data, including the User Data Header if present. 2. If the SMS is encoded with a 7-bit encoding, this field indicates the number of characters in the message. 3. If the encoding is UCS2, then the field indicates the number of bytes in the message. Here, it is ...
by DyadyaGenya
Thu Jun 01, 2023 7:55 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

Regarding the TP-SCTS field, I think I understand it. It is encoded similarly to phone numbers. The only clarification I need is whether there is another time format, and if so, how it is encoded and indicated as a different time format.
by DyadyaGenya
Thu Jun 01, 2023 7:52 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

TP-DCS field.
1. It seems that GSM-7 encoding is "00" and UCS2 encoding is "08". However, I have also seen "10" and "18". What are these encodings?
2. Are there any other types of encoding?
by DyadyaGenya
Thu Jun 01, 2023 7:49 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

Is the TP-PID field ever different from "00"? What other values can it have, how are they encoded, and how many characters do they occupy?
by DyadyaGenya
Thu Jun 01, 2023 7:46 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

Now let's talk about the sender's address field (TP-OA). Although it may resemble the SCA number at first glance, there are certain aspects that are not clear: 1. Why does the same length of the SCA number get encoded as "07," while for the sender's address it is "0B"? 2. What ty...
by DyadyaGenya
Thu Jun 01, 2023 7:36 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

Now let's talk about the TP-MTI & Co. field. First of all, it's not entirely clear how to determine the SMS type. There seems to be an explanation: SMS-DELIVER, SMS-STATUS REPORT, SMS-SUBMIT REPORT, RESERVED. There's even a translation from bits to regular numbers. But I don't understand it yet....
by DyadyaGenya
Thu Jun 01, 2023 7:22 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

Re: PDU Fields for incoming SMS

If I understand correctly, the TP-SCA field consists of three parts: the length of the number, the type of number, and the actual number. There are a few questions that I don't understand: 1. If I understand correctly, TP-SCA can be absent and taken from the SIM card itself. In that case, it seems t...
by DyadyaGenya
Thu Jun 01, 2023 7:19 pm
Forum: Scripting
Topic: PDU Fields for incoming SMS
Replies: 49
Views: 6380

PDU Fields for incoming SMS

Hi all. I'm trying to figure out the PDU fields of the incoming SMS. On the Internet, there is a lot of any disordered information and it is scattered. It seems to have found several more or less informative schemes. But there is no description for them that is understandable to an ordinary person. ...
by DyadyaGenya
Thu Jun 01, 2023 11:45 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Just try it. It's a syntax error in recent V7 at least. But {} is [:nothing] (or nil), not an array.
That is, it only concerns the creation of an empty array. If the array is created not empty, then it can be written in this way?
by DyadyaGenya
Thu Jun 01, 2023 1:24 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

TP-UDL: 21 (message lenght on septept, because is on GSM-7 format. Are octects if the mesage is on UCS-2) TP-UD: D4F29C0E6A97E7F3F0B90CA2BF41412A68F86EB7C36E32885A9ED3CB72 (message encoded on octect, but internally is on septept for GSM-7, is on octect if is ASCII-8 or UCS-2) Decode the GSM-7 or ev...
by DyadyaGenya
Wed May 31, 2023 11:53 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

As already written on another post, never use ({}) the result is unexpected.
The only way to create empty array is [:toarray ""] and without ( ).
By the way, can you tell me the link where it is written about this?
by DyadyaGenya
Wed May 31, 2023 9:55 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

I've updated my script by changing the variable names to be more consistent, I've reformatted the code for clarity, optimized the internal operations to execute as few instructions as possible and make everything easier to understand how it works. Your code is really good, I didn't argue with that....
by DyadyaGenya
Wed May 31, 2023 9:49 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

You need to decode PDU line from sms key in $arrayStat values map from offsets described at post #23 or see here Do you have more examples explaining how to decipher some of the meanings? I can't figure out how to deal with the sender number and SMS type (SMS-DELIVER,SMS-STATUS REPORT,SMS-SUBMIT RE...
by DyadyaGenya
Wed May 31, 2023 9:34 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

are you aware of ROS script documentation existence? See: https://wiki.mikrotik.com/wiki/Manual:Scripting#Functions and https://help.mikrotik.com/docs/display/ROS/Scripting maybe it helps. I watched them. They are very short and do not give a complete picture. If I had not looked at these instructi...
by DyadyaGenya
Wed May 31, 2023 8:40 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Re: Can't turn code into a function [SOLVED]

Main one is you need to use $1 to capture the 1st argument to the function and assign it to a "number" inside your function – no need for ":local number XXXX" if your using a function. Personally, I'd make the function itself global. I think I'm beginning to understand. What if ...
by DyadyaGenya
Wed May 31, 2023 7:51 pm
Forum: Scripting
Topic: Can't turn code into a function [SOLVED]
Replies: 45
Views: 5843

Can't turn code into a function [SOLVED]

Hi all. I'm trying to convert the code into a function. This code in the specified line swaps these characters in each pair of characters. But when I try to make it into a local function, I get nothing. The function neither prints nor returns a result. The source code is this: :local number "83...
by DyadyaGenya
Wed May 31, 2023 3:58 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

:set ($subarray->"index" ) [:tonum ($tmpStat->0)] :set ($subarray->"status") ($smsStatus->[:tonum ($tmpStat->1)]) :if ([:len $tmpStat] = 3) do={ :set ($subarray->"alpha" ) "" :set ($subarray->"length") [:tonum ($tmpStat->2)] } else={ :set ($subarray...
by DyadyaGenya
Wed May 31, 2023 2:08 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Example: using my code 07912180958739F1040B917120069876F000009140503223218A21D4F29C0E6A97E7F3F0B90CA2BF41412A68F86EB7C36E32885A9ED3CB72 usin your (unaltered or clean, no difference) code 07912180958739F1040B917120069876F000009140503223218A21D4F29C0E6A97E7F3F0B90CA2BF41412A68F86EB7C36E32885A9ED3CB7 ...
by DyadyaGenya
Wed May 31, 2023 1:57 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

If I do such a check, then these gaps are also clearly visible. foreach key,sms in=$smsArray do={ :put "$key=$sms"; } Even if I replace I will do this replacement: :set smsArray ( $smsArray , [ :pick $modemOutput ( $matchPosition+1) ( [ :find $modemOutput $search2 $matchPosition ] - 1 ) ]...
by DyadyaGenya
Wed May 31, 2023 12:15 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Results: ERROR : missing everytime last PDU hex value... Very strange. I check the result of your script and mine and they have identical results in my opinion. Could you show what exactly is missing in my version? What symbols? At the start try to convert just the string 07912180958739F1040B917120...
by DyadyaGenya
Mon May 29, 2023 7:29 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

sms-read script is mostly created from scripts at
Please see my version.
by DyadyaGenya
Mon May 29, 2023 7:26 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

You want to do too many things at once without knowing how to code. Apparently all the same Google translator translates incorrectly. You misunderstood me. I'm just trying to do it step by step. And I built the steps for myself in my head approximately the same as you described. In my last post, I ...
by DyadyaGenya
Mon May 29, 2023 2:40 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Ok, if you want one hand, since now the goal is sufficently precise: Of course your code works. But I'm learning and trying to do the same and use my experience. Below is my attempt to do something similar without taking into account phonebook data. How to substitute them I understand. But I can't ...
by DyadyaGenya
Mon May 29, 2023 2:34 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

@DyadyaGenya
If you still have troubles with parsing PDU, here is mine script if you find it useful:
Thanks, I'll take a look anyway. But now I have a problem with arrays. I can't figure out how to work with them.
by DyadyaGenya
Sun May 28, 2023 1:07 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

And when I try to find only "OK", it is found only once at the very end
by DyadyaGenya
Sun May 28, 2023 10:05 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Try with :put ([ /interface lte at-chat lte1 wait=yes input="AT+CMGL=4" as-value ]->"output" ) and you see the "OK" at the end. This is what I was talking about. In such a situation, I see "OK". But if I do this :local modemOutput ( [ /interface lte at-chat l...
by DyadyaGenya
Sun May 28, 2023 12:07 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

If I do such a check, then these gaps are also clearly visible. foreach key,sms in=$smsArray do={ :put "$key=$sms"; } Even if I replace I will do this replacement: :set smsArray ( $smsArray , [ :pick $modemOutput ( $matchPosition+1) ( [ :find $modemOutput $search2 $matchPosition ] - 1 ) ] ...
by DyadyaGenya
Sat May 27, 2023 10:40 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

at the start is :local start -2 because the first record start with "+CMGL: " that have 2 less characters: \r\n I did not have time to check, but does it find the first occurrence in this form? "\r\nOK" is the end of AT output, so must be removed at the end. You do not have noti...
by DyadyaGenya
Sat May 27, 2023 5:12 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Ok, if you want one hand, since now the goal is sufficently precise: I'm still thinking and deciding what would be more convenient. But your option looks if not exactly how I want it, then very close to what I want I have a couple of clarifications regarding your code, although they are not directl...
by DyadyaGenya
Sat May 27, 2023 12:05 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

I have realized my mistake. It turns out I was translating and applying the ":pick" command incorrectly. The second parameter of the command is not the length of the segment to be cut from the beginning (from the first parameter), but rather the length from the beginning of the string. The...
by DyadyaGenya
Fri May 26, 2023 9:04 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Do not split at \n (or more precisely to \r\n) Unfortunately, I did not have time to notice that there is a carriage return symbol here. This makes the job easier to some extent. split at +CMGL: As far as I understand, in MikroTik there is no built-in way to split by a specific character. Maybe I h...
by DyadyaGenya
Fri May 26, 2023 7:56 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

As already written on another post, never use ({}) the result is unexpected.
The only way to create empty array is [:toarray ""] and without ( ).
Okay, I'll fix this. I have inserted a few lines for clarification in the code. I forgot to add them when I did the translation
by DyadyaGenya
Fri May 26, 2023 7:04 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

I can't say for certain which arrays I will use, but I wanted to try something very basic, specifically, obtaining the message number, its status, and length. To do this, I need to find all phrases of the "+CMGL: 15,1,,155" type and trim the alphabetic part. It seems like I've gone through...
by DyadyaGenya
Thu May 25, 2023 8:09 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

You have to use the 3rd example here. Why lost time to call first value (index 0) k1 and second value (index 1) k2? Simply call the value... https://forum.mikrotik.com/viewtopic.php?t=196458#p1004142 Unfortunately, I haven't had time to take a closer look at your example yet. Hope to do it tonight.
by DyadyaGenya
Thu May 25, 2023 8:08 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

You can achieve that with inner array instead of using properties map and get certain property by index of inner array, but for me this approach has less cognitive complexity code. Maybe you're right. I haven't decided yet how it will be. In this tutorial, I'm trying to understand what arrays can d...
by DyadyaGenya
Thu May 25, 2023 5:17 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

At the moment, I have more or less figured out how to access a specific index of a nested array. There seem to be two ways, but I'm not sure which one is correct. # init 2 main multy array :local multy {"10"={k1={2};k2={125}}; "2"={k1={1};k2={80}}; "7"={k1={0};k2={8080}...
by DyadyaGenya
Thu May 25, 2023 1:06 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

# extracts inner array for index 10 (actually is key) :local arr10 ($arr->"10") I more or less understand this, but how can I access the internal data index in key 10 directly? If I do like this: foreach a,k in=$arr do={ :put "$a=$k"; } then I get the following: 10=2;10=125 2=1;...
by DyadyaGenya
Thu May 25, 2023 1:30 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

For your example:
Thanks for your examples. I'm starting to understand a little. Of course, I'm still far from fully understanding, but these examples are beginning to help.
by DyadyaGenya
Thu May 25, 2023 1:27 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Good fortune... Thank you. I have seen this thread. It contains a lot of redundant information. And there is no one that interests me. But I already said that I don't need someone else's function. I want to figure it out myself. Maybe later I will want to forward the SMS somewhere, but for now it's...
by DyadyaGenya
Thu May 25, 2023 12:58 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

I've already answered this: Your answer helped a lot to create an array that contains the length of the phrase. That is, the array len The general meaning of the future script is to learn how to parse SMS. In a long-standing situation, this will be the SMS number, its status, length. Based on it, I...
by DyadyaGenya
Thu May 25, 2023 12:14 am
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Re: Using two arrays, process the text and create a third array

Perhaps that will be clearer. Here is a piece of text in which you need to do a search bla-bla 10,2,,125 43800200437043C043E04360435043C043E002107918350000014F0600ED0D63739500030C07070438043C04300439043C043E0441044F00210020042004300437043E043C0020043C06C7EBBCB0008221120513141803C0 bla-bla 2,1,,80 BB...
by DyadyaGenya
Wed May 24, 2023 11:53 pm
Forum: Scripting
Topic: Using two arrays, process the text and create a third array
Replies: 79
Views: 9093

Using two arrays, process the text and create a third array

I have text. It repeats a phrase, which consists of an alphabetic part and a digital part. The letter part does not change, but the digital part changes and the numbers in it are separated by commas. Something like this: "bla-bla 10,2,,125" or "bla-bla 2,1,,80" or "bla-bla 7...
by DyadyaGenya
Wed May 24, 2023 10:10 pm
Forum: Scripting
Topic: Subtraction of elements in the Mikrotik array (does not count the first element correctly) [SOLVED]
Replies: 2
Views: 2493

Re: Subtraction of elements in the Mikrotik array (does not count the first element correctly) [SOLVED]

example code


Thanks a lot. This is what I need. Further, for my purposes, I redid the cycle like this
:foreach key,num in=$whereEnd do={
    if (($key % 2) = 0) do={
        :put "$($num - $previous)"
    } else={
        :set previous $num
    }
}
by DyadyaGenya
Wed May 24, 2023 7:31 pm
Forum: Scripting
Topic: Subtraction of elements in the Mikrotik array (does not count the first element correctly) [SOLVED]
Replies: 2
Views: 2493

Subtraction of elements in the Mikrotik array (does not count the first element correctly) [SOLVED]

I can't figure out how to write scripts in Mikrotik. Another problem. There is an array. I'll even start from afar. You need to find the length of the phrase in the text. The phrase in the text is repeated several times, but the phrase itself is not constant, and changes slightly. Constant character...
by DyadyaGenya
Tue May 23, 2023 2:07 pm
Forum: Beginner Basics
Topic: RBM33G + ssd M2
Replies: 0
Views: 417

RBM33G + ssd M2

Can someone tell me about the compatibility and configuration of the RBM33G and the ssd disk in the M2 connector? I insert it into the connector, the disk seems to be nowhere to be seen. I installed a jumper. All the same, neither in the resources nor in the files it is not. /disk print doesn't show...
by DyadyaGenya
Sat May 20, 2023 6:53 pm
Forum: General
Topic: Send/receive SMS on RBM33G+Quectel EM12G
Replies: 0
Views: 512

Send/receive SMS on RBM33G+Quectel EM12G

Hello everyone. I'm trying to figure out how to send and receive SMS on RBM33G + Quectel EM12G. Here in this link https://wiki.mikrotik.com/wiki/Manual:Tools/Sms#Examples, there are some examples. I tried doing it like this: /tool sms send port=lte2 phone-number="phone number" message=&quo...
by DyadyaGenya
Fri May 19, 2023 8:27 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

If you need to create AP with both bands, you have to use multiple radio cards (just like JohnTRIVOLTA shown on his photo), there is no other way around that. I have exactly the same RBM33G board. And exactly the same wifi module. Namely Compex WLE900VX. And the sellers assured me that this module ...
by DyadyaGenya
Fri May 19, 2023 8:09 pm
Forum: General
Topic: SMS send failed: std failure: failed(6)
Replies: 2
Views: 1310

Re: SMS send failed: std failure: failed(6)

any idea on how to proceed?
Have you solved your problem?
by DyadyaGenya
Fri May 19, 2023 3:21 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

Are you completely new to Mikrotik? It sounds like you have no idea how things even work. Time to RTFM, maybe watch some videos on how to configure and work with WISP hardware, otherwise you will keep asking stupid questions like this... Yes, I'm a complete beginner in MikroTik. I mentioned that in...
by DyadyaGenya
Thu May 18, 2023 2:46 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

I've used a lot of adapters based on AR93XX, AR98XX and they all worked correctly! Example: Have you tried working with just one AR98XX module? I purchased one myself, similar to your Compex WLE900VX. I can't figure out how to configure both the 2.4GHz and 5GHz bands to work on this single module. ...
by DyadyaGenya
Thu May 18, 2023 12:33 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

At one end, the connectors are like those for the wifi card, and at the other end, they are like those for the sector antenna cables. No, I meant the connectors on the Wi-Fi module. The module has three connectors (CH0, CH1, CH2). Is there any difference in which of these connectors to use when con...
by DyadyaGenya
Wed May 17, 2023 1:57 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

Why not ? Just use the necessary antenna pigtails!
Is there any difference in which connectors to connect pigtails for sector antennas?
by DyadyaGenya
Wed May 17, 2023 11:28 am
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

As for bluetooth, completely forget about it ever working in ROS, it's not going to happen. Only possibility is if USB pass-trough ever makes it into containers subsystem, it might be possible to run bluez in a container or other USB bluetooth stack...
But KNOT can work with bluetooth.
by DyadyaGenya
Wed May 17, 2023 11:23 am
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

yes, of course. You can turn off chains in advanced options, can even assign different ones for TX/RX...
This is you about my question, can the module be used with two sector antennas?
by DyadyaGenya
Tue May 16, 2023 11:39 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

I've used a lot of adapters based on AR93XX, AR98XX and they all worked correctly! Example:
Can the first module be used with only two sector antennas?
by DyadyaGenya
Tue May 16, 2023 11:35 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

I've used a lot of adapters based on AR93XX, AR98XX and they all worked correctly! Example: That's good to hear, it's pleasing. I see one module. It seems to be the Compex WLE900VX. It has three antennas. Do I need to connect all three antennas at once? Does it have Bluetooth capability? I cannot i...
by DyadyaGenya
Tue May 16, 2023 9:24 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

Yes, ONLY chipsets with specific drivers (ie AR5211, AR5212, AR5416, AR9300, AR9888, QCA9888, QCA9984, WIL6210) have chance to work. No other will be recognized at all like you show on your screenshot, even if it's similar family or generation. Devices listed in PCI resources are just that: list of...
by DyadyaGenya
Tue May 16, 2023 1:51 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

Re: List of supported wifi modules

At the moment, after reading numerous forum threads and other sources, I have come to understand that it is possible to unpack a firmware image using an archiver tool and explore the "wireless" directory. In that directory, there is a small list of modules: AR5211, AR5212, AR5416, AR9300, ...
by DyadyaGenya
Tue May 16, 2023 1:19 pm
Forum: Wireless Networking
Topic: Mikrotik x86 compatible wireless
Replies: 7
Views: 6093

Re: Mikrotik x86 compatible wireless

I requested a support ticket but so far not yet able to make it work.
Did you contact the local support or the global support? What is the contact address?
by DyadyaGenya
Tue May 16, 2023 1:15 pm
Forum: Wireless Networking
Topic: Mikrotik x86 compatible wireless
Replies: 7
Views: 6093

Re: Mikrotik x86 compatible wireless

Not really

At least this does not work in V7

https://mikrotik.com/product/R11e-5HacT
So, does it mean that even a Wi-Fi module from MikroTik doesn't work on MikroTik devices?
by DyadyaGenya
Mon May 15, 2023 12:25 pm
Forum: Wireless Networking
Topic: RBM33G and usb Wi-Fi
Replies: 6
Views: 2103

Re: RBM33G and usb Wi-Fi

No. Мikrotik stopped supporting the usb wifi adapter with the 6th version of ROS . Also only atheros based adapters were supported! And also, can you suggest after which specific version the support for USB Wi-Fi was discontinued? The thing is, I'm trying to unpack an NPK firmware image. It has a d...
by DyadyaGenya
Mon May 15, 2023 12:14 pm
Forum: Wireless Networking
Topic: RBM33G and usb Wi-Fi
Replies: 6
Views: 2103

Re: RBM33G and usb Wi-Fi

No. Мikrotik stopped supporting the usb wifi adapter with the 6th version of ROS . Also only atheros based adapters were supported!
Do you know why they stopped supporting USB Wi-Fi?
And does it mean that if I find a USB Wi-Fi with an Atheros chip, it will work on MikroTik?
by DyadyaGenya
Sun May 14, 2023 4:28 pm
Forum: Wireless Networking
Topic: RBM33G and usb Wi-Fi
Replies: 6
Views: 2103

RBM33G and usb Wi-Fi

Hello. Can MT work with wifi module connected to usb port? I tried to connect the one that I have available. He was seen in yusb devices, correctly identified his model (Ralink). It also showed up in the port lists. But here it is red. And if you click on it, then in the details window it says that ...
by DyadyaGenya
Sat May 13, 2023 9:38 pm
Forum: RouterBOARD hardware
Topic: How to work with IoT on RouterBOARD?
Replies: 8
Views: 4660

Re: How to work with IoT on RouterBOARD?

For me MT devices just integrade with MQTT today, and do carry the wifi backbone for the devices. (In wifi there is no relay function in the IoT nodes as with Z-wave or Zigbee) For example, let's say we use two esp-now devices. Relatively speaking, let the radius of action of the esp-now device be ...
by DyadyaGenya
Sat May 13, 2023 12:15 pm
Forum: RouterBOARD hardware
Topic: How to work with IoT on RouterBOARD?
Replies: 8
Views: 4660

Re: How to work with IoT on RouterBOARD?

MT router is not the central server for IOT. MQTT broker on another device? Quite common setup, no? Some even use a MQTT broker in the cloud. It's not even about where the MQTT broker is. For me MT devices just integrade with MQTT today, and do carry the wifi backbone for the devices. (In wifi ther...
by DyadyaGenya
Sat May 13, 2023 11:47 am
Forum: RouterBOARD hardware
Topic: How to work with IoT on RouterBOARD?
Replies: 8
Views: 4660

Re: How to work with IoT on RouterBOARD?

additional packages .... are just compiled for all devices AFAIK. There is seldom something that is not in all ROS images, unless it is CPU platform specific (like Zerotier for ARM only) The firmware images are not MT device specific but are built per CPU platform. Maybe I'm not even expressing mys...
by DyadyaGenya
Sat May 13, 2023 11:07 am
Forum: RouterBOARD hardware
Topic: How to work with IoT on RouterBOARD?
Replies: 8
Views: 4660

Re: How to work with IoT on RouterBOARD?

Why then make firmware with IoT support if it cannot do this in hardware? Why make firmware for wifi support, if some routers cannot do this in hardware? IOT is an option, and additional package, that is usefull if the proper hardware is choosen. I do not understand why even make additional package...
by DyadyaGenya
Sat May 13, 2023 12:40 am
Forum: RouterBOARD hardware
Topic: How to work with IoT on RouterBOARD?
Replies: 8
Views: 4660

How to work with IoT on RouterBOARD?

Not so long ago I got acquainted with Mikrotik products and in general I am delighted with its capabilities. But I don’t understand why IoT support was included in the routerboard if no device can be connected? The bulk of IoT devices are connected either via Wi-Fi or Bluetooth. But miniPci-e slots ...
by DyadyaGenya
Sat May 13, 2023 12:05 am
Forum: Scripting
Topic: CPU usage script in terminal
Replies: 2
Views: 2809

Re: CPU usage script in terminal

:local cpuLoad [/system resource get cpu-load] :put $cpuLoad Thank you. Thus shows the degree of CPU usage in percent. And to find out how the processor will be loaded in a second, the script needs to be run in a loop and then it will display the result in a new line. But in order to monitor the st...
by DyadyaGenya
Fri May 12, 2023 11:50 pm
Forum: Wireless Networking
Topic: Mikrotik x86 compatible wireless
Replies: 7
Views: 6093

Re: Mikrotik x86 compatible wireless

x86 does have following drivers: AR5211 AR5212 AR5416 AR9300 AR9888 QCA9888 QCA9984 So cards with above radio chipsets should probably work... There is zero support for any non-Qualcomm/Atheros radios, so forget about any common Intel/Realtek wlan cards. Have you tried anything from this list yours...
by DyadyaGenya
Fri May 12, 2023 11:47 pm
Forum: Wireless Networking
Topic: Qualcomm QCA6174
Replies: 12
Views: 2272

Re: Qualcomm QCA6174

Is Qualcomm QCA6174 supported by Mikrotik, I cannot see it in wireless section.
Did you manage to connect this module to your Mikrotik?
by DyadyaGenya
Thu May 11, 2023 11:14 pm
Forum: Wireless Networking
Topic: List of supported wifi modules
Replies: 28
Views: 8156

List of supported wifi modules

HI. There is a list of compatible modems and SFP modules for Mikrotik. Here it is: https://help.mikrotik.com/docs/display/ROS/Peripherals But I can't find a similar list for wifi modules. I understand that Wi-Fi modules intel will not be compatible. But the rest? Particularly interested in modules w...
by DyadyaGenya
Wed May 10, 2023 9:04 pm
Forum: Scripting
Topic: Is it possible to transfer data from the script to Graphing
Replies: 5
Views: 1832

Re: Is it possible to transfer data from the script to Graphing

I understand that this is done in a loop and there is already an option where everything is written in a line. And the new line, as it were, continues the columns. But this is not very convenient. I want a graphic display.
by DyadyaGenya
Wed May 10, 2023 8:59 pm
Forum: Scripting
Topic: Is it possible to transfer data from the script to Graphing
Replies: 5
Views: 1832

Re: Is it possible to transfer data from the script to Graphing

of course you can write a script that displays the interesting data in a loop (e.g. every few seconds), and when you start that from the terminal you can look at it. you can even maintain some derived values in the script and display them as well, like average, average over last minute, lowest, hig...
by DyadyaGenya
Wed May 10, 2023 8:38 pm
Forum: Scripting
Topic: Is it possible to transfer data from the script to Graphing
Replies: 5
Views: 1832

Re: Is it possible to transfer data from the script to Graphing

Unfortunately no. Suppose I collect data from the LTE interface (Siera modem) with a script. They come out like this: Mode: ONLINE RSSI: -59;-65;-63;-67 SINR: 3.4 RSRP: -89;-97;-94;-96 RSRQ: -11.5 LTE band: B3 LTE bw: 20 MHz LTE CA state: INACTIVE LTE Scell band: B7 LTE Scell bw: 15 MHz This data i...
by DyadyaGenya
Wed May 10, 2023 3:54 pm
Forum: Scripting
Topic: Variable type "nil" but data is printed
Replies: 2
Views: 1739

Re: Variable type "nil" but data is printed

On terminal is not printed the variable, but the result of the operation, is why the variable is "nil".... I realized my mistake, I should have done this :local ModemResponse :set $ModemResponse ( [ /interface lte at-chat lte1 wait=yes input="AT!GSTATUS?" as-value ]->"outpu...
by DyadyaGenya
Wed May 10, 2023 12:16 pm
Forum: Scripting
Topic: Is it possible to transfer data from the script to Graphing
Replies: 5
Views: 1832

Is it possible to transfer data from the script to Graphing

Is it possible to collect data using a script and pass it to Graphing?
by DyadyaGenya
Wed May 10, 2023 12:21 am
Forum: Scripting
Topic: Variable type "nil" but data is printed
Replies: 2
Views: 1739

Variable type "nil" but data is printed

In a script, I execute a command and write the result to a variable. The result is printed in the terminal. But checking the data type of the variable says that the type is "nil". How can this be? The script is like this: :local output [/interface lte at-chat lte1 wait=yes input="AT!G...
by DyadyaGenya
Tue May 09, 2023 10:30 pm
Forum: Scripting
Topic: CPU usage script in terminal
Replies: 2
Views: 2809

CPU usage script in terminal

Hello. I'm quite new to writing scripts for Mikrotik. But I needed a script that would display used of the Mikrotik processor in the terminal. Is it possible?