Sample Header Ad - 728x90

Waveshare SIM7600E-H 4G HAT support on OpenWrt

0 votes
0 answers
430 views
I would like to use [Waveshare SIM7600E-H 4G HAT](https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT) on OpenWrt (ideally) or at least on Raspbian. I would ideally like understand what is needed to be done from the command line (better than use [luci](https://openwrt.org/docs/guide-user/luci/start) or any other gui configuration). Following I found from various sources for [OpenWrt](https://www.waveshare.com/wiki/Raspberry_Pi_OpenWrt_Tutorial_2:_Build_a_Portable_Raspberry_Pi_4G_Wireless_Router#Raspberry_Pi_programming_OpenWrt_image) , [Raspbian](https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT#Raspbian) [Raspbian - NDIS dial-up and self-starting](https://www.waveshare.com/wiki/NDIS_dial-up_and_self-starting) , [Raspbian - RNDIS Dial-Up](https://www.waveshare.com/wiki/Raspberry_Pi_RNDIS_dial-up_Internet_access) * boot/config.txt should have at least enable_uart=1. Anything else? [Raspbian instructions](https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT#Raspbian) mention also dtoverlay=disable-bt. * Linux kernel must support [option module](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/serial/option.c#n2059) , via CONFIG_USB_SERIAL_OPTION=m kernel config option (or =y builtin module). I'm not sure if this is enabled for OpenWrt, it should be for Raspbian kernel. * Minimal kernel version. I suppose that kernel 5.15 which is in [OpenWrt 23.05](https://openwrt.org/docs/techref/targets/kernelversions) should be new enough, the module is very old and SIM7600 support was added in kernel 4.20 ([MBIM support](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cc6730df08a291e51e145bc65e24ffb5e2f17ab6)) and in 5.2 ([RNDIS mode](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5417a7e482962952e622eabd60cd3600dd65dedf)) . * Support for Raspberry Pi not (yet) mainlined kernel code. I see /boot/config.txt mentioned in [OpenWrt Raspberry Pi wiki](https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi) , which should mean that hopefully anything which kernel needs for Raspberry Pi and it's not in [the mainline kernel](https://kernel.org/) is patched in OpenWrt kernel. https://openwrt.org/toh/start claims that OpenWrt 23.05.5 supports all RPI versions, just the newest Raspberry Pi 5 needs snapshot (the future version). * user space configuration - module should be visible
lsusb |grep -i Qualcomm
ls -la /dev/ttyUSB[0-4]
If not, it's needed to manually load module and even configure the mode
modprobe option
echo "1e0e 9011" > /sys/bus/usb-serial/drivers/generic/new_id
# or
echo "1e0e 9011" > /sys/bus/usb-serial/drivers/option1/new_id
In archive https://files.waveshare.com/upload/2/29/SIM7600X-4G-HAT-Demo.7z (referenced in [Raspbian](https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT#Raspbian)) is file SIM7600X-4G-HAT-Demo/Raspberry/c/sim7600_4G_hat_init which sets some GPIO values:
echo "4" > /sys/class/gpio/export
sleep 0.1
echo "out" > /sys/class/gpio/gpio4/direction
echo "0" > /sys/class/gpio/gpio4/value
echo "6" > /sys/class/gpio/export
sleep 0.1
echo "out" > /sys/class/gpio/gpio6/direction
echo "0" > /sys/class/gpio/gpio6/value
I suppose this example is not needed for actual Waveshare use. * libqmi is of course supported for both distros, [ OpenWrt 23.05 has 1.32.4](https://github.com/openwrt/packages/blob/openwrt-23.05/libs/libqmi/Makefile) (quite new version).
Asked by pevik (1587 rep)
Oct 29, 2024, 09:24 PM
Last activity: Oct 29, 2024, 09:36 PM