Community discussions

MikroTik App
 
RadckM
just joined
Topic Author
Posts: 3
Joined: Fri Feb 16, 2024 12:17 pm

hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 6:52 am

Hi everybody,

Thought I post my question here.

I would like to use hAP ax3 and I would like to be able to control it remotely in our system. We are using custom made boards with STM32 (STM32H753ZIT6) that has CAN interface / ethernet port / SPI / serial port on the board. The ethernet port will be connected to the routers port because we want to use this router as a bridge between the CAN and the Ethernet.

What do you think is the best way to control and configure this router remotely and automatically from a custom made configuration file - network / serial port ?

I am an old school so it kinda feels like serial port is the easiest and safest way to have control over it, but I cannot find more information about the serial port pinout on the board nor cannot find any information this can be used to control and configure the router.

I believe for the most part we at least need to be able to control the Wifi On/Off.

Thank You in advance for you opinions.
 
RadckM
just joined
Topic Author
Posts: 3
Joined: Fri Feb 16, 2024 12:17 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 1:33 pm

For the serial interface on the board, is this the pinout on hAP ax3? Would somebody be able to confirm?

https://help.mikrotik.com/docs/display/ ... rialHeader

Thanks
Last edited by RadckM on Wed Feb 21, 2024 1:35 pm, edited 1 time in total.
 
jaclaz
Long time Member
Long time Member
Posts: 612
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 3:10 pm

But the Hap Ax3 has not a serial port?

The Mikrotik devices that do have a serial port use AFAIK the same pinout/schematics, either "Normal" db9 or RJ45so-called "Cisco style":
https://help.mikrotik.com/docs/display/ ... al+Console

But for a hAP Ax3 you can choose between ethernet and ethernet (ok there is also the USB port, but that was used for configuration only by the WOOBM, now discontinued):
https://mikrotik.com/product/woobm
https://help.mikrotik.com/docs/display/UM/Woobm-USB
I don't think that the protocol/whatever it used over USB is public/reproducible.
 
RadckM
just joined
Topic Author
Posts: 3
Joined: Fri Feb 16, 2024 12:17 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 4:56 pm

Correct, it does not have serial port anywhere on the box, however it does have possibility to solder pins on the board with available pins 1-10 named SPI + UART. So the question is, can this be used as serial port and if yes, what is the pinout for RX/TX/GND signals?
 
jaclaz
Long time Member
Long time Member
Posts: 612
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?  [SOLVED]

Wed Feb 21, 2024 5:10 pm

Nope, AFAIK:
viewtopic.php?t=123213

But while I do understand how having something disabled and that cannot be enabled to be an obstacle in some corner/edge cases, I cannot see why in your specific case you would want to use the more complex way to do something (as simple as wifi on/off) that you can do normally from the ethernet connection.

If Wifi on/off is all you need (or a handful of commands), I would rather make use of a script for the "Mode" button.

Then use a robotic arm to press it :shock: or more simply connect two wires in parallel to it :wink: , since you are willing to void the warranty by modifying the device.
 
RadckM
just joined
Topic Author
Posts: 3
Joined: Fri Feb 16, 2024 12:17 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 5:56 pm

Thank You, jaclaz,

the post you shared explains it - I wasn't aware of this.

I am simply looking for a simple way of configuring and controlling the device headlessly, the Wifi on/off is the minimum I want to achieve here, if I could use/ take advantage of the entire API via serial port that would have been great. The only reason I wanted to go with serial rather than ethernet was really the case that if someone messes up the configuration of the router I may not be able to communicate with the router over ethernet any more hence wont be able to recover it or re-configure in some automated way.

Anyway - Since there is no other option I will end up doing the ethernet and one of the options of controlling the router over API, using USB to Serial or anything like that is not an option fo rme.

Thank You
 
jaclaz
Long time Member
Long time Member
Posts: 612
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 6:20 pm

Yes, though if the device is configured correctly and the users/permissions are created wisely it is relatively improbable that "someone messes up the configuration" accidentally.

Of course "someone" must keep admin level access, the assumption is that he/she won't do damages/misconfigurations.

Within limits (look for threads by people that self-locked out of the router, not so uncommon when playing with the settings) Winbox can connect via MAC even when there is no IP or DHCP server working.

The (IMHO) correct/safest approach is however to reserve an interface with static IP address for (remote) management, out of the bridge or anything else.

Sure if the router fails on booting or similar the whole remote stuff becomes m00t, but in these cases even direct serial access would give little advantages, if any, in theory only when the routerboot part works (and it can give control to serial) and the rest of the OS hangs later in the booting process, it can happen but I believe it is a rare enough occasion.
 
optio
Long time Member
Long time Member
Posts: 672
Joined: Mon Dec 26, 2022 2:57 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 6:37 pm

Idk why USB to serial is not an option for you, but if is because you already have device connected to USB, you can use USB hub connected to MT device and connect multiple USB devices including USB to serial into hub. There are also devices such this and you don't need another USB to serial on laptop, just laptop with BT, over BT SPP you can establish serial port connection wireless.
 
jaclaz
Long time Member
Long time Member
Posts: 612
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 6:49 pm

@optio
Maybe it is my fault, "deceiving" the OP, as I thought that the woobm used something "special".

If the USB port can be configured as console access as seen here:
viewtopic.php?t=182498
viewtopic.php?t=182498#p939154

then the OP (that was going to solder pins to the board) will surely have no issues in finding a USB to serial converter working for the task.
 
optio
Long time Member
Long time Member
Posts: 672
Joined: Mon Dec 26, 2022 2:57 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 6:53 pm

I forgot to mention @RadckM or quote, I was referring to statement:
Anyway - Since there is no other option I will end up doing the ethernet and one of the options of controlling the router over API, using USB to Serial or anything like that is not an option fo rme.
But I see now that problem is related to custom board, which probably doesn't have BT and firmware support for it (regarding to my additional suggestion), but not sure why USB to serial could not work if board is connected to it, unless small board is meant to be integrated into same hAP ax3 enclosure (like backdoor board :)).
 
jaclaz
Long time Member
Long time Member
Posts: 612
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 7:11 pm

Ah, OK. :)
No idea then why "it isn't an option" surely the el-cheapo USB to serial adapters are often not particularly reliable, but "good" ones do exist, it only has to be seen if they are compatible with the Mikrotik.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 9:53 pm

Woobm is mainly a USB/serial adaptor with some wifi portal to allow terminal (telnet,ssh) access over the wifi connection, also known as reverse telnet.

viewtopic.php?t=204352&hilit=woobm#p1055762

viewtopic.php?t=203113&hilit=woobm
 
jaclaz
Long time Member
Long time Member
Posts: 612
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ax3 - how to use the API to control ithe router remotely - Can serial port on board be used?

Wed Feb 21, 2024 11:02 pm

Sure.
The issue is (or may be) only about the compatibility of the Mikrotik/ROS with other "generic" USB to RS232 converters.
These are (typically) used the other way round (i.e. to add a "virtual" COM/serial port to a computer - such as a laptop - that doesn't have a built-in one).
At least on Windows (on Linux it may be easier) they usually need specific drivers.
The 2022 post by GordonB Iinked to above is one of the few references I could find about (at least for the Hex) stating this compatibility. I believed that the Woobm used some protocol/interface/whatever and/or a specific Vid/PID that prevented from replacing it with an "ordinary" USB -,>serial converter.

Who is online

Users browsing this forum: No registered users and 11 guests