Community discussions

MikroTik App
 
s1n4o
just joined
Topic Author
Posts: 3
Joined: Wed Dec 14, 2016 5:43 pm

Raspberry PI Zero and RouterOS, usb interface, lte

Thu Feb 22, 2018 11:31 pm

Hello,
Recently I've tried to connect Raspberry Pi Zero to my RB962UiGS (hap ac). The mini computer (rPi) has only one micro usb interface connected directly to it's cpu which gives the possibility to configure it as usb host/otg. The rPi uses dwc2 overlay to control the otg/host functionality and g_ether for the usb interface communication, there are other possibilities as well like g_serial and g_multi. When using g_ether and when connected to PC, the PC detects it as RNDIS/Ethernet Gadget and you can assign address, share internet connection to it and so on. When connected to RB using the same g_ether module it only shows it in the /system resource usb again as RNDIS/Ethernet Gadget. Reading about RouterOS usb support I've decided to change the configuration a little bit using g_multi and configfs(linux virtual filesystem used to configure g_multi and others alike). I've configured the rPi to use cdc_ecm using g_multi and configfs and there you go - RouterOS detected it as LTE interface, but sadly there is not much you can do with it since it's not actual LTE. Then I've decided using the same configuration to add static ip address to rPi's usb0 interface and dnsmasq for dhcp server with the idea to set dhcp client on the lte interface on RouterOS side, but I hit another wall - now the lte interface is gone, RouterOS still detects it in /system resource usb.

So my question is: Is there any way I can connect raspberry pi using usb and why lte interface was gone after adding dhcp server on the rPi side?

tl;dr:
raspberry pi with g_multi module and configfs cdc_emc configuration --> routeros lte interface (what can be done with it since its no real lte interface)?
raspberry pi with g_multi module and configfs cdc_emc configuration and dhcp server and static address --> routeros NO lte interface (any reason why?)
raspberry pi using usb interface -- routeros how?
 
hush
just joined
Posts: 20
Joined: Sun Jul 03, 2005 5:11 pm
Location: Croatia

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Sat Sep 29, 2018 1:24 pm

I'm just facing the same problem with my RPi Zero W... it is recognized as RNDIS/Ethernet Gadget on my router but I'm forced to use wireless to connect them.

Btw, RPi Zero with 8Mpix camera draws max. 250mA of current from the USB port and I'm using it as:
So it's an 40€ HD camera you just plug into USB port of your router on some remote location that uploads images to the cloud and also warns you if something stops working. I believe it is worth adding to the list of working USB ethernet devices...
 
hush
just joined
Posts: 20
Joined: Sun Jul 03, 2005 5:11 pm
Location: Croatia

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Sat Sep 29, 2018 3:56 pm

Well, it turns out you can fool RouterOS into thinking RPi Zero is one of supported RNDIS/CDC ethernet devices.

I just added the following g_ether module config into /etc/modprobe.d/g_ether.conf:
options g_ether idVendor=0x05ac idProduct=0x1402 iProduct=Pi0 iManufacturer=Raspberry
...and a new interface named "lte1" appeared on my router after RPi rebooted.
 
shafiqrahman
newbie
Posts: 32
Joined: Wed Apr 12, 2017 1:42 am

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Sat Mar 09, 2019 4:08 am

Hi, I am planning on adding a Pi Zero to run a Pi-hole server. And the plan is to connect the raspberry data port into the hAP Ac USB port. So, does rb assign an ip address to the usb device? This post is the only post contains both hAP AC and a Pi-Zero. And what will be the Putty command for the connected usb device?
 
thejokertheory
just joined
Posts: 4
Joined: Wed Feb 20, 2019 3:00 pm

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Mon Mar 18, 2019 5:47 pm

Is it possible to know how did you manage to have the pi detected by the routeros using g_ether module? With a RB951G 2HnD i wasn't able even to let the usb recognise it. Is it possible to know how this need to be done ?

Thank you
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 6157
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Mon Mar 18, 2019 8:46 pm

I am thinking of getting a Pi 3 B+. It has an ethernet port, can I simply connect ether4 directly to the pi-device for example or is the preferred method via USB?
I thought the USB was to attach a keyboard or something?
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
hush
just joined
Posts: 20
Joined: Sun Jul 03, 2005 5:11 pm
Location: Croatia

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Sun Mar 24, 2019 12:18 am

You can try to simulate one of the supported LTE modems, here's a short recipe inspired by this article...

First, add this line at the end of your Pi zero's /boot/config.txt to enable usb peripheral mode: dtoverlay=dwc2,dr_mode=peripheral
Then insert the following code before the final "exit 0" in your /etc/rc.local and reboot:
modprobe dwc2 libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir -p lte
cd lte
echo 0x12d1 > idVendor # Huawei
echo 0x14dc > idProduct # 3372
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
mkdir -p strings/0x409
echo "201903232323" > strings/0x409/serialnumber
echo "Raspberry Pi" > strings/0x409/manufacturer
echo "Zero USB Device" > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo "Config 1" > configs/c.1/strings/0x409/configuration
echo 500 > configs/c.1/MaxPower
# ethernet
mkdir -p functions/ecm.usb0
echo "b8:27:eb:55:53:42" > functions/ecm.usb0/dev_addr
ln -s functions/ecm.usb0 configs/c.1/
# activation
ls /sys/class/udc > UDC
A new LTE interface "lte1" should appear in your winbox after the Pi boots...
 
zibadun
just joined
Posts: 4
Joined: Fri Dec 27, 2019 12:10 am

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Mon Dec 30, 2019 3:37 am

I just added the following g_ether module config into /etc/modprobe.d/g_ether.conf:
options g_ether idVendor=0x05ac idProduct=0x1402 iProduct=Pi0 iManufacturer=Raspberry
...and a new interface named "lte1" appeared on my router after RPi rebooted.
this worked great! I assigned the IP address on the lte1 as well as usb0 (on a new subnet) and can reach usb0 from my main bridge subnet with no problem.

It would be easier if I could make the lte1 interface part of the main bridge. Then usb0 on Pi could simply get the IP from the dhcp server running on the mikrotik,
However I could not figure out how to do that. lte1 is not on the list of ports to add to the bridge. I read about the passthrough but not sure if it's applicable in this case.

Any ideas how to connect lte1 to the bridge?
 
hugomon
just joined
Posts: 5
Joined: Thu Jul 18, 2019 11:56 pm

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Tue Jan 07, 2020 3:44 pm

I just added the following g_ether module config into /etc/modprobe.d/g_ether.conf:
options g_ether idVendor=0x05ac idProduct=0x1402 iProduct=Pi0 iManufacturer=Raspberry
...and a new interface named "lte1" appeared on my router after RPi rebooted.
this worked great! I assigned the IP address on the lte1 as well as usb0 (on a new subnet) and can reach usb0 from my main bridge subnet with no problem.

It would be easier if I could make the lte1 interface part of the main bridge. Then usb0 on Pi could simply get the IP from the dhcp server running on the mikrotik,
However I could not figure out how to do that. lte1 is not on the list of ports to add to the bridge. I read about the passthrough but not sure if it's applicable in this case.

Any ideas how to connect lte1 to the bridge?
Can you elaborate how do you did it? I can't reproduce it, doesn't even it's recognized as an lte interface.
 
waqas18gd
just joined
Posts: 1
Joined: Thu May 14, 2020 2:05 am

Raspberry PI on mikrotik

Thu May 14, 2020 2:21 am

i want to install mikrotik iso file on Raspberry PI ? can someone tell me about that?
 
Swordforthelord
Frequent Visitor
Frequent Visitor
Posts: 57
Joined: Thu Jul 08, 2010 10:18 pm

Re: Raspberry PI on mikrotik

Thu May 14, 2020 9:22 pm

i want to install mikrotik iso file on Raspberry PI ? can someone tell me about that?
Given how inexpensive Mikrotik hardware is, it would be a complete waste of time. Even if it was possible, which it likely is not.
 
sassue
just joined
Posts: 1
Joined: Sat Feb 20, 2021 1:43 pm

Re: Raspberry PI Zero and RouterOS, usb interface, lte

Sat Feb 20, 2021 2:14 pm

Hi All, I have followed this guide: https://www.ctrl-alt-del.cc/2020/01/mik ... ising.html but the pizero is not recognized by the Mikrotik which is RB951G-2HnD. Unfortunately, the raspberry is without Wi-Fi. While connected to PC I manage to SSH to it, install pihole & etc. Can someone help with an advice?

Who is online

Users browsing this forum: agmatheus, andya, CorvH, gkoleff, hpet, mkx, pe1chl, sindy and 138 guests