How to install linux usbserial kernel driver manually? - kernel-module

I have a ubuntu 16.04 LTS with kernel 4.4.0-148-generic host machine. I don't have serial dictionary in
/lib/modules/4.4.0-148-generic/kernel/drivers/usb
So i need to install it manually, but i can't find the source code and build document.
Thanks for your time and hope you can help me out! :)

I have same problem taht /dev/ttyUSB0 is not found after I upgrade the kernel source.
You can use the below command to install USBSerial driver and then /dev/ttyUSB0 will come up again.
$ sudo apt install linux-modules-extra-$(uname -r)
Hope to fix your problem.

OK, seems this module is in the kernel source :)

Related

Bluetooth C compiling

I am reposting this again in case missed out.
i have installed
sudo apt-get install libbluetooth-dev
and tried to compile btgatt-client.c from Blue5.54/tools/ with
gcc -o btgatt-client btgatt-client.c -lbluetooth
but get '#include "lib/bluetooth.h":no such file or directory'
What could be missing.I have tried move the files from '/usr/include/bluetooth'
the compilation folder but seems doesn't work. I am also curious where does this "src/shared/mainloop" from?
I am able to run the example and connect to nrf app but unable to compile the .c file.
The source files in BlueZ are not designed to be compiled singularly. Instead, you are supposed to build and install the entire BlueZ source, which in turn will compile btgatt-client.c for you. Please see the link below for instructions on how to build the entire BlueZ source:-
How to rebuild bluez
You will probably find that you need to install a lot of dependencies along the way, but you can either install these using sudo apt-get install <dependency> or try and not include it in the build. For example, to build BlueZ without systemd, you can do the following:-
./configure --disable-systemd
make
I hope this helps.
#Youssif Saeed. Thanks for the replies.
The good news is i have found out the cause.It seems the BlueZ bluetooth stack has an issue running in Raspbian Buster. I have downgrade the OS to Stretch and all seems up and running.
However i am trying gatt-client example and seems like not working when i set nrf app to advertising mode with exact UUID as in example. Or maybe i missed out certain part.Going to give a try with a simpler device like ESP32.
UPDATED
Thanks again guys.DBus gatt-client able to connect to BLMCU's. They key of operation is it needs to be paired > connected and read the BLE Server

How to install cjson properly in Ubuntu 14.0LTS?

I am new in json and I don't know how to use but I found compare to XML json is better so, I am learning json in C programming in Ubuntu 14.0LTS.
I followed https://linuxprograms.wordpress.com/2010/05/20/install-json-c-in-linux/.
In this link, I installed libjson0 with the help of first command but when I installed libjson – debug symbols package with the help of second command which is mentioned in link then showing "E: Unable to locate package libjson0-dbg".
Also I gone through https://github.com/json-c/json-c. After cloning moved to json-c directory, in json-c directory I did sh autogen.sh then showing "autogen.sh: 2: autogen.sh: autoreconf: not found".
Why autoreconf is not works ? When I installed CppUTest and other stuffs then it works.
I also install build-essential which found in google for above problems but it can't works for me.
How can I installed cjson in a proper manner and how to use with the C-programms.
Try below commands:
$ sudo apt-get install libjson-glib-1.0-0 libjson-glib-1.0-0-dev
If you want to debug your programs and see the various steps of serializing/deserializing you can also install the libjson-glib – debug symbols package
$ sudo apt-get install libjson-glib-1.0-0-dbg
For documentation related to json-glib, you must install the following package
$ sudo apt-get install libjson-glib-1.0-0-doc
This documentation will then be available in file:///usr/share/gtk-doc/html/json-glib/index.html
Maybe your problem is related with the path.
The library is installed correctlly but you have tot tell the system where. Here a post on how to do it in Ubuntu How to set the environmental variable LD_LIBRARY_PATH in linux

Cross compile for arm in scientific linux

I am running yum install
gcc-arm-linux-gnueabi
on my machine, but it says:
No package gcc-arm-linux-gnueabi available.
Please help me to set up cross compilation tool for arm in scientfic linux.
As I am naive in this, please tell me step by step process.
try sudo yum install gcc-arm* to see and if any of your interested package is in the list ... try downloading it ...
if it does not help try sudo yum install arm*linux* or similar searches to narrow down to the package you require
The equivalent package on fedora derivatives (rhel, centos, etc) is arm-linux-gnu-gcc. It is in the gcc-arm-linux-gnu package:
yum install gcc-arm-linux-gnu gcc-c++-arm-linux-gnu

How to set up libusb on Mac OS X?

I'd like to try to make a user-space device driver using libusb on Mac, but I'm confused where to start. In the SDK installer (which I got from http://www.ellert.se/twain-sane) it said something about examples which I couldn't find anywhere on my computer.
Could anyone please describe how do I set up libusb for development on OS X? May I use Xcode? What should I include in my code?
brew install libusb-compat
Working on OSX Yosemite 10.10
Easiest way to do this:
brew install libusb
Homebrew is amazing and I recommend it for all developers that use Mac.
I tried to install the SDK from the aforementioned website and couldn't find a trace of it once the installer finished. Though I did find some libusb items at /usr/local/Developer/SDKs/MacOSX10.6.sdk/usr/local/ I'm not sure it came from that installer as I couldn't find any examples, just libraries and they were labeled as libusb0.1.4.
On the other hand, since you asked your question with the macports tag, I'd suggest you use that to install libusb as it at least puts everything in a known location:
/opt/local/var/macports/software for install files
/opt/local/lib for libraries
/opt/local/include for header files
If you've never used macports then once you have macports installed then you can install libusb using
sudo port install libusb
to install libusb1.0 or
sudo port install libusb-legacy
to install libusb0.1.12.
Then you can create a project in Xcode and link to the libusb-*.a library contained in /opt/local/lib (in my directory my library file is called libusb-1.0.a since I have libusb1.0 installed).
I don't have much experience using Xcode so I can't help you any further down this path. Personally what I've done so far is use a Python wrapper called pyusb to do some quick experimentation with libusb as I don't have to do IDE setup or library/include file setup with Python.
UPDATE: Poking around the macports install directory for libusb, I didn't find any examples included which was a bummer. If you've gotten this far then I'd suggest going directly to the source for libusb, download and unpack the tar file, and building the code that's in the example directory. Sorry for the roundabout way of getting libusb examples but I've really come to appreciate the organization macports imposes on installations which saves me quite a bit of future pain (like when I want to uninstall).
once libusb is installed using following command:
brew install libusb
or
brew install libusb-compat
link libusb to the build system using
brew link libusb
to be able to configure any project depending on libusb, use pkg-config:
pkg-config --cflags libusb-1.0
and
pkg-config --libs libusb-1.0
before calling any ./configure

compiling xdebug on linux -> passing 32 bit option to ./configure

Greetings!
When trying to compile xdebug, is there a way to pass it a 32-bit option?
What I have right now is this:
./configure --with-php-config=/opt/lampp/bin/php-config
... or is there a better way to obtain a 32-bit bin of xdebug?
Thaks
Old question, but had the same issue and I didn't want to install a 32 bit Linux distribution just for this.
This is what I did:
sudo aptitude install g++-multilib
CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure --with-php-config=/opt/lampp/bin/php-config
sudo cp modules/xdebug.so /opt/lampp/lib/php/extensions/
Source: http://montenasoft.com/en/blog/how-install-pecl-php-extension-64bit-linux-while-you-are-using-32bit-xampp
... never mind. Installed Vector Linux Light on VirtualBox, installed xampp with dev package on that and compiled xdebug against that. Then transfered xdebug.so into the proper xampp install and it worked like a charm.

Resources