Skip to content

Instantly share code, notes, and snippets.

@calvinchengx
Last active May 4, 2022 08:33
Show Gist options
  • Save calvinchengx/a26d425cb2ab08fccb8cbc9e70114449 to your computer and use it in GitHub Desktop.
Save calvinchengx/a26d425cb2ab08fccb8cbc9e70114449 to your computer and use it in GitHub Desktop.
L610 linux driver experiment
#!/bin/bash
sudo apt install git bc bison flex libssl-dev make
git clone --depth=1 https://github.com/raspberrypi/linux
# Launch dmesg -wT and connect the modem to iBlocker (via USB cable)
# Result: usb 1-1.3: New USB device found, idVendor=1782, idProduct=4d12, bcdDevice= 0.00
# Check that below line in L610_linux_driver.sh contains correct idVendor and idProduct
echo "1782 4d11" > /sys/bus/usb-serial/drivers/generic/new_id
# Launch L610_linux_driver.sh -> eth1 interface would be available
# Modem ready for attach (AT commands would be sent to /dev/ttyUSB0)
# L610_linux_driver.sh content is below:
#!/bin/bash
##5.10.17-v7l+=uname -r
echo "############## insmod L610 drivers ################\r\n"
insmod /usr/lib/modules/5.10.60-v7l+/kernel/drivers/usb/serial/usbserial.ko
insmod /usr/lib/modules/5.10.60-v7l+/kernel/drivers/usb/serial/usb_wwan.ko
insmod /usr/lib/modules/5.10.60-v7l+/kernel/drivers/usb/serial/option.ko
echo "############## load L610 drivers ################\r\n"
echo "1782 4d11" > /sys/bus/usb-serial/drivers/generic/new_id
echo "############## List Serial Port And ECM Port ################\r\n"
sudo chmod 777 /dev/ttyUSB0
ls -al /dev/ttyUSB*
ls /sys/class/net
##sudo chown www-data:www-data /dev/ttyUSB0
##sleep 2
###sudo socat -d -d -v -x tcp4-listen:4701,reuseaddr,fork file:/dev/ttyUSB0,nonblock,echo=0,raw,waitlock=/var/run/ttyUSB0.lock &
echo "############## ifconfig ################\r\n"
ifconfig eth1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment