skyrocknroll / CH341SER_LINUX

nodemcu esp8266 serial linux driver with latest kernel support ubuntu 16.04
29 stars 20 forks source link

Unable to compile the latest CH341SER_LINUX driver for nodemcu #1

Open skyrocknroll opened 8 years ago

skyrocknroll commented 8 years ago
make -C /lib/modules/4.4.0-28-generic/build  M=/home/yuva/embedded/CH341SER_LINUX  
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-28-generic'
  CC [M]  /home/yuva/embedded/CH341SER_LINUX/ch34x.o
/home/yuva/embedded/CH341SER_LINUX/ch34x.c: In function ‘wait_modem_info’:
/home/yuva/embedded/CH341SER_LINUX/ch34x.c:756:3: error: implicit declaration of function ‘interruptible_sleep_on’ [-Werror=implicit-function-declaration]
   interruptible_sleep_on( &priv->delta_msr_wait );
   ^
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target '/home/yuva/embedded/CH341SER_LINUX/ch34x.o' failed
make[2]: *** [/home/yuva/embedded/CH341SER_LINUX/ch34x.o] Error 1
Makefile:1403: recipe for target '_module_/home/yuva/embedded/CH341SER_LINUX' failed
make[1]: *** [_module_/home/yuva/embedded/CH341SER_LINUX] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-28-generic'
Makefile:5: recipe for target 'default' failed
make: *** [default] Error 2

If you have received this error then clone the repo and execute make make load

trinhduc commented 7 years ago

Awesome ! But after clone of me did fix the error on the make command, but when I make make load command, then

modprobe usbserial
modprobe: ERROR: could not insert 'usbserial': Operation not permitted
Makefile:9: recipe for target 'load' failed
make: *** [load] Error 1

How to fix it? My first time using linux (ubuntu 16:04), looking forward to your help

skyrocknroll commented 7 years ago

@trinhduc You need to execute with sudo permissions

sudo make
sudo make load
trinhduc commented 7 years ago

I made it ! Thanks you so much.

deivi22 commented 7 years ago

What's is "clone of me"? I write: sudo make and say that:

make -C /lib/modules/4.4.0-64-generic/build M=/home/deivi/Descargas/CH341SER_LINUX make[1]: se ingresa al directorio «/usr/src/linux-headers-4.4.0-64-generic» CC [M] /home/deivi/Descargas/CH341SER_LINUX/ch34x.o /home/deivi/Descargas/CH341SER_LINUX/ch34x.c: In function ‘wait_modem_info’: /home/deivi/Descargas/CH341SER_LINUX/ch34x.c:756:3: error: implicit declaration of function ‘interruptible_sleep_on’ [-Werror=implicit-function-declaration] interruptible_sleep_on( &priv->delta_msr_wait ); ^ cc1: some warnings being treated as errors make[2]: *** [/home/deivi/Descargas/CH341SER_LINUX/ch34x.o] Error 1 make[1]: *** [_module_/home/deivi/Descargas/CH341SER_LINUX] Error 2 make[1]: se sale del directorio «/usr/src/linux-headers-4.4.0-64-generic» make: *** [default] Error 2

And then, I write: sudo make load

deivi@N150:~/Descargas/CH341SER_LINUX$ sudo make load modprobe usbserial insmod ch34x.ko insmod: ERROR: could not load module ch34x.ko: No such file or directory make: *** [load] Error 1

What am I making wrong?

Thanks!

skyrocknroll commented 7 years ago

@deivi22 install linux headers package for your system http://askubuntu.com/questions/75709/how-do-i-install-kernel-header-files

deivi22 commented 7 years ago

My kernel is up to date, it is linux-headers-4.4.0-64-generic, and the driver supports versions of linux kernel range from 2.6.25 to 3.13.x... I have installed older version (3.13.0.24-generic) but it doesn't work... is it recommended uninstall the last version? Thank you so much!

mondaini commented 7 years ago

I've managed to compile after downloading the latest version. But when I tried to run sudo make load, I got the following message:

$ sudo make load
modprobe usbserial
insmod ch34x.ko
insmod: ERROR: could not insert module ch34x.ko: Required key not available
Makefile:9: recipe for target 'load' failed
make: *** [load] Error 1
juanengml commented 6 years ago

when i Solve this ? make -C /lib/modules/3.13.0-24-generic/build M=/home/leaozinho/Downloads/DriveESP/CH341SER_LINUX
make[1]: Entrando no diretório /usr/src/linux-headers-3.13.0-24-generic' Building modules, stage 2. MODPOST 1 modules make[1]: Saindo do diretório/usr/src/linux-headers-3.13.0-24-generic'

juanengml commented 6 years ago

i try

➜ CH341SER_LINUX sudo make load modprobe usbserial modprobe: ERROR: could not insert 'usbserial': Unknown symbol in module, or unknown parameter (see dmesg) make: ** [load] Erro 1 ➜ CH341SER_LINUX

bug-i commented 6 years ago

I have a similar problem, did someone manage to get CH341SER running with the current raspbian? I get this error: insmod: ERROR: could not insert module ch34x.ko: Invalid module format

DanielArnett commented 5 years ago

I was getting

insmod: ERROR: could not insert module ch34x.ko: Device or resource busy

and just rebooted Ubuntu and it worked.

IvanMejico commented 5 years ago

I was getting

insmod: ERROR: could not insert module ch34x.ko: Device or resource busy

and just rebooted Ubuntu and it worked.

Funny. I am getting the same thing and try rebooting Ubuntu but it still doesn't work for me. Help, please.

abhiabhi2306 commented 3 years ago

insmod: ERROR: could not insert module ch34x.ko: Operation not permitted.

I'm running it as root user, and all the files in the folder has 744 permission.

Any solutions to this error?

csrpr commented 1 month ago

Hi @skyrocknroll

make load modprobe usbserial insmod ch34x.ko insmod: ERROR: could not load module ch34x.ko: No such file or directory make: *** [Makefile:10: load] Error 1

I also facing the same issue. help out for this.

baazaouikhalil commented 3 weeks ago

Check Secure Boot: If your system uses UEFI with Secure Boot enabled, the kernel will only load modules signed with a trusted key. You can either disable Secure Boot or sign the module with your own key.

To disable Secure Boot:

1- Restart your computer and enter the BIOS/UEFI settings (usually by pressing a key like F2, F10, Del, or Esc during boot). 2- Find the Secure Boot option and disable it. 3- Save the changes and reboot.

Sign the Module: If you prefer to keep Secure Boot enabled, you need to sign the kernel module with a key that the system trusts. please find the details here: https://ubuntu.com/blog/how-to-sign-things-for-secure-boot then: sudo mokutil --import MOK.der sudo reboot follow the prompts to enroll the key in the MOK manager: MOK, Continue, Yes then type the configured password.

Sign the module: sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 MOK.priv MOK.der ch34x.ko

Load the module: sudo make load or sudo insmod ch34x.ko

To check on the modules: sudo dmesg | grep ch34x