updating product/vendor id on Raspberry Pi (CP210X) - linux

Running "uname -a" on my Raspberry Pi will yield the following:
Linux tm-gw 4.4.14-v7+ #896 SMP Sat Jul 2 15:09:43 BST 2016 armv7l GNU/Linux
My problem is that I have a USB device which vendor and product ID isn't registered in CP210x.c file, which - again - means that even though it can be found, the raspberry will not allow communication with it (/dev/ttyUSB0 doesn't exist).
I have tried to download the kernel, add the ID pair to the cp210x.c file, rebuild and install, which works. (dmesg will show "usb 1-1.4: cp210x converter now attached to ttyUSB0")
Since I have to install this program on more than one raspberry it takes too long, so I'd like to know if it is possible to inject the usb ID's without recompiling the kernel ??
I did try to take the cp210x.ko file from the kernel I build and install it to a new raspberry by typing "sudo insmod cp210x.ko" but that didn' work.
/Karsten

Thanks to Ian Abbott for the solution.
Run "sudo modprobe cp210x"
then
sudo sh -c 'echo 10c4 84cc > /sys/bus/usb-serial/drivers/cp210x/new_id'
When plugging in the device it works :-)

Related

bcm43xx_init Initialization timed out with buildroot raspberry pi 3 hciattach

I am trying to get the Bluetooth to work in Raspberry Pi 3.
I am using buildroot with:
BlueZ 5.45 ( changed the package to get the latest)
Not using systemd, but I run bluetoothd because
the bluez script is for systemd.
In buildroot I enabled the bt firmware.
I can see the hci_uart.ko file and the Bluetooth firmware hcd file
I removed the console=ttyAMA0,115200 from cmdline.txt
I added rfkill for busybox but I only see the wifi interface, no Bluetooth interface.
running:
hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
output showed:
bcm43xx_init
Initialization timed out
tried 115200, the same.
Notes:
When using BlueZ 3 I am getting invalid id
I read that it is somehow related to BlueZ version so I did take the latest
All the above was taken after deep search.
So what I am missing here?
How can I get the Bluetooth to start running in my Raspberry Pi 3
with buildroot as image creator?
Thank you all!
The main problem is that buildroot adds the pi3-miniuart-bt overlay
in config.txt.
To remove it we need to remove if from the post-image.sh script as parameter to the above script.
In raspberry pi 3 the ttyAMA0 was assigned to bluetooth and the pi3-miniuart-bt restored it back to be serial com port, which disconnects the bluetooth again.
To summarize the steps in buildroot.
Add the bluetooth firmware.
Add bluez 5 utils.
Change the package from bluez 5.44 to 5.45
Add the above sleep. (delete the .stamp_build in bluez to build it again)
remove the /dev/ttyAMA0 from cmdline.txt
After building, check on the target (pi3)
the BCM4343 hcd firmware
hci_uart.ko should be there
hci_uart is not running in case of busybox init (only in systemd)
so just modprobe hci_uart. run lsmod to see that it is running.
To start the service and load the firmware, use hciattach:
hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
Start the bluetoothd daemon:
/usr/libexec/bluetooth/bluetoothd &
Power up the bluetooth hardware using bluetoothctl (power on and agent on).
Now you should see it using hcitool dev.
Again, if you don't remove the overlay you will get timeout.
That it. the hci device should be seen now.
you can see it using:
rfkill list ( install it from busybox-menuconfig)
hciconfig -a
The above steps does not get the console to work properly on the Pi 3 but this is a different story.
As described in the commit adding the firmware, you unfortunately need to patch bluez5_utils to get the firmware to work:
https://git.buildroot.net/buildroot/commit/?id=1f94f1aaab2e786542a83327358570a828d68f45

Raspberry Pi and RetroPie distro plus LCD

I downloaded RetroPie for my RaspberryPi 3 from this link and have been trying to get my 3.5" LCD to work. I downloaded the driver from here as described, but whenever I try and extract it with the "tar xzvf LCD_show_v6_1_3.tar.gz", the file for the Osoyoo LCD I have, around 50 lines are executed and then the Pi crashes. When I restart it, it goes into a kernel panic every time. I've reinstalled my OS multiple times. I cannot download the raspbian distro with the driver because I have been unable to install RetroPie on top of it and have been unable to display it on the LCD.
Install instructions and product:
Please respond if you know how to solve this problem or what you recommend.
Turns out I was not using enough power. The usb cable I used was a spare rather than official cable for the Pi. Not enough voltage to complete the tasks.

HID Smart Card Reader Linux Raspberry Pi

I am using raspberry Pi . I have installed libusb then PSCD lite after that i have installed drivers for HID Smart Card Reader 5021 CL i am getting this error. Any idea i think that error is due to the reason of some permissions as i am using the user pi and owners of these directory is root . I am new to linux and the directory and file is there on the path shown below
pi#raspberrypi ~/pcsc-tools $ sudo pcscd -f
00000000 dyn_unix.c:60:DYN_LoadLibrary() /usr/local/lib/pcsc/drivers/ifdokccid_linux_i686-v4.1.8.bundle/Contents/Linux/ifdokccid.so: /usr/local/lib/pcsc/drivers/ifdokccid_linux_i686-v4.1.8.bundle/Contents/Linux/ifdokccid.so: cannot open shared object file: No such file or directory
00001913 readerfactory.c:1019:RFInitializeReader() RFLoadReader failed: 0x80100014
00000172 readerfactory.c:335:RFAddReader() OMNIKEY CardMan (076B:5340) 5021 CL (OKCM0030812141011235703916649119) init failed.
Your drivers are for PC (architecture i686) you need drivers for ARM (probably armhf architecture).
AFAIK drivers for ARM are not available from HID.

Can I copy the pi1b system to pi2b?

I have a Raspberry Pi 1b, AMD recently bought a Pi2b. So I wonder if I can use image tools to copy pi1system to pi2? I may copy pi1's SD card to a .img file, then use the file to create the data of pi2's micro SD card.
I knew that the CPU of both Pis are different. So is that available? Did someone tried?
If so, will there be some hidden bugs inside the system which we can't find immediately but affect the system work properly?
Any suggestion will be appreciated!
Short Answer
Yes you can, make sure your OS has an ARMv7 kernel.
Long Answer
Some quotes from the official Raspberry Pi blog:
Broadcom were willing to step up with a new SoC, BCM2836. This retains all the features of BCM2835, but replaces the single 700MHz ARM11 with a 900MHz quad-core ARM Cortex-A7 complex: everything else remains the same, so there is no painful transition or reduction in stability.
Note: ARMv7 is backwards compatible with ARMv6, the quote below proves it.
At launch, we are using the same ARMv6 Raspbian userland on both Raspberry Pi 1 and 2
There could be some hidden issues
It won't be caused by upgrading from Pi 1 model B to Pi 2 model B. It will be caused from copying the image. If you or your system hardcoded your network interface's MAC address it could potentially cause a problem. I know it's not the best example, but sometime people don't think and hardcode things that can change. It all depends on your OS.
Short how-to for installing the new kernel on raspbian
It's good idea to backup your SD card before making these changes, if something goes wrong it could prevent your Pi from booting.
To backup your SD card on Linux/OS X you can use (remember to select the correct device (sda/sdb/sdc):
sudo dd bs=4M if=/dev/sdX of=raspbian.img
To install ARMv7 kernel:
sudo apt-get update
sudo apt-get install linux-image-rpi2-rpfv
sudo apt-get install linux-headers-rpi2-rpfv
Check /boot to make sure you've got kernel7.img:
ls -lsa /boot
Result of ls:
3861 -rwxr-xr-x 1 root root 3953492 Feb 24 20:55 kernel.img
3818 -rwxr-xr-x 1 root root 3908696 Feb 24 20:55 kernel7.img
If that does not work you can try forcing the kernel name by modifying your /boot/config.txt see http://elinux.org/RPiconfig#Boot for more options.
Other Issues
Kernel modules like wifi drivers or streaming cam in this case can also cause problems on your new ARMv7 kernel if it is not supported by default see http://l0l.org.uk/2015/02/headaches-whilst-upgrading-to-raspberry-pi-2/

Can`t find ttyUSB[id]

I have just started with my Raspberry Pi and I have a project where I want to read data from the USB port. I have installed Java JDK8 and written the program that compiles and run. But I get the message that /dev/ttyUSB1 does not exist.
I just have a cable from the USB port on the Arduino going to the USB port on the RPi and I am using Raspbian Debian Wheezy
When I go to DIR /dev/ and use $ ls, I can only find tty0 up to tty63. I have searched on the internet and some say that you can use ttyAMA0, but this does not work. I have also searched for the same problem, but have not found a answer to my problem.
I have used $ lsusb which gave me 4 devices (001-004) on Bus 001. I can see that, for example, my USB keyboard is listed as Bus 001 Device 004: ID 1532:010b Razer USA, Ltd.
and if I run $ dmesg | grep Manufacturer I get that:
[xxxxxxxxx] usb 1-1.2: Manufacturer: Razer
So my question is why does my usb devices not get listed as ttyUSB[id]? Do I have to manually attach it?
I am a bit noob when it comes to Linux.
Hope someone can help me!
I have some bad news for you. The reason you have no /dev/ttyUSB[n] devices on the RPi (when you connect your Arduino) is because you need the Arduino drivers (FTDI drivers in particular). The unfortunate thing is that these drivers don't yet exist for the Arm platform (which includes the RPi). This is according to the FTDI web page showing support. Note the lack of Linux driver support for Arm.
Apparently on Arm running Linux the only way to program the Arduino is via the serial port interface directly via the GPIO pins. Information on doing this can be found here . You will also have to do something similar on the Arduino side see this information.
Once you have the two devices connected via straight serial then your going to probably run into another SNAFU. By default apparently on the RPi Linux will use the serial port for sending debug/console output. In order to use the serial interface for something that behavior has to be modified. This article discusses that. In particular disabling the kernel from using the serial port for terminal use this would seem to apply:
The following steps (based on a clean 2012-07-15-wheezy-raspbian install
Open a terminal on the Raspberry, or connect to Raspberry Pi through SSH.
Make a backup of the /boot/cmdline.txt file.
sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
Edit /boot/cmdline.txt file:
sudo vi /boot/cmdline.txt
This file contains:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 $
Remove the parameters that reference the UART serial port (ttyAMA0):
dwc_otg.lpm_enable=0 console=tty1 $
Comment next line in /etc/inittab:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Reboot Raspberry Pi
sudo reboot
If you use a different Linux distro than Debian it would be different but the basics would still apply (modifying the kernel command line)

Resources