Use your Android device as an automatic wifi adapter - Repurposing Old Devices

I currently use an old Galaxy 5 as a wifi adapter for my computer. I wrote a small adb script which turns on tethering on boot.
Code:
adb shell input keyevent KEYCODE_POWER
adb shell am start -n com.android.settings/.TetherSettings
TIMEOUT 2
adb shell input keyevent 66 # enter
adb shell input keyevent 66 # enter
adb shell input keyevent KEYCODE_POWER
I use the timeout command because the phone is really slow and sometimes it does not properly load the settings before pressing the next buttons.
I wanted to ask if there was a better way of doing it, using better commands or something. Also is there a way to turn off tethering when computer is shut down?

Related

A7+ originated from a Panasonic tablet?

I was doing some filework on my A7+ and thought "Wouldn't it be so much better if I could just plug this damn thing directly into my computer?" So I put it in device mode, rebooted, and used a male-to-male USB cable to connect it to my PC. It didn't work, as expected, but what I did find out was the filesystem or driver system that it uses. Windows XP was trying to find drivers for a "UT-PB1" device. It couldn't, of course, so I went to the internet. I literally searched "UT PB1 USB drivers" and I got this article:
http://thetechjournal.com/electroni...raboo-ut-pb1-e-book-tablet-now-official.xhtml
(Other source: http://techcrunch.com/2011/07/22/raboo-panasonic-japan-to-launch-android-e-book-readertablet-video/ )
Look closely at the bevel, the camera and light sensor positions, and the three soft keys. (I know that the menu key is rotated 90 degrees) This weird tablet has most of the same specs as the A7+.
7-inch 1024×600 color touchscreen
Dual Core CPU (the article says that the actual chip is unknown, but I bet that it's Tegra 2)
1.3Mpix Camera
Wifi (BGN), Bluetooth
USB port (but no HDMI)
It seems that this Panasonic tablet was never released in the US. Maybe StreamTV bought a factory off of this Chinese company, and used the same basic hardware.
Just a thought. Maybe someone can do something with this, I don't know.
I ran into similar results in Win 7, however it did display a generic drive icon for the device.
I think I had USB debugging and allow mock connections on at the time for experimentation.
From what I could tell the two devices were talking to each other however I couldn't access the tablet's file system.
Do you have root setup? I do not.
---------- Post added at 12:34 AM ---------- Previous post was at 12:17 AM ----------
Here is a short output from ADB:
$ adb -d devices
List of devices attached
???????????? no permissions
adb -d bugreport
error: insufficient permissions for device
As far as I can tell from this, the hardware works....
Upon further review, I think I had the USB permissions incorrect in my: /etc/udev/rules.d/51-android.rules
But after rebuilding my desktop environment for the Nth time recently, ADB is able to poll the device.
$ adb devices
List of devices attached
037c708542c0e097 device
The "$ adb -d bugreport" also works but has far too much info to post here.

SHIELD TV Wake On Lan

Does anyone know if you could awakening NVIDIA Shield TV from a WoL call?
Thanks.
MALOW said:
Does anyone know if you could awakening NVIDIA Shield TV from a WoL call?
Thanks.
Click to expand...
Click to collapse
Tried it, using my phone and WOL app I always use (to wake up PC and NAS), but nope. Not from stand-by, not from power-off
WoL does not work with Shield TV. You can use adb instead. Activate Debugging on the Shield TV (connecting it via USB at least once, then you can use ADB via Lan) and get adb.exe. The command would be adb shell input keyevent KEYCODE_WAKEUP
I wrote a batch file that looks as follows. It connects to shield box via adb and executes the "wake"-command then disconnects. You will have to substitute the IP-Adress with the one of you Shield box.
@ECHO off
cd /d %~dp0
adb kill-server
adb start-server
adb connect 192.168..1.100
timeout /t 5
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server

Nook Glowlight Plus USB OTG Keyboard

I managed to get into developer mode on my new NGP, there's no more "build number" as I've seen in several blog posts with the latest update you click on the Nook icon on the About page it takes you to Developer mode. I've been able to install a few apps, but here's what I'd like to do.
I'd like to plug in a USB keyboard and use it to SSH into another machine through my WiFi hotspot to do some HTML/JS/CSS text editing while I'm outdoors (at the pool, the park, etc) as my other laptops/tablets aren't visible at all outdoors with glare. This would be a nice portable solution if I could get it to work, even editing locally on the device through some editor and sending via SFTP would be just fine.
However, I can get my USB OTG cable and USB keyboard to work on my Samsung J3 phone just fine, but not on my NGP it does nothing when plugged in, keyboard caps lock doesn't activate. Is there a way to get it to work, and does it require rooting the NGP? I haven't rooted the device yet.
JohnnyFriendly said:
However, I can get my USB OTG cable and USB keyboard to work on my Samsung J3 phone just fine, but not on my NGP it does nothing when plugged in, keyboard caps lock doesn't activate. Is there a way to get it to work, and does it require rooting the NGP? I haven't rooted the device yet.
Click to expand...
Click to collapse
As a workaround I put a VNC client on it so I can access my other devices and do the typing from there, that way I can use my RPI3 as the system with a keyboard on battery power and do some Python (Django)/NodeJS/ReactJS from the NGP using it as a monitor outdoors, but if I issue the following commands via adb to rotate into landscape mode I lose input on the NGP and have to reboot:
adb shell settings put system accelerometer_rotation 0
adb shell settings put system user_rotation 1
Any ideas?
I believe I looked at this once.
At least one of the problems is that the ID pin on the micro USB connector is not connected through to the processor.
B&N has never shown any interest in putting Bluetooth in a Nook.
We'll have to see if the latest "Nook Glowlight 3" will have either OTG or BT.

USB debugging does not prompt for authorization

I have successfully connected this tablet, a Fire HD6 2020 device before and have been able to use ADB to switch launchers but it has been very infrequent. When I did get the prompt, I had thought I had set the authorization to always but likely not as I see the "no permissions" when I do adb devices. Does anyone know if there is a way to force authorization? I plug it in frequently hoping to get the prompt and it may happen once in a hundred tries. I have tried different cables so I have no idea where to go next

ADB connected but unauthorized - Authorization box does not appear when connecting?

I have a no-name Allwinner T3 head unit. I need to enable some Accessibility options for an app, but there is no Accessibility Settings menu on this head unit. From reading the forum, I see how to set these options using ADB. With help from various posts, I have enabled debugging and ADB over WiFi. (USB on this unit only accepts devices and can't connect to a PC)
I am able to connect ADB over WiFi to head unit from PC, and also from ADB Shell apps on my phone and even locally on the head unit. However, when I connect, no authorization box pops up, and all ADB shell commands return "unauthorized". The strange thing is that if I do a reboot after connecting ADB, the authorization box does appear briefly during the reboot, but pressing OK in the box doesn't seem to do anything.
Does anyone have any idea how I can get around this without root on the head unit?

Categories

Resources