PCAN on Android
Re: PCAN on Android
Hi,
well, we don´t have such a phone here, so we can´t help you with your problem. When you are located in Germany, you can contact us by phone, this will be much easier to find a solution than posting messages in that thread...again and again
regards
Michael
well, we don´t have such a phone here, so we can´t help you with your problem. When you are located in Germany, you can contact us by phone, this will be much easier to find a solution than posting messages in that thread...again and again
regards
Michael
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN on Android
Hi,
In order to help you in fixing your problem, I need first to be sure of the several steps you did and their sequence, please. For example, in your screenshot, you do an "echo blahbla > /dev/pcanusb0" which will create a TEXT file named "pcanusb0" under "/dev", if there was not any file with this name before... This (could) explain why your next "mknod" commands don't work...
So, please, do the followings and give us the ouput of each command please:
1 - remove the driver from the memory:
2 - remove any existing "pcanxxx" files from "/dev" and check they have been really destroyed:
3 - check your Kernel current configuration for hotplug support. You should find a way to get your kernel configuration, either using /proc/config.gz (if option was set) or in a file like /boot/config.xxx, like under Ubuntu systems. For example:
4 - load the driver again:
5 - give us the ouput of this command please:
6 - give us the ouput of this command please:
Thanks and regards,
Stéphane
In order to help you in fixing your problem, I need first to be sure of the several steps you did and their sequence, please. For example, in your screenshot, you do an "echo blahbla > /dev/pcanusb0" which will create a TEXT file named "pcanusb0" under "/dev", if there was not any file with this name before... This (could) explain why your next "mknod" commands don't work...
So, please, do the followings and give us the ouput of each command please:
1 - remove the driver from the memory:
Code: Select all
$ rmmod pcan
Code: Select all
$ rm -f /dev/pcan*
$ ls -l /dev/pcan*
Code: Select all
$ uname -r
$ grep -e HOTPLUG -e DEVTMPFS /boot/config-`uname -r`
Code: Select all
$ insmod pcan.ko
Code: Select all
$ dmesg | grep -e pcan -e usb
Code: Select all
$ ls -l /dev/pcan*
Stéphane
— Stéphane
Re: PCAN on Android
Hi,
here the outputs:
rmmod pcan ->worked
rm -f /dev/pcan* ->worked
ls -l /dev/pcan* ->worked
output:
/dev/pcan*: No such file or directory
/proc/config.gz ->failed
output:
sh: /proc/config.gz:can't execute: Permission denied
uname -r ->worked
output:
3.1.10-CM
(in /proc/version: Linux versin 3.1.10-CM (ivan@ubuntu) (gcc version 4.7 (GCC) ) #786 SMP PREEMPT Thu Jul 10 21:50:40 CEST 2014)
grep -e HOTPLUG -e DEVTMPFS /boot/config-'uname -r' ->failed
output:
grep: /boot/config- uname -r: No such file or directory
(well there isnt even a boot folder, and the /config folder is empty too.)
insmod pcan.ko ->worked
dmesg |grep -e pcan -e usb ->worked
output:
(image http://imgur.com/ujgSMZT)

ls -l /dev/pcan* ->worked
output:
crw---- root root 180, 32 2014-08-11 15:06 pcanusb0
well i tried even to remount my /system folder with rw permission but didnt took any effect on the outcome
(mount -o remount,rw /system)
If u guys like i can phone u again or visit ur company to show u my setup. Maybe i missed smthing essential.
Seems to me like an annoying task to do over the forum.
Greetings,
ray
here the outputs:
rmmod pcan ->worked
rm -f /dev/pcan* ->worked
ls -l /dev/pcan* ->worked
output:
/dev/pcan*: No such file or directory
/proc/config.gz ->failed
output:
sh: /proc/config.gz:can't execute: Permission denied
uname -r ->worked
output:
3.1.10-CM
(in /proc/version: Linux versin 3.1.10-CM (ivan@ubuntu) (gcc version 4.7 (GCC) ) #786 SMP PREEMPT Thu Jul 10 21:50:40 CEST 2014)
grep -e HOTPLUG -e DEVTMPFS /boot/config-'uname -r' ->failed
output:
grep: /boot/config- uname -r: No such file or directory
(well there isnt even a boot folder, and the /config folder is empty too.)
insmod pcan.ko ->worked
dmesg |grep -e pcan -e usb ->worked
output:
(image http://imgur.com/ujgSMZT)
ls -l /dev/pcan* ->worked
output:
crw---- root root 180, 32 2014-08-11 15:06 pcanusb0
well i tried even to remount my /system folder with rw permission but didnt took any effect on the outcome

(mount -o remount,rw /system)
If u guys like i can phone u again or visit ur company to show u my setup. Maybe i missed smthing essential.
Seems to me like an annoying task to do over the forum.
Greetings,
ray
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN on Android
Hi,
To go on with fixing your issue, I would have liked to get your entire config of your kernel first.
Since you made a few mistakes in the commands you typed, it's really important that you do exactly what I request. Moreover, use text files instead of screenshots please and upload them through the below "Upload attachment" tab ...
1 - Please give us the text file "config.txt" created with:
If what you wrote is correct, the pcanusb0 dev node is automatically created by a running udev system, which ISNOT the case in the TFT201 environment described in the document that explains how to cross-compile for Android. Once again, I only imagine this, and having your Kernel config could confirm it.
Anyway, because udev seems running on your system, the "mknod" commands obviously fail (the pcansub0 /dev node already exists). The only difference is the access rights used to create that node: your udev default rights sets rw for root only. So you MUST be root (be sure to run "su" before) to read/write on that node.
Finally, according to http://i.imgur.com/pwcDP8J.png, especially the below commands sequence:
1 - be sure to be root:
(you should get soemthing like "uid=0(root) gid=0(root)")
2 - display the current pcan config to check if default bitrate (btr column) shows "0x001c" as default BTR value:
3 - to verify if your device node is ok, start changing the bitrate of the CAN interface, with the following command:
4 - check if the command worked by reading the pcan config again:
(the btr column should have changed with the 0x0014 value now)
Regards,
Stéphane
To go on with fixing your issue, I would have liked to get your entire config of your kernel first.
Since you made a few mistakes in the commands you typed, it's really important that you do exactly what I request. Moreover, use text files instead of screenshots please and upload them through the below "Upload attachment" tab ...
1 - Please give us the text file "config.txt" created with:
Code: Select all
$ zcat /proc/config.gz > config.txt
Anyway, because udev seems running on your system, the "mknod" commands obviously fail (the pcansub0 /dev node already exists). The only difference is the access rights used to create that node: your udev default rights sets rw for root only. So you MUST be root (be sure to run "su" before) to read/write on that node.
Finally, according to http://i.imgur.com/pwcDP8J.png, especially the below commands sequence:
Code: Select all
$ rm /dev/pcanusb0
$ echo "i 0x1c 0x03" > /dev/pcanusb0
- deletes the existing (and correct) device node created by udev
- creates a text file named "pcanusb0" under "/dev", which contains "i 0x1c 0x03", which obviously removes any further acces to the kernel device created by pcan.
1 - be sure to be root:
Code: Select all
$ id
2 - display the current pcan config to check if default bitrate (btr column) shows "0x001c" as default BTR value:
Code: Select all
$ cat /proc/pcan
Code: Select all
$ echo "i 0x14 0x00" > /dev/pcanusb0
Code: Select all
$ cat /proc/pcan
Regards,
Stéphane
— Stéphane
Re: PCAN on Android
Hi,
and thankyou for ur help again!
i did everything in ur pre post again exept the config thing (i used the new command and it worked)
id gives back: uid=0(root) gid=0(root) context=u:r:init_shell:s0
(i guess i'm root)
but changing bitrate didnt work sadly.
i researched a bit and somehow my android kernel runs in read only mode or something like that because previous i couldn't use "adb push" to put files on my phone.
i fixed it with the command
so maybe this solved some issues, but i dont know.
i also tried after removing the old one:
and it worked but also in this one changing bitrate didnt worked 
i hope i provided all the information to ur delight.
sincerely,
ray
and thankyou for ur help again!
i did everything in ur pre post again exept the config thing (i used the new command and it worked)
id gives back: uid=0(root) gid=0(root) context=u:r:init_shell:s0
(i guess i'm root)
but changing bitrate didnt work sadly.
i researched a bit and somehow my android kernel runs in read only mode or something like that because previous i couldn't use "adb push" to put files on my phone.
i fixed it with the command
Code: Select all
mount -o rw,remount rootfs/
i also tried after removing the old one:
Code: Select all
mknod -m 0777 dev/pcanusb0 c 180 32

i hope i provided all the information to ur delight.
sincerely,
ray
- Attachments
-
- sdcard1.zip
- the txt files
- (21.91 KiB) Downloaded 796 times
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN on Android
Hi,
Please tell me also what exactly are the reasons (messages, errno etc...) that are displayed when you say "it doesn't work". This could - really - help in fixing the issue.
To get more infos, you could also build the pcan driver in Debug mode: edit the "peak-linux-driver-x.y/driver/Makefile" and change
into
Save then exit, then clean and rebuild the driver:
On your Android phone, unload the old driver, unplug the PCAN-USB, load the new driver, plug the PCAN-USB and redo the "echo i" command, then give me the pcan.txt file built from this command please:
Regards,
Stéphane
is missing the heading "/" before "dev/pcanusb0" ... Check if you didn't forget it when you entered your command.mknod -m 0777 dev/pcanusb0 c 180 32
Please tell me also what exactly are the reasons (messages, errno etc...) that are displayed when you say "it doesn't work". This could - really - help in fixing the issue.
To get more infos, you could also build the pcan driver in Debug mode: edit the "peak-linux-driver-x.y/driver/Makefile" and change
Code: Select all
DBG = NO_DEBUG
Code: Select all
DBG = DEBUG
Code: Select all
$ cd peak-linux-driver-x.y/driver
$ make clean
$ make
Code: Select all
$ dmesg | grep -e pcan -e usb > pcan.txt
Stéphane
— Stéphane
Re: PCAN on Android
Sorry for being sloppy. i wrote the initial "/" but out of curiosity i tried it now without the initial "/" and it worked also in the mknod command.
Well, the error messages are always the same:
i did the debug thing and i got an error. i did the suggested make oldconfig && make prepare but at the second driver compile it threw the error again. i guess i have to read more about kernel compiling to understnd the next step.
but never the less it made everytime a new pcan.ko. normally if a make doesnt succeed it stops compiling... strange.
i didn't put it on the phone becaus of the error i got. but if the .ko is ok tell me and i go on as u suggested.
i added all 3 outputs in .txt files
sincerely,
ray
Well, the error messages are always the same:
Code: Select all
sh:
echo "i 0x14 0x00" > /dev/pcanusb0
can't create /dev/pcanusb0: No such device
Code: Select all
chown 0777 /dev/pcanusb0
Unable to open /dev/pcanusb0: No such device
but never the less it made everytime a new pcan.ko. normally if a make doesnt succeed it stops compiling... strange.
i didn't put it on the phone becaus of the error i got. but if the .ko is ok tell me and i go on as u suggested.
i added all 3 outputs in .txt files
sincerely,
ray
- Attachments
-
- output.tar.gz
- (2.27 KiB) Downloaded 989 times
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN on Android
Hi,
1 - why do you want to rebuild your kernel ?
2 - I don't know your cross-compilation environment but:
will build a kernel for YOUR host ! Not for the phone !
Generally speaking, cross-compiling a kernel needs the ARCH option on "make" command-line, something like that:
3 - because you failed to build your kernel, its config is broken. Thus, building the "pcan" driver is no more possible.
Regards,
Stéphane
1 - why do you want to rebuild your kernel ?
2 - I don't know your cross-compilation environment but:
Code: Select all
$ make oldconfig && make prepare
Generally speaking, cross-compiling a kernel needs the ARCH option on "make" command-line, something like that:
Code: Select all
$ make ARCH=arm oldconfig && make ARCH=arm prepare
Regards,
Stéphane
— Stéphane
Re: PCAN on Android
Hi,
i use
should be the same as typing it with the make command, or not?
I will try it with again hopefully it solves problems.
greetings,
ray
i use
Code: Select all
export ARCH=arm
export CROSS_COMPILE=/path/to/android/gcc
I will try it with again hopefully it solves problems.
greetings,
ray
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN on Android
Hi,
If you export ARCH, so it's ok. If the version file is not found by pcan's Makefile, it's certainly because the kernel should be built.
First try to rebuild (make) your kernel.
Regards,
Stéphane
If you export ARCH, so it's ok. If the version file is not found by pcan's Makefile, it's certainly because the kernel should be built.
First try to rebuild (make) your kernel.
Regards,
Stéphane
— Stéphane