New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insmod: ERROR: could not insert module ch34x.ko: Invalid module format #3

Open
satech-domo opened this Issue Oct 22, 2016 · 14 comments

Comments

Projects
None yet
@satech-domo

satech-domo commented Oct 22, 2016

Raspberry pi3 with NOOBS Debian installed 2016 oct 19
did a reboot,
show "ch341 4932 0 at lsmod,
show "ch341.ko" at ls /lib/modules/$(uname -r)/kernel/drivers/usb/serial
nothing at sudo depmod -a

previously installed libusb-1.0.0-dev, mochad-0.1.15, usbutils
but got at command $ Isusb
bash: Isusb: command not found

Salutations

here the terminal output for ch34x

_> pi@raspberrypi:~ $ sudo insmod ch34x.ko

insmod: ERROR: could not insert module ch34x.ko: Invalid module format
pi@raspberrypi:~ $ lsmod
Module Size Used by
bnep 10340 2
hci_uart 17943 1
btbcm 5929 1 hci_uart
bluetooth 326105 22 bnep,btbcm,hci_uart
brcmfmac 186339 0
brcmutil 5661 1 brcmfmac
joydev 9024 0
evdev 11396 6
sg 18319 0
cfg80211 427855 1 brcmfmac
snd_bcm2835 20447 1
rfkill 16037 4 cfg80211,bluetooth
snd_pcm 75762 1 snd_bcm2835
snd_timer 19288 1 snd_pcm
snd 51908 5 snd_bcm2835,snd_timer,snd_pcm
spi_bcm2835 6678 0
bcm2835_gpiomem 3040 0
i2c_bcm2708 4834 0
bcm2835_wdt 3225 0
ch341 4932 0
usbserial 22115 1 ch341
w1_gpio 3657 0
wire 25219 1 w1_gpio
cn 4374 1 wire
uio_pdrv_genirq 3164 0
uio 8000 1 uio_pdrv_genirq
i2c_dev 5859 0
fuse 83653 3
ipv6 347466 52
pi@raspberrypi:~ $ ls /lib/modules/$(uname -r)/kernel/drivers/usb/serial
aircable.ko io_edgeport.ko mos7720.ko sierra.ko
ark3116.ko io_ti.ko mos7840.ko spcp8x5.ko
belkin_sa.ko ipaq.ko navman.ko ssu100.ko
ch341.ko ipw.ko omninet.ko symbolserial.k_

_

@giova-fr

This comment has been minimized.

Show comment
Hide comment
@giova-fr

giova-fr Dec 29, 2016

same problem here

giova-fr commented Dec 29, 2016

same problem here

@t2ac32

This comment has been minimized.

Show comment
Hide comment
@t2ac32

t2ac32 Jan 27, 2017

same problem raspberry pi 3

t2ac32 commented Jan 27, 2017

same problem raspberry pi 3

@jdieg0

This comment has been minimized.

Show comment
Hide comment
@jdieg0

jdieg0 Feb 10, 2017

Same error on my Raspberry Pi 2 with Raspbian Jessie.

jdieg0 commented Feb 10, 2017

Same error on my Raspberry Pi 2 with Raspbian Jessie.

@marcosavini

This comment has been minimized.

Show comment
Hide comment
@marcosavini

marcosavini Apr 8, 2017

Unfortunately, same here. RPI3

marcosavini commented Apr 8, 2017

Unfortunately, same here. RPI3

@peterchylewski

This comment has been minimized.

Show comment
Hide comment
@peterchylewski

peterchylewski Jul 1, 2017

same here raspberry 2 jessie

peterchylewski commented Jul 1, 2017

same here raspberry 2 jessie

@a1rb4Ck

This comment has been minimized.

Show comment
Hide comment
@a1rb4Ck

a1rb4Ck Jul 31, 2017

For recent kernel, you need to compile from source this specifically fixed driver: https://github.com/skyrocknroll/CH341SER_LINUX.
First, update to the last kernel and prepare the env. Then, download, make and insert this CH341SER. It worked well on my RPi3, thanks to @aperepel and @skyrocknroll great works.

a1rb4Ck commented Jul 31, 2017

For recent kernel, you need to compile from source this specifically fixed driver: https://github.com/skyrocknroll/CH341SER_LINUX.
First, update to the last kernel and prepare the env. Then, download, make and insert this CH341SER. It worked well on my RPi3, thanks to @aperepel and @skyrocknroll great works.

@AlexandreToledo

This comment has been minimized.

Show comment
Hide comment
@AlexandreToledo

AlexandreToledo Sep 4, 2017

  1. download
    pi@raspberrypi:~ $ wget https://github.com/aperepel/raspberrypi-ch340-driver/releases/download/4.4.11-v7/ch34x.ko

  2. check
    pi@raspberrypi:~ $ lsmod
    Module Size Used by
    bnep 12051 2
    hci_uart 20020 1
    btbcm 7916 1 hci_uart
    bluetooth 365511 22 hci_uart,bnep,btbcm
    brcmfmac 222874 0
    brcmutil 9092 1 brcmfmac
    cfg80211 543027 1 brcmfmac
    rfkill 20851 4 bluetooth,cfg80211
    snd_bcm2835 24427 1
    snd_pcm 98501 1 snd_bcm2835
    snd_timer 23968 1 snd_pcm
    snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
    bcm2835_gpiomem 3940 0
    evdev 12423 6
    joydev 9988 0
    uio_pdrv_genirq 3923 0
    uio 10204 1 uio_pdrv_genirq
    fixed 3285 0
    i2c_dev 6913 0
    fuse 99603 3
    ipv6 408971 70

  3. go towards
    pi@raspberrypi:~ $ cd /lib/modules/$(uname -r)/kernel/drivers/usb/serial

  4. Install first
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod usbserial.ko

  5. Check once again
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod
    Module Size Used by
    usbserial 29943 0 <===== Need be installed FIRST
    bnep 12051 2
    hci_uart 20020 1
    btbcm 7916 1 hci_uart
    bluetooth 365511 22 hci_uart,bnep,btbcm
    brcmfmac 222874 0
    brcmutil 9092 1 brcmfmac
    cfg80211 543027 1 brcmfmac
    rfkill 20851 4 bluetooth,cfg80211
    snd_bcm2835 24427 1
    snd_pcm 98501 1 snd_bcm2835
    snd_timer 23968 1 snd_pcm
    snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
    bcm2835_gpiomem 3940 0
    evdev 12423 6
    joydev 9988 0
    uio_pdrv_genirq 3923 0
    uio 10204 1 uio_pdrv_genirq
    fixed 3285 0
    i2c_dev 6913 0
    fuse 99603 3
    ipv6 408971 68

  6. NOW, install ch341.ko
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod ch341.ko

  7. Voilá !!!
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod
    Module Size Used by
    ch341 6086 0 <==== Must be here first
    usbserial 29943 1 ch341 <==== Can you see me now ?
    bnep 12051 2
    hci_uart 20020 1
    btbcm 7916 1 hci_uart
    bluetooth 365511 22 hci_uart,bnep,btbcm
    brcmfmac 222874 0
    brcmutil 9092 1 brcmfmac
    cfg80211 543027 1 brcmfmac
    rfkill 20851 4 bluetooth,cfg80211
    snd_bcm2835 24427 1
    snd_pcm 98501 1 snd_bcm2835
    snd_timer 23968 1 snd_pcm
    snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
    bcm2835_gpiomem 3940 0
    evdev 12423 6
    joydev 9988 0
    uio_pdrv_genirq 3923 0
    uio 10204 1 uio_pdrv_genirq
    fixed 3285 0
    i2c_dev 6913 0
    fuse 99603 3
    ipv6 408971 68

Greetings
Alexandre Toledo
alex_cefet_rj@yahoo.com.br

AlexandreToledo commented Sep 4, 2017

  1. download
    pi@raspberrypi:~ $ wget https://github.com/aperepel/raspberrypi-ch340-driver/releases/download/4.4.11-v7/ch34x.ko

  2. check
    pi@raspberrypi:~ $ lsmod
    Module Size Used by
    bnep 12051 2
    hci_uart 20020 1
    btbcm 7916 1 hci_uart
    bluetooth 365511 22 hci_uart,bnep,btbcm
    brcmfmac 222874 0
    brcmutil 9092 1 brcmfmac
    cfg80211 543027 1 brcmfmac
    rfkill 20851 4 bluetooth,cfg80211
    snd_bcm2835 24427 1
    snd_pcm 98501 1 snd_bcm2835
    snd_timer 23968 1 snd_pcm
    snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
    bcm2835_gpiomem 3940 0
    evdev 12423 6
    joydev 9988 0
    uio_pdrv_genirq 3923 0
    uio 10204 1 uio_pdrv_genirq
    fixed 3285 0
    i2c_dev 6913 0
    fuse 99603 3
    ipv6 408971 70

  3. go towards
    pi@raspberrypi:~ $ cd /lib/modules/$(uname -r)/kernel/drivers/usb/serial

  4. Install first
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod usbserial.ko

  5. Check once again
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod
    Module Size Used by
    usbserial 29943 0 <===== Need be installed FIRST
    bnep 12051 2
    hci_uart 20020 1
    btbcm 7916 1 hci_uart
    bluetooth 365511 22 hci_uart,bnep,btbcm
    brcmfmac 222874 0
    brcmutil 9092 1 brcmfmac
    cfg80211 543027 1 brcmfmac
    rfkill 20851 4 bluetooth,cfg80211
    snd_bcm2835 24427 1
    snd_pcm 98501 1 snd_bcm2835
    snd_timer 23968 1 snd_pcm
    snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
    bcm2835_gpiomem 3940 0
    evdev 12423 6
    joydev 9988 0
    uio_pdrv_genirq 3923 0
    uio 10204 1 uio_pdrv_genirq
    fixed 3285 0
    i2c_dev 6913 0
    fuse 99603 3
    ipv6 408971 68

  6. NOW, install ch341.ko
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod ch341.ko

  7. Voilá !!!
    pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod
    Module Size Used by
    ch341 6086 0 <==== Must be here first
    usbserial 29943 1 ch341 <==== Can you see me now ?
    bnep 12051 2
    hci_uart 20020 1
    btbcm 7916 1 hci_uart
    bluetooth 365511 22 hci_uart,bnep,btbcm
    brcmfmac 222874 0
    brcmutil 9092 1 brcmfmac
    cfg80211 543027 1 brcmfmac
    rfkill 20851 4 bluetooth,cfg80211
    snd_bcm2835 24427 1
    snd_pcm 98501 1 snd_bcm2835
    snd_timer 23968 1 snd_pcm
    snd 70032 5 snd_timer,snd_bcm2835,snd_pcm
    bcm2835_gpiomem 3940 0
    evdev 12423 6
    joydev 9988 0
    uio_pdrv_genirq 3923 0
    uio 10204 1 uio_pdrv_genirq
    fixed 3285 0
    i2c_dev 6913 0
    fuse 99603 3
    ipv6 408971 68

Greetings
Alexandre Toledo
alex_cefet_rj@yahoo.com.br

@AlexandreToledo

This comment has been minimized.

Show comment
Hide comment
@AlexandreToledo

AlexandreToledo Sep 4, 2017

And everytime you need, you will have to recharge them, like that:

pi@raspberrypi:~ $ cd /lib/modules/$(uname -r)/kernel/drivers/usb/serial
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod usbserial.ko
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod ch341.ko
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod

AlexandreToledo commented Sep 4, 2017

And everytime you need, you will have to recharge them, like that:

pi@raspberrypi:~ $ cd /lib/modules/$(uname -r)/kernel/drivers/usb/serial
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod usbserial.ko
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ sudo insmod ch341.ko
pi@raspberrypi:/lib/modules/4.9.35-v7+/kernel/drivers/usb/serial $ lsmod

@mschlen

This comment has been minimized.

Show comment
Hide comment
@mschlen

mschlen Nov 7, 2017

First of all thank you very much for this manual how to get it running. I´ve done it step by step and the last lsmod shows me that everything should be fine. The problem is, that the Arduino IDE (2.1.0.5) doesnt show me a serial port. I have connected an Arduino Uno with CH34x to my Rasp3B. The weird thing: only one time it was working, but I tried different times after that and it never showed a serial port again. I also checked with lsmod before every time, but shows the two lines correctly. So do you have any suggestion or is there maybe a common mistake i made? Thanks in advance!
screenshot

mschlen commented Nov 7, 2017

First of all thank you very much for this manual how to get it running. I´ve done it step by step and the last lsmod shows me that everything should be fine. The problem is, that the Arduino IDE (2.1.0.5) doesnt show me a serial port. I have connected an Arduino Uno with CH34x to my Rasp3B. The weird thing: only one time it was working, but I tried different times after that and it never showed a serial port again. I also checked with lsmod before every time, but shows the two lines correctly. So do you have any suggestion or is there maybe a common mistake i made? Thanks in advance!
screenshot

@AppleEducate

This comment has been minimized.

Show comment
Hide comment
@AppleEducate

AppleEducate Dec 7, 2017

How do you get it to show up in lsusb? it is showing up now under usbserial.

AppleEducate commented Dec 7, 2017

How do you get it to show up in lsusb? it is showing up now under usbserial.

@mschlen

This comment has been minimized.

Show comment
Hide comment
@mschlen

mschlen Dec 7, 2017

Sry, didn't get you point. I am not an english native speaker. Think I mentioned the way I tried to get it running. See my comments to the picture.

mschlen commented Dec 7, 2017

Sry, didn't get you point. I am not an english native speaker. Think I mentioned the way I tried to get it running. See my comments to the picture.

@AppleEducate

This comment has been minimized.

Show comment
Hide comment
@AppleEducate

AppleEducate Dec 7, 2017

Unfortunately I am on a headless raspberry pi lite “Sketch”. I decided to plug in the UNO I have and it’s recgonized no problem

AppleEducate commented Dec 7, 2017

Unfortunately I am on a headless raspberry pi lite “Sketch”. I decided to plug in the UNO I have and it’s recgonized no problem

@KMe0w

This comment has been minimized.

Show comment
Hide comment
@KMe0w

KMe0w May 31, 2018

I have compiled the driver for the latest rpi kernel version.
wget https://dl.dropboxusercontent.com/s/nkglyp57i2vl7ao/ch34x.ko
sudo insmod ch34x.ko

KMe0w commented May 31, 2018

I have compiled the driver for the latest rpi kernel version.
wget https://dl.dropboxusercontent.com/s/nkglyp57i2vl7ao/ch34x.ko
sudo insmod ch34x.ko

@AlexandreToledo

This comment has been minimized.

Show comment
Hide comment
@AlexandreToledo

AlexandreToledo Jun 3, 2018

AlexandreToledo commented Jun 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment