[Q] Second Camera? - G Tablet Q&A, Help & Troubleshooting

Good day...
Im wanting to connect a USB camera to my ViewSonic G Tablet... I have 3 different USB models. When I plug them in (individually,) I get the /dev/video0 device but I don't seem to be able to use the device...
Why a second camera? I'm thinking I can use my G Tab in my car with a USB camera connected for a Baby Cam (since the baby faces the other way so I can't see and most of my traveling is at night so the normal mirror won't work unless I blind the poor child...) -- In theory, it could be used as a backup camera as well. (Same effect)
The internal camera works, but I don't need to see myself, I'd rather see something behind me.
Ideas?

I've scoured the Forums in more detail... Several ask the questions and someone made it work on the Nook, but it looked Nook specific. =/
Is there a more appropriate place to ask? This would affect all Android Devices that have a USB Host Port...
Now, the G Tablet, VEGAn mod at least... has the UVC Driver for WebCams. When I plug a camera in I get the /dev/video0 device (which doesn't exist until I plug in a camera.) - could it be permissions or is the driver not fully implemented?
The mplayer app that was released sets the root path to /sdcard so I can't point it at /dev/video0... I've tried to use the stream part, but it just exits the video - no error that I can see...

adamsoutherland said:
Now, the G Tablet, VEGAn mod at least... has the UVC Driver for WebCams. When I plug a camera in I get the /dev/video0 device (which doesn't exist until I plug in a camera.) - could it be permissions or is the driver not fully implemented?
Click to expand...
Click to collapse
The device appearing is a good first sign. Can you get me a dmesg output after you've plugged the webcam in? Run a Terminal Emulator app, then type in the window:
Code:
$ [B]dmesg > /mnt/sdcard/dmesg.txt[/B]
The mplayer app that was released sets the root path to /sdcard so I can't point it at /dev/video0... I've tried to use the stream part, but it just exits the video - no error that I can see...
Click to expand...
Click to collapse
Is this app an Android port of the standard mplayer for Linux? If yes, then it will use the V4L (Video 4 Linux) API to grab video frames, and if you can start it on the command line (or supply an input file name), then you can try "tv://" as the input file name.
Run this command first, though, to give everybody read-write access to /dev/video0:
Code:
$ [B]su[/B]
# [B]chmod 666 /dev/video0[/B]

I'm attaching a dmesg prior to plugging in the camera, and one after... I'm also inserting the text of the "diff" in the post...
Code:
[ 189.574313] usb 1-1.1: new high speed USB device using tegra-ehci and address 3
[ 189.657223] usb 1-1.1: New USB device found, idVendor=18ec, idProduct=3299
[ 189.664506] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 189.671944] usb 1-1.1: Product: USB2.0 PC CAMERA
[ 189.677125] usb 1-1.1: Manufacturer: ARKMICRO
[ 189.685907] usb 1-1.1: configuration #1 chosen from 1 choice
[ 189.695760] uvcvideo: Found UVC 1.00 device USB2.0 PC CAMERA (18ec:3299)
[ 189.708989] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
[ 189.732392] input: USB2.0 PC CAMERA as /devices/platform/tegra-ehci.2/usb1/1-1/1-1.1/1-1.1:1.0/input/input7
[ 190.318832] SO340010: gpio_val=0xc0a50000, button_val = 0xdbaf0002
[ 190.445387] SO340010: gpio_val=0xc0a50000, button_val = 0xdbaf0000
and this:
Code:
/data/data/berserker.android.apps.sshdroid/home # ls -lh /dev/vid*
crw-rw---- 1 0 1006 81, 0 Sep 2 18:22 /dev/video0
I've also done this:
Code:
/data/data/berserker.android.apps.sshdroid/home # chmod 666 /dev/video0
/data/data/berserker.android.apps.sshdroid/home # cat /dev/video0 /mnt/sdcard/test.mpg
cat: read error: No such device
/data/data/berserker.android.apps.sshdroid/home # ls -lh /dev/vid*
crw-rw-rw- 1 0 1006 81, 0 Sep 2 18:22 /dev/video0
/data/data/berserker.android.apps.sshdroid/home #
The mplayer was an APK from someone on the forums... I've opened it up only to find a "mplayer.so" as I thought it might contain the mplayer binary... (I don't have a machine (with sufficient space) to load the Android SDK at the moment...) (It's on my todo list.)
Am I right to try "cat /dev/video0" before I find the proper mplayer or event ffmpeg binary? (It generally works in linux when I do it...)
PS - I have 3 WebCams, I can give you a dmesg of each one if you need it... They all appear to do the same thing (they are by different manufacturers... iMicro, Sabrent and Agama.) -- also note that these 3 web cams work in Linux (each slightly different, but they work.)

adamsoutherland said:
The mplayer was an APK from someone on the forums... I've opened it up only to find a "mplayer.so" as I thought it might contain the mplayer binary... (I don't have a machine (with sufficient space) to load the Android SDK at the moment...) (It's on my todo list.)
Click to expand...
Click to collapse
Attach the APK so I can have a look at it.
Am I right to try "cat /dev/video0" before I find the proper mplayer or event ffmpeg binary? (It generally works in linux when I do it...)
Click to expand...
Click to collapse
I'm surprised that that works even on standard Linux! You have to setup the frame capture parameters first using ioctl()s before you can start reading data from /dev/video0. Even after that, you get raw frame data, and not mpeg video from the device.
PS - I have 3 WebCams, I can give you a dmesg of each one if you need it... They all appear to do the same thing (they are by different manufacturers... iMicro, Sabrent and Agama.) -- also note that these 3 web cams work in Linux (each slightly different, but they work.)
Click to expand...
Click to collapse
Attach all the 3 webcams to your desktop machine, check that each one works and get me a dmesg and a lsmod command output for each one. I want to see what drivers are loaded for each one. We'll have to load the same drivers on the gTablet too after compiling them.
Code:
[I]Attach Camera1 and make sure its working, then,[/I]
desktop$ [B]dmesg > dmesg1.txt[/B]
desktop$ [B]lsmod > lsmod1.txt[/B]
[I]Attach Camera2 and make sure its working, then,[/I]
desktop$ [B]dmesg > dmesg2.txt[/B]
desktop$ [B]lsmod > lsmod2.txt[/B]
[I]Attach Camera3 and make sure its working, then,[/I]
desktop$ [B]dmesg > dmesg3.txt[/B]
desktop$ [B]lsmod > lsmod3.txt[/B]
Caveats: Even if we get all the drivers to load on the gTablet (the V4L drivers, the main camera driver, and, possibly, its support drivers), we still have the problem of displaying the video stream on Android. While I'm happy to write whatever systems code is required, writing the Java UI code for the Android app is beyond my ken. We'll have to ask someone else (try in the main Android development forums on XDA, or, ask user herbert1 here who's helped out before with custom Java apps) once we've checked that we can read data from the V4L device (I'll send you a test prog which'll output .jpg files once every second once we have the drivers sorted out).
It would be great if someone has already ported mplayer for Android.

I'm attaching the APK I found...
Side note:
After looking deeper at 'cat /dev/video0'; it does not work with these webcams... I think this works on my TV Cards that natively displayed mpeg2 video (it's been a while).
See the attached dmesg-*.txt and lsmod-*.txt. Each is named after the company logo on the camera. (I can get the model numbers if the dmesg isn't enough.) Between each dmesg I rebooted the linux box for clarity. (They can all work at once, but I get confused on what is doing what.)
The command I used to test:
Code:
ffmpeg -f alsa -i hw:0,0 -f video4linux2 -s 320x240 -i /dev/video0 test-agama.mpg
(Each of these cameras has audio - The audio is not important for what I am attempting to do...)
About the UI... I've been avoiding this but it maybe time to start work on this =P -- I just realized that the box I'm testing the cameras on has space... I may have to reload linux for 64bit but then I can install the Android SDK and get to UI Development.

All three webcams seem to depend on only 3 kernel modules: uvcvideo, videodev and v4l1_compat.
If all 3 drivers are loaded on the gTablet too, then we should be able to get the video frames from /dev/video0 (or whatever the device).
I'll send you a test program this evening. In the mean time...:
That .apk file contains the application too--the classes.dex file contains the Dalvik executable bytecode. Just install the .apk, then run the app and provide a file name as input. Try "tv://" as the file name once all 3 drivers have been loaded. Do the "chmod 666 /dev/video0" before running the app.

Try the webcam test program in the attachment. The program reads from a user-specified V4L device and outputs JPEG images until you stop it with CTRL-C. Run as:
Code:
$ [B]su[/B] [I]Become superuser[/I]
# [B]mkdir /mnt/sdcard/tmp[/B] [I]Make a tmp dir. for storing imgs[/I]
# [B]./webcam -o /mnt/sdcard/tmp[/B] [I]Capture webcam images until stopped with CTRL-C[/I]
Get usage instructions with "./webcam --help".
EDIT: I actually didn't test the program out because I couldn't locate my webcam. Report if you encounter any bugs.

Quick Update:
I will be trying this tonight... I've been busy trying to get things done. (Little one is going to be born tomorrow!)
Sorry I haven't been able to respond sooner...

rajeevvp said:
Try the webcam test program in the attachment. The program reads from a user-specified V4L device and outputs JPEG images until you stop it with CTRL-C. Run as:
Code:
$ [B]su[/B] [I]Become superuser[/I]
# [B]mkdir /mnt/sdcard/tmp[/B] [I]Make a tmp dir. for storing imgs[/I]
# [B]./webcam -o /mnt/sdcard/tmp[/B] [I]Capture webcam images until stopped with CTRL-C[/I]
Get usage instructions with "./webcam --help".
EDIT: I actually didn't test the program out because I couldn't locate my webcam. Report if you encounter any bugs.
Click to expand...
Click to collapse
I copied it to /mnt/asec (because I can execute things there without remount)
When I run it, i get:
Code:
/mnt/asec # ./webcam -o /mnt/asec/tmp -d /dev/video0
./webcam: error getting video channel info. Invalid argument
I tried without the -d /dev/video0 and got the same result.
(Sorry for the LOOONG delay... Turns out a newborn takes more time and energy than I expected. I'm just now figuring that out... =P It's worth it though.)

Try this simple USB Webcam test app in the attachment which works on VEGAn-Tab 7.1 and GtabComb* (which have the pershoot kernel).
1. Plug the USB webcam in.
Assuming the kernel you're running has the correct USB webcam drivers compiled in--and, most of them do seem to have the V4L subsystem and the UVC camera drivers (which supports a lot of the common USB webcams) built into the kernel--you should see a new /dev/video0 device file pop up.
2. Run these commands to set correct permissions and owners on the device file (some ROMs--eg. GtabCombOver--don't need it):
Code:
$ [B]su[/B]
# [B]chown system.camera /dev/video0[/B]
# [B]chmod 660 /dev/video0[/B]
(Note that if you unplug and replug the webcam, you'll have to re-run the commands on ROMs which don't set the correct permissions and owners.)
3. Now install and run the SimpleWebCam app.
If, for some reason, no /dev/video0 device is created, then your webcam may need different device drivers, which have not been compiled in (or not been written!), in which case you'll have to compile a new kernel with the correct drivers either built-in or as loadable modules. Nothing else described in this post will need change.

adamsoutherland said:
When I run it, i get:
Code:
/mnt/asec # ./webcam -o /mnt/asec/tmp -d /dev/video0
./webcam: error getting video channel info. Invalid argument
I tried without the -d /dev/video0 and got the same result.
Click to expand...
Click to collapse
Looks like I'll have to update the code to make the program use the V4L2 API instead.

Nexus 7
Just tested this on my Google Nexus 7 tablet and it worked fine, I didn't have to modify the permissions either,
PS, it is rooted, of sure if that makes much difference, will test it on my friends stock nexus 7 tomorrow

USB Camera App
I was able to get the app working on my rooted Nexus 7 4.2 and an unrooted Galaxy SIII . How hard would it be to add a video record function to the app?

droidoso said:
How hard would it be to add a video record function to the app?
Click to expand...
Click to collapse
If you want to do that, then it's better to compile a custom native camera-interface library which makes the USB webcam appear as a standard camera (--the rear one, usually). Then, you can use the standard apps to record videos.
See this thread for a precompiled binary and for the source.

Related

[TOOLS] [LINUX, MAC, WINDOWS] Knives & Forks - v. 12.02.04

Knives & Forks
WHAT IS IT?
Knives & Forks is a set of Android tools for everyone. Every operating system, every device.
This cross-platform Android toolkit, written in Python, that is designed to work in Linux, Mac OS X or Windows. I wanted to create something that was unique, and offered a consistent and feature-filled set of tools for Android devs no matter what operating system they use, and for as many Android devices as possible.
WHAT DOES IT DO?
I just started work on this project, so it doesn't do very much yet. Right now we are just focusing on getting drivers and adb installed for as many devices as we can on all three platforms. Once we have adb working for everyone, the real fun can begin as we start to add more device tools that will make use of adb, such as rooting. Eventually ROM customization tools will be added, but we are focusing on device tools and cross-platform compatibility at this time.
View the changelog to see a list of included drivers. The only device that I can confirm is compatible with this script in Linux, Mac OS X, and Windows is the Samsung Galaxy S II, Sprint Epic 4G Touch. This just so happens to be my personal phone, but as I gather feedback I will create an official list of supported devices.
WHERE DO I GET IT?
This project is now being hosted by the Android Creative Syndicate. An up to date link to the most current version of the script, installation instructions for Linux, Max OS , and Windows, and other information can be found HERE. Registration is not required at the ACS forum to download or view installation instructions. You are free to reply in the thread you are reading right now if you don't want to register for another forum.
I HAVE IT INSTALLED, NOW WHAT?
You should be able to open up your terminal application (or command prompt) and run some adb commands. In the future we will be automating adb commands for you, but for now you can try the following as a simple test:
Code:
adb reboot
If everything worked, your Android device should reboot. For further reading on what you can do with adb you can read THIS PAGE.
HOW TO SUPPORT THIS PROJECT
FEEDBACK
Download my script, test it, let me know what happens. Let me know what other features/tools I should add.
THANKS
Hit the thanks button if you like what I'm doing here.
DONATIONS - I don't currently have a link to send me money, but I could quickly set something up if somebody decides they want to help me feed my kid. I am recently unemployed, but I am not relying on my scripting skills to feed my family. Save your cash for a more worthy project, or tuck it away and wait until the project turns into something amazing.
INFORMATION
TELL ME ABOUT YOUR ANDROID DEVICES!
If my script isn't getting adb setup for your device, let me know where to download the correct Windows driver and/or what udev rules I need to add in Linux.
The next phase of this project will be automating the rooting process. If you know the process for rooting your device, please share the details.
HOW TO REPLY TO THIS THREAD
Please do not reply by saying something like "This looks awesome, I'm going to download it now!".
Just download it, test it out, and then tell me about it.
If my script works for you, please don't post something like "It worked for me, this is the best thing since sliced bread!".
At the moment all my script will do is install adb and drivers for your device. In order to test please uninstall any drivers you may have already installed, run my script, then reply with the following information:
Operating System (including version and 32-bit or 64-bit architecture)
Android Device
If you open up a terminal/command prompt window and enter the following command, does your device reboot? If not, do you receive any error messages (while running that command or at any phase of running the Kinves & Forks script)?
Code:
adb reboot
CHANGELOG
Code:
------------------------------------------------------------------------------------
Knives & Forks: Changelog
------------------------------------------------------------------------------------
The most current version is available for download from:
http://knivesandforks.info/releases/knives-and-forks-current.php
**** 12.02.04 ****
http://knivesandforks.info/releases/knives-and-forks-12.02.04.php
- LINUX CHANGES:
-- "python2" is now called by "Knives-and-Forks-Linux.sh" instead of "python" on Arch.
- This prevents starting the script with Python 3, which results in errors.
-- Changes to "scripts/linux/install-adb-linux.sh":
- "su" will be used if "sudo" is not installed, or user doesn't have permissions to use it.
- Added 32-bit libs for more 64-bit distros:
- Arch (new in this release)
- CentOS (new in this release)
- Debian
- Fedora (new in this release)
- Ubuntu, Kubuntu, Xubuntu
- Added Debian version of '/etc/udev/rules.d/99-android.rules'
- Added '/lib/udev/rules.d/92-permissions.rules' for Debian.
This should fix permissions, allowing adb to run without sudo or su.
- WINDOWS CHANGES:
-- Fixed a couple of missing quotes which were breaking things under Windows XP
- "%userprofile%" was coming back as "c:\documents" instead of "c:\documents and settings\username" in a couple of places
-- "c:\python27" is now the only directory where we look for python.exe
- It is faster to download and install Python to "c:\Python27" than it is to search for it elsewhere.
- This will also prevent issues where Python 3 was installed instead of Python 2, since the script currently gives errors under Python 3.
-- Updated amd64 and x86 versions of setx.exe for updating system PATH on XP/VISTA/7
-- PATH is updated with adb.exe location after Python is installed.
-- The computer will now reboot after updating the PATH, to make sure it will be updated before running the main program.
**** 12.01.27 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.27.php
- GENERAL CHANGES:
-- After adb is installed, adb will reset the android device by running "adb reboot" instead of displaying a list of attached devices with "adb devices".
adb was occasionally reporting no devices were attached, when they infact were. When this happened "adb reboot" still worked, so it is a better test to see if adb is setup properly.
-- Friendlier messages during adb install and testing
-- Added a startup check to make sure the script is running from the correct directory
-- Removed empty Project directory, as it is not being used yet.
- LINUX CHANGES:
-- Added support for "lxterminal" and "urxvt" in "Knifes-and-Forks-Linux.sh"
-- Changed idVendors for Linux udev rules to lowercase instead of uppercase.
- WINDOWS CHANGES:
-- Startup script searches for python in "C:\Program Files (x86)" then "C:\Program Files" and "c:\" last.
-- Drivers should now install even if the language is not English
-- Added drivers for Casio C771 G'zOne Commando
-- Added LG drivers
-- Replaced setx.exe
**** 12.01.25 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.25.php
- Replaced "Knives-and-Forks-Mac.sh" with "Knives-and-Forks-Mac.app".
Starting the script on a Mac should now be as simple as double-clicking the new .app file.
**** 12.01.24 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.24.php
- Fixed a typo which caused the script to crash when viewing the credits screen.
- Smarter python fix for Windows users.
-- "C:\" and all sub-directories are searched for python.exe.
-- If python is not not found, it will be downloaded from python.org and installed to c:\python27.
-- If python is found (in "C:\python27", "c:\python", "c:\xyz123", "c:\program files\python27" or in any directory with any name anywhere on drive c:) the main menu script will launch.
- Added changelog.txt to the release .zip file.
**** 12.01.23 ****
http://knivesandforks.info/releases/knives-and-forks-12.01.23.php
- Minor update to fix Python installation for Windows users, which was causing the script not to launch.
**** 12.01.22 ****
(FIRST PUBLIC RELEASE)
http://knivesandforks.info/releases/knives-and-forks-12.01.22.php
- Added option to install adb & fastboot for Linux, Windows, Mac
- Added Linux drivers for:
-- ACER
-- ASUS
-- DELL
-- FOXCONN
-- GARMIN-ASUS
-- Google
-- Hisense
-- HTC
-- HUAWEI
-- K-TOUCH
-- KT Tech
-- KYOCERA
-- LENEVO
-- LG
-- MOTOROLA
-- NEC
-- NOOK
-- NVIDIA
-- OTGV
-- PANTECH
-- PEGATRON
-- PHILIPS
-- PMC-SIERRA
-- QUALCOMM
-- SK TELESYS
-- SAMSUNG
-- SHARP
-- SONY ERICSSON
-- TOSHIBA
-- ZTE
- Added Mac drivers for:
-- Nothing. According to Google, "It just works." Let me know if they are right.
- Added a custom Windows installer with drivers for:
-- GOOGLE
-- HTC
-- HUAWEI
-- SAMSUNG
WHERE DID THE OLD POSTS GO?
In an attempt to reduce unnecessary clutter in my original thread, I created supporting threads in each Android device forum. The whole reason behind posting so many times was to keep certain information in the Chef Central post, and certain information out of it in an effort to reduce clutter. Who wants to read through 50 pages of how this, that, and the other thing is or isn't working on devices that you don't own? That system appeared to work very well, but apparently I broke the rules by posting in every Android device forum.
Learn from my mistakes, don't post similarly worded posts all over the place!
ATTENTION PYTHON PROGRAMMERS:
Any idea on what I can do to make the Python files work in Python 2 and Python 3? I have only tested in Python 2.7.2, but I have received reports that Python 3 gives errors. I'm not really doing anything all that fancy, so I'm not sure if something is just a matter or new syntax or something else needs to be imported or what. Any help would be appreciated.
The next release will call "python2" for Arch Linux users since "python" will use python 3.
ATTENTION LINUX USERS:
I am currently testing my Knives & Forks script in some virtual machines using VirtualBox, as well as my local Xubuntu installation.
For distro specific things (installing 32-bit libs, udev changes, etc) in the next release I will be detecting the distro using the following code:
Code:
echo " -- DETECTING LINUX DISTRO --"
if [ "`cat /etc/issue | grep Arch | wc -l`" == "1" ]; then
DISTRO_NAME="Arch"
elif [ "`cat /etc/issue | grep Cent | wc -l`" == "1" ]; then
DISTRO_NAME="CentOS"
elif [ "`cat /etc/issue | grep Debian | wc -l`" == "1" ]; then
DISTRO_NAME="Debian"
elif [ "`cat /etc/issue | grep Fedora | wc -l`" == "1" ]; then
DISTRO_NAME="Fedora"
elif [ "`cat /etc/issue | grep Ubuntu | wc -l`" == "1" ]; then
# DETECTS UBUNTU, KUBUNTU, XUBUNTU, ETC
DISTRO_NAME="Ubuntu"
else
DISTRO_NAME="UNKNOWN"
fi
echo " - $DISTRO_NAME"
Please let me know what other distros your using and if you are able to find the name using the "/etc/issue" method I am using in the above if statements.
I wrote a bash function to check if sudo is installed, and then to see if the current user has permissions to use sudo. If sudo is not installed, or if the current user does not have permission to use it, su will be used instead. This will be included in my next update, but I wanted to post it here first:
Code:
echo " -- CHECKING TO SEE IF 'SUDO' IS INSTALLED --"
CURRENT_USER=$USER
USE_SUDO="NO"
if [ -f "/usr/bin/sudo" ]; then
echo " - 'sudo' is installed."
echo ""
echo " -- CHECKING FOR PERMISSION TO USE 'SUDO' --"
echo ""
echo " If prompted, enter the password for the user '$CURRENT_USER'."
echo ""
if [ "$(sudo whoami)" != "root" ]; then
echo ""
echo " - Sorry, '$CURRENT_USER' does not have permission to use 'sudo'."
echo " - 'su' will be uses instead of 'sudo'."
echo ""
else
echo " - '$CURRENT_USER' has permission to use 'sudo'."
USE_SUDO="YES"
echo ""
fi
else
echo " - 'sudo' is not installed."
echo " - 'su' will be used instead of 'sudo'."
echo ""
fi
DO_SU()
{
echo ""
if [ $USE_SUDO == "YES" ]; then
# echo " -- USING 'SUDO' TO RUN '$1' --"
echo ""
echo " If prompted, enter the password for the user '$CURRENT_USER'."
echo ""
sudo $1
else
# echo " -- USING 'SU' TO RUN '$1' --"
echo ""
echo " If prompted, enter the password for the user 'root'."
echo ""
su -c "$1"
fi
echo ""
}
# EXAMPLE USAGE OF THE DO_SU() FUNCTION:
# NOTE THAT THE COMMAND TO RUN WITH SU OR SUDO HAS TO BE IN QUOTES
DO_SU "whoami"
I also found out why debian users were being forced to use sudo or su in order to use adb. The next release will include this fix, but for those who might be interested in making this change manually:
Open "/lib/udev/rules.d/91-permissions.rules" as root (su or sudo) in your favorite text editor and find this line
Code:
usbfs-like devices SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ MODE=”0664″
Change MODE to "0666"
Code:
usbfs-like devices SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, \ [B]MODE=”0666“[/B]
Instead of replacing or modifying your "/lib/udev/rules.d/91-permissions.rules" file, the next version of my script will actually create a "/lib/udev/rules.d/92-permissions.rules" for Debian users that contains only the following:
Code:
# usbfs-like devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
MODE="0666"
This file will load right after the 91-permissions.rules and replace just the usbfs-like devices settings. I'm just doing this with my script so I don't accidently break anything on your system. If you are making the changes manually, editing the 91-permissions.rules file should be all you need to do.
Save your changes and then restart udev as root (using sudo or su)
Code:
/etc/init.d/udev restart
-- or --
Code:
service udev restart
This assumes of course that you already have a working udev rule for your android device, and that adb is working only with su or sudo currently. Once this change is made you should be able to use adb without being forced to use su or sudo.
First post updated with latest release, version 12.02.04.
Lots of changes for XP and various Linux distros. See changelog for more information, but things should work better in Arch, CentOS, Debian, Fedora, and Ubuntu (including Kubuntu, Xubuntu, etc).
Hi, I just downloaded the latest file (12.02.04) but it's only 4 KB.
Could you check please?
Thank you!
Trying to unzip the file in Ubuntu 11.10 and this what I get:
Archive: knives-and-forks-12.02.04.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of knives-and-forks-12.02.04.zip or
knives-and-forks-12.02.04.zip.zip, and cannot find knives-and-forks-12.02.04.zip.ZIP, period.
Any help?
I had a typo in the .zip filename, so if you tried to download the file yesterday you basically just downloaded an error message that the .php counter script gave when it couldn't find the file. I will have to take a look at that later because it is supposed to display the message not make you download it.
The problem is now fixed, sorry about that.
Thanks for update.
Downloaded and installed.
Now I can adb from linux.
Have one more question. I hope you can help me with that as well.
I don't see my device (E4GT) as external hard drive or USB drive when debuging is on to copy files to it.
When debuging is off it shows 2 Android devices but when I click on them I'm getting this message:
Error initializing camera: -60: Could not lock the device
Any ideas?
My guess is maybe they didn't get unmounted properly that last time you had it plugged in, but I have no idea why you would get an error message about the camera. I have not seen that one.
Try installing Dropbox and backing up anything important, then formatting the sdcard and try mounting again.
Maybe somebody else has had that error and has a better idea,
I'll try to format sd card tonight when I get home.
But what would be the problem with internal storage?
And what should or could I try to proper mount it?
agat63 said:
I'll try to format sd card tonight when I get home.
But what would be the problem with internal storage?
And what should or could I try to proper mount it?
Click to expand...
Click to collapse
First thing to check is that it isn't ROM related. Boot into recovery and try to mount as a usb drive and see if it works or not. If it does, I would say wipe and flash another ROM. If it doesn't work from recovery, then it could be a result of not unmounting before unplugging from your computer.
Sometimes if you have your phone mounted as a USB drive, or even just a regular flash drive, and it you unplug it before it is done unmounting (or if you don't use the safely remove hardward feature of Windows) the filesystem can get trashed. It hasn't happened alot with me, and I have seen the problem happen mostly when a flash drive is unplugged before the OS can finish writing to it.
After you get all of your important stuff backed up somewhere like dropbox, reboot into your recovery and repartition the sd card and/or your internal storage, whatever is giving you the problem. When you reboot into android you should be able to use it as normal, and dropbox should automatically copy everything back that you backed up.
This problem isn't really related to my script, so I if you can't get the issue resolved make a new post in Android QA or somewhere else. PM me if you post elsewhere and I can see if I can help you out there.
I didn't mean to say that the problem is related to your script.
Your script works just fine and I'm able to adb.
I'm kinda new to linux and still learning it.
I needed help and advise for how to connect phone to pc in linux.
It works in windows for me.
When I get on my PC I'm gnats give this awhirl. Ad for your mounting disk drives if ur on any ics rom it wont and I don't know how to enlighten me someone but if its gingerb then make sure u mount with the phones option when u plug in on ur handset ther should be some kind of way to switch between teather, disk and charge only? Wat fone u got?
Does this knife and forks compile? What does it do? Sorry to sound like a knob.
Sent from my GT-I9100 using XDA Premium App
This worked for my att gs2.
Sent from my GT-I9100 using Tapatalk
By using the Android Font you are violating their copyright rules. But you are free to modify the Android Robot, as long as you refer to them and say that you have permission.
Bad-Wolf said:
By using the Android Font you are violating their copyright rules. But you are free to modify the Android Robot, as long as you refer to them and say that you have permission.
Click to expand...
Click to collapse
The post where I found the font said it was an Android logo inspired font, and not the actual android logo font.
I have changed the font I'm using, and have updated my logo graphic to fight off any further concerns.
Colliebudz said:
Does this knife and forks compile? What does it do? Sorry to sound like a knob.
Click to expand...
Click to collapse
At the moment it simply automates getting adb setup on Linux, Mac, and Linux.
I have plans to add support for device rooting next, followed by some other adb commands, then rom customization tools as the last stage of development.
Pushing files to the phone, running shell commands, etc, requires that adb is setup properly, so that is where the focus is at right now. Getting the adb & driver installation scripts setup to run on all three platforms is also helping take care of some general troubleshooting, which is good to get out of the way before the main script gets tons of extra features.
All of this info should be in the first post, I'll try to clarify things when I make the next update.
Waddle said:
This worked for my att gs2.
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Thanks for the feedback. What OS?

[Q] Apple Mac OSX & Support for MTP

I have spent many hours traulling the net, scanning through forums across multiple websites and found no information on how to make my device which in its current software incarnation currently seems to only allow MTP as the option for transferring data via the USB cable to and from my Mac running OSX 1.7.3.
Please note, that that google app for file transfers DOES NOT WORK (for me). I cannot get it to work no matter which god I've prayed to or what kinda dance I did. So I looked for alternatives.
ADB worked, but I got tired of ADB to push files across (which is effective, but not what I would call fun). I came across MacPort, giving us ports of Linux/Unix stuff in the world of OSX. YAY!
Found that the various libraries for MTP and MTP-FS was ported! YAY!
After installing the hell out of macport (found: www macports org) and runing the updates.
Drop to the command line and then run these commands once:
Code:
sudo port install libmtp
sudo port install mtpfs
Every time you load your device:
Code:
sudo mtpfs
Awesome! Progress, plug in the device and run mtpfs. But then I get this:
Code:
bergenmacbook:Applications bergenlarsen$ sudo mtpfs
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1/S2/GT-N7000/Galaxy Nexus.
Found 1 device(s):
Samsung: GT-P7510/Galaxy Tab 10.1/S2/GT-N7000/Galaxy Nexus (04e8:6860) @ bus 250, dev 6
Attempting to connect device
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
inep: usb_get_endpoint_status(): Operation timed out
outep: usb_get_endpoint_status(): Operation timed out
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device -208647360
I'm running MIUI v4 (2.4.13) with Siyah Kernel (currently 3.1RC5).
Help?
BergenLarsen said:
I have spent many hours traulling the net, scanning through forums across multiple websites and found no information on how to make my device which in its current software incarnation currently seems to only allow MTP as the option for transferring data via the USB cable to and from my Mac running OSX 1.7.3.
Please note, that that google app for file transfers DOES NOT WORK (for me). I cannot get it to work no matter which god I've prayed to or what kinda dance I did. So I looked for alternatives.
ADB worked, but I got tired of ADB to push files across (which is effective, but not what I would call fun). I came across MacPort, giving us ports of Linux/Unix stuff in the world of OSX. YAY!
Found that the various libraries for MTP and MTP-FS was ported! YAY!
After installing the hell out of macport (found: www macports org) and runing the updates.
Drop to the command line and then run these commands once:
Code:
sudo port install libmtp
sudo port install mtpfs
Every time you load your device:
Code:
sudo mtpfs
Awesome! Progress, plug in the device and run mtpfs. But then I get this:
Code:
bergenmacbook:Applications bergenlarsen$ sudo mtpfs
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1/S2/GT-N7000/Galaxy Nexus.
Found 1 device(s):
Samsung: GT-P7510/Galaxy Tab 10.1/S2/GT-N7000/Galaxy Nexus (04e8:6860) @ bus 250, dev 6
Attempting to connect device
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
inep: usb_get_endpoint_status(): Operation timed out
outep: usb_get_endpoint_status(): Operation timed out
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device -208647360
I'm running MIUI v4 (2.4.13) with Siyah Kernel (currently 3.1RC5).
Help?
Click to expand...
Click to collapse
Tried installing gvfs-gphoto2 and nautilus?
Read more here:
How To: Fix Samsung Galaxy Nexus MTP File Transfer for Ubuntu GNU/Linux 11.10

Tizen [Port] - Nexus 7

Hello everyone,
I started to port Tizen on Nexus 7.
Porting state:
- wifi working
- touchscreen working (doesn't yet support multitouch)
- media (pictures, music and videos) doesn't work
- no graphics acceleration (Xorg doesn't use Tegra module)
- USB doesn't work
- GPS / Bluetooth not tested
- Audio not tested
Installation:
To install it, you will need an unlocked Nexus 7 and MultiROMv7. MultiROMv7 is a way to have multi boot on Nexus 7. Once Recovery and MultiROMv7 are installed, you must reboot into recovery. Send image on your Nexus 7:
adb push /path/to/image/Nexus_7_Tizen.zip /sdcard/
After click on install button and select Nexus_7_Tizen.zip. It will install Tizen on your Nexus 7. Now you can reboot. In list of ROM, you will see Tizen_Testing. Select it and enjoy.
Download:
MultiROMv7: http://forum.xda-developers.com/showthread.php?t=2011403
Tizen ROM: http://easymt.org/files/Nexus_7_Tizen.zip
In days, I will publish instruction to build the ROM.
If you get this on par with the factory OS then you're a hair away from every nexus device using this if they want. Thank you for the work.
Sent from awesomeness?
Tizen 2.0?
Sent from my One S using xda app-developers app
Wonderful to see people just using MultiROM to create ports like this, good job
A big thank you for your work!
When USB will be avaible,
we can take screenshot from the Tizen SDK
(sdb_1.0.24_ubuntu-64)
Code:
sdb
Smart Development Bridge version 2.0.2
Usage : sdb [option] <command> [parameters]
options:
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 26101 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 26101 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
commands:
sdb push <local> <remote> [--with-utf8]
- copy file/dir to device
(--with-utf8 means to create the remote file with utf-8 character encoding)
sdb pull <remote> [<local>] - copy file/dir from device
sdb shell - run remote shell interactively
sdb shell <command> - run remote shell
sdb dlog [ <filter-spec> ] - view device log
sdb install <path_to_tpk> - push tpk package file and install it
sdb uninstall <appid> - uninstall this app from the device
sdb forward <local> <remote> - forward socket connections
forward spec is :
tcp:<port>
sdb help - show this help message
sdb version - show version num
sdb start-server - ensure that there is a server running
sdb kill-server - kill the server if it is running
sdb get-state - prints: offline | bootloader | device
sdb get-serialno - prints: <serial-number>
sdb status-window - continuously print device status for a specified device
it reminds me of something, but I do not know what
ikslawlok said:
Code:
sdb
Smart Development Bridge version 2.0.2
Usage : sdb [option] <command> [parameters]
options:
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 26101 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 26101 is used by default if no port number is specified.
Using this command with no additional arguments
will disconnect from all connected TCP/IP devices.
commands:
sdb push <local> <remote> [--with-utf8]
- copy file/dir to device
(--with-utf8 means to create the remote file with utf-8 character encoding)
sdb pull <remote> [<local>] - copy file/dir from device
sdb shell - run remote shell interactively
sdb shell <command> - run remote shell
sdb dlog [ <filter-spec> ] - view device log
sdb install <path_to_tpk> - push tpk package file and install it
sdb uninstall <appid> - uninstall this app from the device
sdb forward <local> <remote> - forward socket connections
forward spec is :
tcp:<port>
sdb help - show this help message
sdb version - show version num
sdb start-server - ensure that there is a server running
sdb kill-server - kill the server if it is running
sdb get-state - prints: offline | bootloader | device
sdb get-serialno - prints: <serial-number>
sdb status-window - continuously print device status for a specified device
Click to expand...
Click to collapse
LOL. adb knockoff.
johnwazhere said:
Tizen 2.0?
Sent from my One S using xda app-developers app
Click to expand...
Click to collapse
Actually, it is Tizen 2.0 alpha. I'm porting 2.0.
Thanks for the port! I have a question though, doesn't Nvidia have a (non-Android) Linux code tree for the Tegra 3? Couldn't the video driver from that tree be used? (even though it's for their development tablet from what I've read the socs are identical)
https://developer.nvidia.com/linux-tegra
Sent from my Nexus 7 using Tapatalk HD
Culex316 said:
Thanks for the port! I have a question though, doesn't Nvidia have a (non-Android) Linux code tree for the Tegra 3? Couldn't the video driver from that tree be used?
Click to expand...
Click to collapse
Yes it can be used. The driver work but it enable mice pointer.
Edit:
In fact I can't use it because xorg server and driver abi missmatch.
I probaly need to buimd another version of xorg than provided.
Thanks for your effort in this, very interested in this project. It's amazing to see the amount of operating systems being ported to Nexus 7.
I am extremely distress about the fact that other dev claimed successfuly port tizen to smartphones, also uploaded his work and nobody believe him (just because thefact that his work is rather complicated and no one smart enough to figure out how to do with his roms), you guys even teasing and disrespect him. Now a few months later, this dev put up with his work and an easier cleaner ways to install, these same non believer ppl comes in and appraise like its not a big deal (or lies?) and pretend nothing happened and they havent done nothing? Seriously you guys should do something about your attitide and mental capacity
Sent from my GT-P6800 using xda app-developers app
You're right man.
Anyone believed in him.
I do not know why all this lies telling about his work.
He got several downloads through internet about his work. And no respect at all.
---------- Post added at 06:42 PM ---------- Previous post was at 06:32 PM ----------
I'm going to quit from here xda.
This was a bad experience.
I've released code.google.com/p/tizen-kernel-s8500
a github.com/vic3t3chn0
a twitter.com/vicetechno
for my it works.
now, i'm going to quit for the bad experience at telling me i'm a liar.
but I had downloads at code.google.com if i'm a liar.
thank you for all.
long6688 said:
I am extremely distress about the fact that other dev claimed successfuly port tizen to smartphones, also uploaded his work and nobody believe him (just because thefact that his work is rather complicated and no one smart enough to figure out how to do with his roms), you guys even teasing and disrespect him. Now a few months later, this dev put up with his work and an easier cleaner ways to install, these same non believer ppl comes in and appraise like its not a big deal (or lies?) and pretend nothing happened and they havent done nothing? Seriously you guys should do something about your attitide and mental capacity
Click to expand...
Click to collapse
I don't know who exactly do you mean, but if it is the author of "Tizen [PORT] Attempt almost" thread then you might have not read that thread (or do not know bada/tizen forums) well enough to know that he claimed that he has so many things up and running without bothering to actually try to run it.
When we wanted to know the details it came out that he used many components developed by badadroid team without proper credit and claiming to have functionality that never existed (like working RIL or even stupid lie that he changed a bootlogo in the component that was not responsible for displaying it - to cover this lie he changed one line and provided only the non-working binary violating GPL, but the component was pure assembly we wrote so seeking truth was not difficult) in these components and were known not to be working with Tizen (kernel init not aligned with Tizen).
Looking at the repositories he pointed to, there is no source code he developed or even modified by himself - everything is public and part of other projects.
You are free to elaborate on my mental capacity, but from where I stand his complicated work appears to be limited to the ability to follow compilation instructions.
I don't claim he wanted that to be a scam from the very beginning - he might have had a will to do something and learn along the way (which would be an adequate way), but he chose to cheat where stuff got unmanageable.
While I still encourage everybody to take up the challenge to see how fun it is, but when such a "dev" is leaving XDA we couldn't be worried less. Bon voyage!
Does it take lot of time to boot up? Its showing [ 915.19111] CP L2->L0 and the process is being continued... Cant use power button.
So where does this stand? This is the one OS I want to use more than any other. I dont know jack about compiling code and such. But if someone has this for a N4 I would be all over it like ants on a peach.
This looks cool, I hope this thread doesn't die, I would really like to try Tizen on my nexus
Ubuntu touch is still unusable, but a tizen port could be quite stable, once properly ported
What is the progress of this project?
SuperBoUDS said:
What is the progress of this project?
Click to expand...
Click to collapse
Looks pretty dead. I keep coming back to check if I can get tizen on my s3
Sent from my GT-I9300 using xda app-developers app
...I keep coming back to check if I can get tizen on my s3
Click to expand...
Click to collapse
This is also my question... if S3 is able to use available Tizen Firmware... from testdevices...
Maybe someone can find solution to use Tizen on S3.
Thanx in advance.
Best Regards
adfree said:
This is also my question... if S3 is able to use available Tizen Firmware... from testdevices...
Maybe someone can find solution to use Tizen on S3.
Thanx in advance.
Best Regards
Click to expand...
Click to collapse
I have asked in s3 thread. My post got deleted after a few comments... I was hoping a port for s3 would be easy and quick but there's no development on this whatsoever
Sent from my GT-I9300 using xda app-developers app

[Q] Hardware Wifi Failure?

Hello, I was given a Gtablet by a friend. Everything is in proper working order except for the wifi. The wifi will endlessly scan, never pulling up any SSIDs. Here's what I've done to troubleshoot:
Ascertained flight mode was off (it was)
Enabled wifi through the developer options (Did nothing)
Manually enter SSID/Security information (Claims that SSID is not in range)
Reloaded the OS (He had VEGAn Tab on there. I reloaded the 5.1 Beta. I don't know what version he had on there, oops.)
After a clean install I have the exact same issue, which leads me to believe it is a hardware issue rather than a software issue. Is this common? Am I forgetting something? Would loading an entirely different ROM be of any use or do they also use the same driver?
My apologies if this has been answered previously, but in all my searching I can only find people who have this problem temporarily; a reboot fixes it for them. I haven't been able to find someone who has had this as a persistent issue.
JungleWallace said:
Hello, I was given a Gtablet by a friend. Everything is in proper working order except for the wifi. The wifi will endlessly scan, never pulling up any SSIDs.
Click to expand...
Click to collapse
I'll have to look at some logs to ascertain what your WiFi problem is.
Run the commands in this post (after rebooting the tablet) and then post the text files that're created.
rajeevvp said:
I'll have to look at some logs to ascertain what your WiFi problem is.
Click to expand...
Click to collapse
Thanks, see attached are the logs as per request. As a side note, now that I have the terminal emulator on there I tried a few commands I dug up on the internet after I looked over the logs.
Code:
$ su
# ifconfig tiwlan0 up
# ifconfig eth0 up
Both gave an error message
Code:
error: SIOCGIFFLAGS (No such device)
Also
Code:
# svc wifi enable
did not solve my issues. Oh well.
FYI:
JungleWallace said:
...I tried a few commands I dug up on the internet after I looked over the logs.
Code:
$ su
# ifconfig tiwlan0 up
# ifconfig eth0 up
Both gave an error message
Code:
error: SIOCGIFFLAGS (No such device)
Click to expand...
Click to collapse
The wireless LAN interface name on the gTab is wlan0. Hence your error messages: "No such device" for the ifnames tiwlan0 and eth0. (The latter would work for the ethernet I/F on the dock--if you had one connected.)
Also
Code:
# svc wifi enable
did not solve my issues. Oh well.
Click to expand...
Click to collapse
1. You have to look at the Android system logs (using logcat) to see the result of that svc command.
2. Your Android logs indicate that your WiFi interface is a) disabled at startup and b) then not enabled thereafter:
Code:
01-07 23:21:10.429 V/ConnectivityService( 990): Starting Wifi Service.
01-07 23:21:10.429 I/WifiService( 990): WifiService starting up with Wi-Fi [B]disabled[/B]
Suggestions:
Since this now looks like a ROM problem (ie. not HW):
1. See this thread. Run the script to disable Airplane Mode which might be causing your problem. If that doesn't work, try step 2:
2. Boot into CWM and then a) Format /cache and b) Repartition the Internal SD card (take the external one out first).
You'll lose all your current apps and data with this step, essentially reverting to a "fresh" install of your ROM.
Re-setup WiFi, time & date and other things again.
If step 2. doesn't work, report back next year, and I'll give you more commands to run then.
rajeevvp said:
If step 2. doesn't work, report back next year, and I'll give you more commands to run then.
Click to expand...
Click to collapse
Negative. Ran the airplane fix script, nothing. Reset cache/re-partitioned, still nothing. It's still endlessly scanning/shutting off/scanning.
JungleWallace said:
Negative. Ran the airplane fix script, nothing. Reset cache/re-partitioned, still nothing.
Click to expand...
Click to collapse
OK. Not one of the common simple problems, then.
It's still endlessly scanning/shutting off/scanning.
Click to expand...
Click to collapse
This is puzzling because from your last logs, it doesn't look like the wlan kernel driver was even loaded, so no AP scanning should be possible. A little background will clarify what I mean.
On all the 2.6.32.x kernels for the gTablet, the wlan driver is not compiled into the kernel. Instead, it is built as a separate kernel module which is loaded and unloaded as needed by Android (from the files in /system/lib/hw/wlan/). When the wlan driver is loaded both the kernel (dmesg) and Android (logcat) will show some characteristic messages and until the driver is inserted into the kernel no AP scanning, or other wireless functions, should be possible. And, no wlan driver-related messages in your logs tells me that the driver was likely not loaded. (Also, only after the wlan driver is loaded does it check and initialize the wireless HW. So, only after its been loaded, strictly speaking, can we rule out a HW problem.)
Sometimes the Android logs are not complete, so I want to you setup ADB on your PC, enable USB debugging on the gTablet (Setting > Applications > Development) and collect the Android logs like this from now on:
1. Power off gTab; attach the USB cable to it.
2. Open a CMD.exe window on the PC, then run this command (and keep the window minimized):
Code:
C:\> [B]adb logcat -v time > logcat.txt[/B]
After all the tests/commands have been done, restore this window and press Ctrl-C to kill ADB and terminate Android log collection.
3. Power on the gTablet. The ADB command will wait for the gTablet and keep collecting logs on the PC.
Post also the output of these commands:
Code:
C:\> [B]adb shell dmesg > dmesg.txt[/B]
C:\> [B]adb shell lsmod > lsmod.txt[/B]
C:\> [B]adb shell "cd /; find system -type f -print0 | xargs -0 sha1sum" > sha1sum.txt[/B]
Is this the ROM you currently have?
Have you applied the VEGAn 1.00 beta 5.1.1 supplement also?
rajeevvp said:
OK. Not one of the common simple problems, then.
.........
Is this the ROM you currently have?
Have you applied the VEGAn 1.00 beta 5.1.1 supplement also?
Click to expand...
Click to collapse
That was the current ROM I was using. I had not applied the supplement yet, but now I have. Still the same issue. Here are the logs.
JungleWallace said:
That was the current ROM I was using. I had not applied the supplement yet, but now I have. Still the same issue. Here are the logs.
Click to expand...
Click to collapse
In this one I can see the kernel WiFi driver being loaded, and the driver is not reporting any HW chip, SDIO bus, or other errors:
Code:
<4>[ 23.485281] sdio_reset_comm():
<4>[ 23.503617] DHD: dongle ram size is set to 294912(orig 294912)
<4>[ 23.676913] Firmware version = wl0: May 17 2010 22:38:50 version 4.218.223.1
<4>[ 23.887647] wlan0: Broadcom Dongle Host Driver mac=e0:2a:82:08:3e:81
<4>[ 23.894047] Enter wl_control_wl_start
<4>[ 23.897864] Exited wl_control_wl_start
<4>[ 23.907103]
<4>[ 23.907109] Dongle Host Driver, version 4.218.223.1
As far as the kernel driver is concrned, everything looks OK, but the Android logs still don't show any SSID associations.
What're the exact outputs of these commands? (You can post a screenshot. Mask the psk= value from the 1st output, if present)
Code:
C:\> [B]adb shell "fgrep -v '#' /data/misc/wifi/wpa_supplicant.conf | tr -s '\n'"[/B]
ctrl_interface=wlan0
update_config=1
...
C:\> [B]adb shell wpa_cli -i wlan0 driver rssi[/B]
...
C:\> [B]adb shell wpa_cli -i wlan0 driver linkspeed[/B]
LinkSpeed [I]nn[/I]
C:\> [B]adb shell wpa_cli -i wlan0 scan[/B]
OK
C:\> [B]adb shell wpa_cli -i wlan0 scan_results[/B]
bssid / frequency / signal level / flags / ssid
aa:bb:cc:dd:ee:ff 2452 185 [WPA2-PSK-CCMP] [I]YourSSID[/I]
Collect also the dmesg and logcat outputs as before.
[/FONT]
rajeevvp said:
What're the exact outputs of these commands? (You can post a screenshot. Mask the psk= value from the 1st output, if present) [...] Collect also the dmesg and logcat outputs as before.
Click to expand...
Click to collapse
See attached. Ignore my syntax errors that I underlined. I was typing wlan instead of wlan0.
JungleWallace said:
Ignore my syntax errors that I underlined. I was typing wlan instead of wlan0.
Click to expand...
Click to collapse
Those are OK since you've corrected them. But, these commands you'll have to redo:
1. In the first command (fgrep ... | tr), you've typed a '/' (forward slash) instead of what I've given in the example, which is a '\' (back-slash) character.
The correct character will remove all those blank lines. But, this is a minor typo compared to:
2. The last 2 commands (wpa_cli scan* ...), which you'll have to redo. This time without the extraneous driver argument (again, see the example)--which turns it into a completely different (and non-existent) command. This is why the output doesn't look like what I've shown.
Instead of typing the commands in manually, select and copy the command lines from the browser and paste them into the shell window.
You might also want to increase the no. of columns that CMD.exe displays: Right-click on the title-bar; choose Properties; select Layout; increase the no. of Columns to, let's say, 150.
3. That dmesg.txt file is not very useful because you've not rebooted the tablet before issuing that command.
The kernel has a fixed-size message buffer, so all the HW initialization messages printed only at system boot will be overwritten by later, and irrelevent, messages as time passes. From the timestamps, it looks like your tablet's been on for a couple of weeks, at least--I can't see any of the earlier boot-up messages.

Starting adb on boot process? For debugging purposes...

Hi guys, i successfully build from scratch a device and vendor tree for my rom, and compile CM13 with no problems.
The roms boots but i get a bootloop when it come into "starting apps". My idea is get adb working on boot proccess.
I was googling but i couldn't get working....
This is my init.qcom.rc: https://drive.google.com/open?id=0ByjBTzGuQ9FIQldHTGxBWjdtczQ
And init.usb.rc generated by CM13: https://drive.google.com/open?id=0ByjBTzGuQ9FIc1ZVNnVpTVExOE0
Thanks
Well guy i was digging around and testing ALOT with no luck. Still can't enable adb at boot.
I try adding this properties on default.prop:
Code:
ro.adb.secure=0
ro.secure=0
ro.debuggable=1
persist.sys.usb.config=mtp,adb
An this in build.prop:
Code:
ro.default_usb_mode=0
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
My device is a Forge TV, and it have a single usb port and no sdcard slot, so the only way to get a log is via usb...
In the stock rom, by default, starts in host mode (storage) and you have to go into config to change it into "device mode" to get usb adb working....
Probably i need to manage how the usb port starts at boot, i thought that "ro.default_usb_mode=0" was the solution...but no
Any help will be appreciated!
PS. lsusb doesn't recognize any device....only in fastboot mode
So i found out something interesting...in stock rom if i execute the command echo 0 > /proc/usb_device the device put itself in device mode and i can debug, putting that value to 1 reverts to storage.
I try to put that on init.d, or even on init.qcom.rc in the boot image with no luck....it's so frustating...
Ususally adbd should already be running this late during the boot.
Can you at least get an usb connection during boot? (check lsusb)
If you want to get at least a dmesg output during boot you could try the following:
set this in the build.prop
Code:
debug.sf.nobootanimation=1
set the following in your kernel defconfig
Code:
CONFIG_VGA_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
(not all of them are needed but I forgot which ones are and which ones are not)
add this to the kernel command line
Code:
console=tty1 loglevel=7
This should at least show some output on the phone screen itself.
To run something in the console, you could try to connect an usb keyboard or use something like a scriptable virtual keyboard.
You might need to set loglevel to 1 or 0 if you don't want it to spam your console while working on it.
ruleh said:
Ususally adbd should already be running this late during the boot.
Can you at least get an usb connection during boot? (check lsusb)
If you want to get at least a dmesg output during boot you could try the following:
set this in the build.prop
Code:
debug.sf.nobootanimation=1
set the following in your kernel defconfig
Code:
CONFIG_VGA_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
(not all of them are needed but I forgot which ones are and which ones are not)
add this to the kernel command line
Code:
console=tty1 loglevel=7
This should at least show some output on the phone screen itself.
To run something in the console, you could try to connect an usb keyboard or use something like a scriptable virtual keyboard.
You might need to set loglevel to 1 or 0 if you don't want it to spam your console while working on it.
Click to expand...
Click to collapse
Hi, thanks alot for your answer! My device is a Razer Forge TV wich is an Android TV device. It's equiped with a single full usb 3.0 port and no sdcard slot. The port works in 2 ways, by default in host mode and device mode (the mode i need to get some debug output). In the stock rom executing "echo 0 > /proc/usb_device" enable this mode and remains on reboot. But doesn't seems to work on CM (i put the command on an init.d script). lsusb reports nothing (equal in stock rom when the port is in host mode).
I test the soluton you provided, but instead of bootanimation i get a black screen then optimizing apps, starting apps and reboot (wich is my main problem)....there's no output on screen...i'm stuck on this like 10 days or more...is so annoying...thanks again
achaw said:
Hi, thanks alot for your answer! My device is a Razer Forge TV wich is an Android TV device. It's equiped with a single full usb 3.0 port and no sdcard slot. The port works in 2 ways, by default in host mode and device mode (the mode i need to get some debug output). In the stock rom executing "echo 0 > /proc/usb_device" enable this mode and remains on reboot. But doesn't seems to work on CM (i put the command on an init.d script). lsusb reports nothing (equal in stock rom when the port is in host mode).
I test the soluton you provided, but instead of bootanimation i get a black screen then optimizing apps, starting apps and reboot (wich is my main problem)....there's no output on screen...i'm stuck on this like 10 days or more...is so annoying...thanks again
Click to expand...
Click to collapse
You could try to insert a usb stick, mount it, and then write dmesg and/or adb output to it using init.rc.
Alternatively you could try to enable adb over tcp and connect that way to it.
Alos try to chose a different tty in the kernel command line.
(btw are the following three lines present in your kernel defconfig?)
Code:
CONFIG_VT_CONSOLE=y
CONFIG_TTY=y
CONFIG_VT=y
ruleh said:
You could try to insert a usb stick, mount it, and then write dmesg and/or adb output to it using init.rc.
Alternatively you could try to enable adb over tcp and connect that way to it.
Alos try to chose a different tty in the kernel command line.
(btw are the following three lines present in your kernel defconfig?)
Code:
CONFIG_VT_CONSOLE=y
CONFIG_TTY=y
CONFIG_VT=y
Click to expand...
Click to collapse
I can't mount usb or enable adb over tcp becasuse the system reboot itself at starting apps...
Right now i'm testing with your new config, switching ttys because i'm still getting black screen instead some output...
Well after some days i remember that the Forge iss equipped with a ethernet port...i feel so stupid lol...
So i was able to debug via adb over tcp.... @ruleh thanks alot for your time!
I think "starting apps" happens when zygote is started.
If it is really the case then it should be possible to mount an usb stick and write the logs to it before everything reboots.
According to the init files I have, init.${ro.hardware}.rc would be the place to do the mount+write.
Ideally /system is mounted and /system/bin is in the path to access tools like logcat and dmesg.
Otherwise you could include them in /sbin which is (in most cases) part of the ramdisk.
It would probably be something like this:
Code:
on early-boot
#mkdir /mnt/usb
mount /dev/(usb_stick) /mnt/usb
exec /system/bin/dmesg > /mnt/usb/dmesg.log
exec /system/bin/logcat > /mnt/usb/logcat.log
(I have never used the init.rc files directly so I am not too sure.)
Also did you try "write /proc/usb_device 0" instead of "echo 0 > /proc/usb_device" in the init.rc files? (preferably before zygote starts...maybe init.usb.rc?)
Or you could try to remove the lines referencing zygote from the init.rc files and see if adbd starts then or not.
---------- Post added at 20:17 ---------- Previous post was at 20:16 ----------
achaw said:
Well after some days i remember that the Forge iss equipped with a ethernet port...i feel so stupid lol...
So i was able to debug via adb over tcp.... @ruleh thanks alot for your time!
Click to expand...
Click to collapse
I wish I read this a bit earlier...... oh well

Categories

Resources