Building a Better Raspberry Pi Router // RPi Compute Module 4, OpenWrt, DFRobot Carrier Board

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024

ความคิดเห็น • 34

  • @JeffGeerling
    @JeffGeerling 2 ปีที่แล้ว +8

    16:18 thanks for the shout out! I love seeing another take on the board (especially now that they've tweaked a few things to work better now!).
    I'm stuck in the hospital but just last night I re-watched your "How to compile OpenWRT" video since I brought along a Pi with 4G to test it out. Thanks for these detailed walkthroughs!

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว +2

      You're welcome Jeff! Glad you enjoyed it!
      I've back-burnered this video for a few months as life got in my way, so I had to retest it once I did a quick double check to see that they released an updated OpenWrt build. I was happy to see they fixed the CM4 with Wifi issue as well, since when I first tested it, my research led to your solution that I used, and even scripted out for this video.
      I saw your comment (and sadly, your return to the hospital), but I'm glad that video can provide you value, even at the hospital where you have a small fraction of a work space, that you do at home. I want to do a end to end Pi cellular hotspot to replace my existing Verizon hotspot, (battery and all), to make it the ultimate hotspot with ethernet NICs, secondary WAN connection (WWAN or wired WAN), and basically a multipurpose mobile networking device, sporting a 5G modem to boot. I'll get to that when I can shell out for a 5G modem haha.
      It brings me great pleasure to do these detailed walkthroughs, but its only possible because your detailed walkthroughs. I'm a firm believer in freely sharing information for anyone who's curious to learn and grow, because I can attribute just about all I that know in IT, to others' generosity with their time and knowledge. As I've learned so much already, I felt that it was my time to give back, the same way others gave to me (and hence my channel). So on a philosophical and sentimental note, all of this is why I show you my gratitude for your creativity, knowledge, and willingness to share, without expectation of reciprocity. It's a beautiful thing to help others learn and create, and even more beautiful when that takes a life of its own, enabling more people to become creators in their own unique way.
      Nonetheless, your ailments clearly can't stop you from being the Geerling Guy we all know and love. Sending my support for a quick recovery, so you can get back to having all the tools at your disposal to do what you love, and what we love too.

    • @JeffGeerling
      @JeffGeerling 2 ปีที่แล้ว +1

      @@DevOdyssey Ha, thank you very much. And regarding the price of 5G modems, yeah... that's why I don't own one yet either, yikes!

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      @@JeffGeerling You’re welcome! The philosophical / thinker side of me comes out every now and then haha; feels good to be transparent with my beliefs and honest self with like minded folk.
      Yea … agreed there. 800 for an entry / mid level 5G modem, not an easy pill to swallow. But I definitely intend to get to it, as I have another fun project in mind with that, other than a hot spot. I’ll let you know when I get around to it. I’m sure your waveshare build will be very helpful for my future projects, like this one.

    • @ccgmail8025
      @ccgmail8025 2 ปีที่แล้ว

      Hi Jeff, can you see my query above about adjusting Tx power of the CM4 external antenna? When you're out of hospital. Hope you get well quick. Whatever I select, it sticks to the default 31dBm all the time. I have USB to WiFi adapters where adjusting Tx power works properly but not with the official CM4 Wireless WiFi Antenna

  • @DevOdyssey
    @DevOdyssey  2 ปีที่แล้ว +2

    What do you think of the DFRobot IoT Carrier Board? Would your replace your router with this?

  • @Victor-779
    @Victor-779 4 หลายเดือนก่อน +1

    Regarding the heatsink, probably 40mmx55mm standard size for a compute module 4. Could you let me know what the fin height is in your example? I'm not sure if it matters whether or not the fins stick out of the enclosure or not. Great video on this! 👍

    • @DevOdyssey
      @DevOdyssey  3 หลายเดือนก่อน

      Thanks for watching Victor!
      The height shouldn't matter since the fins do stick our of the enclosure, for the sake of air flow and letting the heat dissipate. I went ahead and measured it, and the height is roughly 4 mm, from the top of the fan to the base of the heat sink. Is there a reason you're concerned on the height?

    • @Victor-779
      @Victor-779 3 หลายเดือนก่อน +1

      @@DevOdyssey There are other heatsinks with differing heights, but same length and width for a CM4, but I understand now that the height doesn't matter for assembly purposes, any of them will do, thanks!

    • @DevOdyssey
      @DevOdyssey  3 หลายเดือนก่อน

      @@Victor-779 You're welcome and good to know. I figured there are, I don't shop around for different heatsinks for Raspberry Pi CM4s often. But yea it can be even taller if need be to catch more airflow, and it won't get in the way unless you squeeze the whole unit into a tight space, which I don't imagine anyone would really be doing.

  • @codelinx
    @codelinx ปีที่แล้ว

    Great info without fluff. Nice work

    • @DevOdyssey
      @DevOdyssey  ปีที่แล้ว

      Thank you codelinx! Appreciate the compliment and your viewership 😊

  • @alexandrepretyman
    @alexandrepretyman ปีที่แล้ว +1

    Hi, thank you so much for the video. The link for the DFRobot carrier board specifies:
    Storage Card: microSD slot (Only modules without eMMC supported)
    Does that mean that when using the eMMC version, one loses access to the SD memory slot?

    • @DevOdyssey
      @DevOdyssey  ปีที่แล้ว

      Thanks for watching Alexandre!
      Yes, that is correct. Just to be clear, that’s not because of how the DFRobot carrier board was designed, it’s because of how the Raspberry Pi CM4 was designed. On the eMMC version, the connection is soldered directly to the eMMC chip, and therefore there’s no way to access the microSD slot.
      On the non eMMC version, this connection is open, and therefore is accessible when a carrier board has a microSD slot.
      I was disappointed when I heard this, so I did switch between using eMMC and non eMMC Raspberry Pis CM4s when testing out this board.

  • @eltreum1
    @eltreum1 2 ปีที่แล้ว +1

    I am considering one of these to replace an older router for WAN GW/FW edge routing only. I had a thought about the reset button issue you mentioned. Can OWrt detect the other GPIO pins that are broken out for pi hats I assume? Normally those are programmable or can trigger python scripts to change the OS config with a button instead of logging into it. You would have to add a button and connect it to the pins but then you could have the CPU reset button and a config reset button.

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      Thanks for watching eltreum!
      Now thats a consideration I'd agree with. You bring up a great point about GPIO pins. In theory, this should be possible. However I am very inexperienced with using GPIOs, so I am not quite sure if there is an OpenWrt package that can do it. Doing a quick search, it looks like OpenWrt can interface with GPIOs.
      openwrt.org/docs/techref/hardware/port.gpio
      So, chances are you can set up to trigger the existing reset scripts in the OpenWrt base install, under the /etc/rc.button directory.
      This is something I'll probably explore, sometime in my free time. This would be a great addition to this tiny router, and make it more of a "real" router. If you do end up getting to this, definitely share it with us! I'd be very curious to see how you do it.

    • @eltreum1
      @eltreum1 2 ปีที่แล้ว

      @@DevOdyssey I have never used OWrt but pondered trying it. I don't really need that feature but when you said needing a GPIO it caught my attention because I was looking at programming Rpi GPIOs for network gadgets when I saw your vid on DFs page. I was planning on running the DF with Raspi or Ubuntu for a linux router I could ansible automate from my lab with low power/heat.
      There was a dev lab I read about once that had a panic button that would lock down a RPi router testing malware mitigation like a gate lever to let something loose on the other half of the lab. You could in theory wire a key switch to turn off the internet lol. I looked at the CM4 and DF router docs. DF says It's pinout is the classic 26 pin RPi 2B hat spec and is meant to be used as expected which makes things easy. GeekPi? makes a CM4 router board with OWrt with a status OLED using 4 of those pins so it has to be possible.
      I looked at the spec and the pins you need are there. There are 7 useful GPIO scattered around on the 26-pin version for buttons but you likely want to find GPIO4,5, or 6 because they are connected to the system's clock lines meaning they are possibly hardware interrupts without having to code it with built-in pull-up resistors that button triggers need for safer ground triggered switches like an Arduino. You can just wire any momentary button/switch; one side to pin 6 ground and the other to the gpio you want to trigger with the button. GPIO44 is also like this but is not exposed in the 26pin spec and usually reserved, likely for the CPU reset button it has already and is the 4th clock connected GPIO by default. datasheets.raspberrypi.com/cm4/cm4-datasheet.pdf
      The CM4 uses the newer 40pin GPIO spec so the classic 26 pins are remapped but supposedly backwards compatible with pi2 hats. On their chart GPIOs are listed as GENn. GPIO4 to the CPU is on pin 16 but to OS I think it appears to be named GPIO #23. wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767#target_3
      Having fun finding CM4 modules but if I get this running Ill drop a note. cheers

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      @@eltreum1 I see how you landed on my video. Thanks for such an in depth explanation. I'll have to be honest, I do not have nearly the same understanding and skillset that you do with hardware, as thats where I am doing a lot of learning. I'm much more versed in software. I was able to follow your explanation, but I definitely don't know as much about GPIOs as you do. It was very informative, and doesn't sound too difficult if I wanted to try this myself. I'd just have to hook up a button the GPIO 4,5 and then 6 for ground if I got that right.
      You can definitely create an easy ansible playbook for a simple linux based router. There are actually ansible playbooks for OpenWrt if you are interested. I have no particular recommendation but you can find a few on github. It was something I have started to explore for a potential future video.
      A physical hardware switch for a network panic button would be interesting for the case of malware mitigation in a malware lab. There are certainly plenty of ways to do that, but I have never heard of this route, mostly just segment everything and run it on a hypervisor. This would be a neat solution.
      I hope you end up with a CM4, and would love to see you get this working.
      All the best!

  • @DeveloperJourney
    @DeveloperJourney ปีที่แล้ว

    The link to the OpenWRT 21.02.3 DFRobot Release on the wiki is broken now. So is the old release link. So I'm going to have to build an image from the bcm2711 options on the OpenWRT site. Why would I choose squashfs over ext4? And what's the difference between factory and sysupgrade images?

    • @DevOdyssey
      @DevOdyssey  ปีที่แล้ว +1

      Thanks for watching Kevin!
      Hm that’s strange. I just tried out the link in their wiki for the new release download, and it seemed to work for me, I was able to get the zip file. Maybe it was down temporarily? Or something wrong with your ISP, difficult to tell what the issue is.
      Anyway, if you do plan on making your own build, which you can with a newer version of OpenWrt than DFRobot has on their wiki (22.03), you can use their firmware selector that makes it really easy to get the packages you need, without setting up your build environment.
      firmware-selector.openwrt.org
      Just be sure to select 64 bit Raspberry pi image, and it should work. You will have to modify the /boot/config.txt file to include otg_mode=1, if you want to use the usb c port. You can do this after you deploy the image.
      The reason why you’d use squashfs is because it’s a read only overlay file system. This means there’s less writes to the SD card, and therefore, increases its longevity. Also it enables you to reset the router to default settings. However, you won’t have access to the full size of the SD card memory, though you can probably modify this by padding it with 0’s using the dd command I believe (don’t know what it is exactly off the top of my head). This should work but I’m not 100% sure. There is definitely a way to expand out the useable space, might just have to use fdisk or gparted to resize the partition, that’s probably the most reliable way.
      With ext you have full read write file system to the SD card, which can reduce the lifetime of your memory card. You cannot reset the software to default settings using the method, so to revert changes, it will have to be done manually by hand. But it will by default give you the full space usable on the SD card.
      Factory image is used for the first time you flash the image onto your memory. Sysupgrade is used for existing OpenWrt installations where you want to upgrade the version of OpenWrt in use, or add additional packages that might not be in the system and that you can’t install due to internet limitations.
      I like squashfs since it allows me to reset to my default settings I’ve premade in my image, just in case something happens, it’s easy to revert.

    • @DeveloperJourney
      @DeveloperJourney ปีที่แล้ว

      @@DevOdyssey Update: I just couldn't get rpiboot to work from Mac OSX 12.6.5 (Monterey). Since I've upgraded to v12, I've had all sorts of USB issues with various MCUs that I program. I moved over to a Windows 10 PC and used rpiboot_setup.exe and rufus as documented in the DFRobot wiki page and that worked well. Your video was excellent for helping me understand the core ideas and moving parts in this project. I now have a functional CM4 based router configured on my LAN. Thank you!

    • @DevOdyssey
      @DevOdyssey  ปีที่แล้ว +1

      @@DeveloperJourney thanks for sharing your update! You’re definitely not the only one with that issue. I couldn’t get rpiboot to work on my Mac either, in particular, my ARM based Mac. My Intel Mac had no problems with it. It just didn’t seem to work with my ARM Mac. It sounds like it’s been a real pin for you, usb is kind of wonky on the new ARM Macs, though I’ve seem more stability with Ventura. Windows and Rufus are definitely better choices for your situation with mcu’s let alone rpiboot. Or using Linux of course.
      Nonetheless, seems like you resolved your issue. Definitely not fun to get stuck there not even knowing what the issue is and not seeing your RPi boot, thinking that it had a flashed image on it.
      Glad my video was able to get you the right information down to the fundamentals so you could not only do it yourself, but also troubleshoot the issues that occurred. These little CM4 routers are definitely fun to have on your network, I appreciate the kind words and thanks again for watching!

  • @Linuxe_d
    @Linuxe_d 2 ปีที่แล้ว

    Great Video :>

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      Thanks for watching and thanks for the compliment Linuxed! Glad you enjoyed it 😊.
      Love the name btw!

  • @freemangordon9021
    @freemangordon9021 ปีที่แล้ว

    i need your help buddy, i installed openwrt on my RPI4b it's working just fine, but the internet connection was reduced to ~2Mb/s i changed the htmode and the hwmode and i even checked the offloading and nothing has changed, any tips, thx

    • @DevOdyssey
      @DevOdyssey  ปีที่แล้ว +1

      Hi Freeman, sure, sounds like this is a bit of a misnomer.
      Your internet speed would be determined by your connection to your ISP, and how you are connecting to them. I'm assuming you are connecting to your ISP using a modem, of which then you use connect to the modem via an ethernet cable. If thats the case, you'd want to try a speed test on your Raspberry Pi 4B, and not a client connected to it. Not sure what speeds you get from your ISP, but running this test would determine it.
      When you mention changing the htmode and hwmode, it sounds like you are referring to the wireless config. If thats the case, then its likely you are using that as your WiFi, which isn't directly your internet connection. In that regard, using the WiFi on Raspberry Pi is not great for broadcasting a wireless network, given its small antenna size. Now if you are using it as a wireless WAN, that would be different. But that doesn't seem like the case. You can certainly mess with those settings, but I have found the below settings to work best in my experience.
      gist.github.com/odevodyssey/bd16cd8eb4707ef14c4d59d6fb15a406#file-wireless

  • @gdewitastras.t.1426
    @gdewitastras.t.1426 2 ปีที่แล้ว

    Wht best hardware i use to setup 4 pcs usb modem (like e3372h or other), os that i want is openwrt

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      Thanks for watching Gde Witastra, S.T.!
      I am not sure what you are asking. What do you mean by "4 pcs USB modem"? As for the e3372h, it sounds like you are referring to a Huawei cellular modem. I don't have personal experience with Huawei modems, but I'm fairly confident that OpenWrt supports it, as there are many users who use Huawei products with OpenWrt.
      I can't say I have a router of preference, yet, since there is so many more for my to try out, but I do like Raspberry Pi for its ease of use, availability (before the supply chain issues), portability, and community support. But honestly, it really depends on how you want to use the router build. I wouldnt recommend Raspberry Pi for a home router build, due to lack of ethernet ports, and short range WiFi antenna, but if you intent to make a portable router, then I would recommend Raspberry Pi.
      Otherwise, I'd refer you to OpenWrt's table of hardware to see what routers might best suit your use cases.
      openwrt.org/toh/start

    • @gdewitastras.t.1426
      @gdewitastras.t.1426 2 ปีที่แล้ว

      @@DevOdyssey is raspberry can deliver max power to all usb port? Because I want use all usb port as a wan and i use 4 huawei usb modem

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      @@gdewitastras.t.1426 Thanks for clarifying. So I am not the best at knowing all the power inter-workings of the Raspberry Pi, but I'll do my best here.
      Basically you'll just need to be sure you are not drawing more volts than the Pi power source delivers, which it needs 5 Volts / 3 Amps. So as long as your USB modems do not collectively draw more than that, you should be okay. I am not sure how much power those draw, so you'll need to look into that.
      However there are probably better ways to do this, as using the 4 USB ports, you'll run into the limitations of USB 2.0 and it's bandwidth. Now if its 4G LTE, you should theoretically be fine and its doubtful you will reach theoretical max of USB 2.0 speeds over your modem. But I'd be mindful of possibly being throttled via the USB controller, as you'll have 4 modems at once pushing data through it.
      In addition, depending on your setup, I'm not sure how the cell signal will be affected with 4 modems all close together, but thats something to keep in mind. You might want to use a different board for improved performance, but with regards to if this is possible, it should be if you don't draw too much power with those 4 modems.

    • @gdewitastras.t.1426
      @gdewitastras.t.1426 2 ปีที่แล้ว

      @@DevOdyssey thanks for attention bro,,, btw how much power at maximum performance the raspi need in ampere?

    • @DevOdyssey
      @DevOdyssey  2 ปีที่แล้ว

      @@gdewitastras.t.1426 You're welcome! You can refer to this Stack Exchange post for more information on amp requirements.
      raspberrypi.stackexchange.com/questions/99961/powering-the-pi-4-safe-voltage-levels-and-current-requirements
      It looks like a 3 AMPs are recommended (not 3.3 as I mentioned earlier, I confused that with 3.3 Volt GPIO pin so ignore that above, I edited it for correctness), where USB amp consumptions should not exceed 500 mA.

  • @yadavchetan23
    @yadavchetan23 หลายเดือนก่อน +1

    Thanks for the informative video. Would it be possible to run Android TV on the raspberry pi while being used as a 4G router you made?
    I would like to create a device like this:
    th-cam.com/video/GB_lU-Yagcs/w-d-xo.htmlsi=NEQcrW6f3RYip98d

    • @DevOdyssey
      @DevOdyssey  28 วันที่ผ่านมา

      @yadavchetan23 you’re welcome, thanks for watching! I’m not all familiar with the install process of Android TV on raspberry pi, but I did some quick searching and my initial thoughts are possibly. If you can install the necessary packages for the 4G router with the OS for Android TV (Lineage OS), then you could get it working. However I’d recommend against it. That’s because if you run into any conflicts, you’ll end up with an TV and router that don’t work. Especially as you do updates, you’re more likely to run into issues. When they’re separate, you can better control, let alone guarantee, their uptime, and therefore have a more reliable router and Android TV. If it were me, that’s the way I’d do it.