I2C device not available as /dev/i2c-1 (Preview 5 and 6/6.1) - android-things

Google has changed and removed the i2c device from the /dev/ path.
They add/remove the device I you are using this:
I2cDevice dev = pService.openI2cDevice("I2C1", 0x68)
And the /dev/i2c-1 is gone if you disconnect the I2C device: dev.close();
This is the reason why you do not have access via:
open("/dev/i2c-1", O_RDWR);
(this was possible in the Version 4.1 without issues)
So, now google made it complicated... and the question is, how I can bring back the device i2c-1 after boot?

#Kyle what you're doing may work, but it definitely isn't supported by Android Things. When Android Things leaves developer preview, you may no longer be able to directly access device files at all (due to the device being in SELinux enforcing mode).
In the meantime, you can probably execute the following to recreate the device node. At best this is a temporary solution, since you'll have to run these commands every boot (unless you add them to one of the init scripts).
$ adb shell
rpi3:/ $ su
rpi3:/ # mknod /dev/i2c-1 c 89 1

Related

Error "LoadLibrary failed with error 126: The module could not be found" when launching Spyder IDE through VPN

Here's what happens:
Using a Macbook Pro, I use the Microsoft Remote Desktop Connection application to connect to my work computer, which is a Windows 10 machine
If I try to launch Spyder on my work computer, I get this error:
Load Library Error
However:
If I am at my work computer (i.e. physically at work instead of logging in remotely), I can launch Spyder successfully
If I leave Spyder open on my work computer, then go home and do a remote log-in to my work computer, I can use Spyder without issue. The problem/error described above arises only if I try to open Spyder through the remote connection.
This error only seems to affect Spyder and I can use all other programs without issue through a remote connection. As a workaround I've been using other IDEs and successfully running scripts, but I strongly prefer Spyder.
What I have tried so far (without success):
The 4 troubleshooting steps posted by Fazil M. to this Microsoft thread
Uninstalling/reinstalling Spyder using Conda
Restarting my work computer
System Information:
Work Computer OS: Windows 10, 64-bit
OS of computer through which I'm logging in to work computer: Mac OS X El Capitan 10.11.6
Spyder version: 4.1.1
Any thoughts as to what could be going on?
Update--More information and trials:
I checked out Issue #3736 on Spyder's GitHub. It says to download and add a file called opengl32sw.dll to the folder ~\Lib\site-packages\PyQt5\Qt\bin. But when I go to the PyQt5 folder, I do not see a subfolder for Qt. I tried placing it into the PyQt5 main folder, but that did not fix the problem.
I've heard this can be a graphics card issue too. On my machine I have two graphics cards: AMD RadeonT R5 430 and Intel(R) HD Graphics 630.
Darren's answer did not work for me. What did work was to:
First option: go into the device manager and disable the Intel HD Graphics card under "display adapters."
Second option:
run "Gpedit.msc"
navigate to Computer Configuration->Administrative
Templates->Windows Components->Remote Desktop Services->Remote
Desktop Session Host->Remote Session Environment
Disable "use WDDM graphics display driver for remote desktop
connections"
Restart the computer
See https://answers.microsoft.com/en-us/windows/forum/all/windows-10-1903-may-update-black-screen-with/23c8a740-0c79-4042-851e-9d98d0efb539
It took help from my organization's IT contractor, but I fixed the issue by doing the following:
Run a file called "gpedit.msc", which will open up a window for Local Group Policy Editor
In the tree menu on the left, navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment, and open the Remote Session Environment folder (not the subfolder within it)
Make sure the following are set to "Enabled":
"Use hardware graphics adapters for all Remote Desktop Services"
"Prioritize H.265/AVC444 graphics mode for Remote Desktop Connections"
"Configure H.264/AVC hardware encoding for Remote Desktop Connections"
Then restart the computer.
Since I was unable to get pass LoadLibrary 126 error using the solutions provided online and on here, I stepped back and realized the obvious workaround. The errors occurs when you open the program while you're using a remote session, right? The obvious solution is to launch the program while a remote session is not in progress. To do this while you're remoting, you should create a batch script to launch the program but make sure to include to a time delay before that (I used 'timeout 10 /nobreak' to do so). Run the batch script and, before your program launchs, disconnect from RDP. After enough time passes for the program to launch, you can reconnect to RDP and your program will be up and ready

App store not connecting on Mac through Vmware virtual machine?

I setup mac OS X 10.7 on my window-7 machine through Vmware workstation version 11.1.2 and it's running good. I want to download and setup XCode for coding but i am unable to connect app store. It is not even sign in me. I tried all solution given in this apple link. Please anyone give me any solution. One more thing i also tried to login on apple developer site through my existing apple id but after i click on sign in it's not showing the next screen after login.
Note: This solution is specifically unix based systems.
Check the serial number in about us in VM. If it is not there or it is 0. Then below solution will definitely fix your problem.
VirtualBox does not by default make a serial number available to OS X guests. Of course OS X runs just fine inside VirtualBox running on a Mac even in that case. But due to the serial number being “0” the App Store and Server applications will not work.
The solution is to determine the serial number of the real Mac by opening About This Mac or running System Information. It is an alphanumeric string. On my Mac Pro 5,1 it begins with a letter and is 11 characters long.
In Terminal run the following command substituting the name of your VirtualBox virtual machine and your serial number (all one line):
VBoxManage setextradata “<your-vm-name>” VBoxInternal/Devices/efi/0/Config/DmiSystemSerial “<your-serial-number>“
Make sure you remove the quotes while entering the above command.
Starting up the machine after this change will then present a serial number that matches the base system and applications will function correctly.
This was tested on a Mac Pro 5,1 running 10.10.5 with VirtualBox 5.0.14. The guest was 10.11.3.
I'm using VMware Fusion 8, Mac Mojave both host and guest. App store was loading web content correctly on host but nothing on guest (Cannot connect to App Store).
I fixed it by shutting down the guest, go to Fusion > Virtual Machine > Settings > Advanced > check the "Pass power status to VM" checkbox, Start the guest again, retry the App Store connection, and it successfully loads web content.
Apparently Apple's fog up a mirror test is whether or not the macbook has a battery or power.

Install non-UI app on jailbroken device via AFC2

I am trying to install an app to a jailbroken iPhone from PC via USB (using AFC2), for personal research. The app is actually an installer, so it has no UI.
My biggest 2 problems are: I don't know any API to run a command via an USB services, to run the binary after copying.
Then, I installed a LaunchDaemon plist to start my installer, but it seems that the binary is copied with no execution rights (maybe a limitation in AFC2), so the launch daemon fails.
So now I am stucked. Do you have any ideeas?
UPDATE
Thanks to creker I made some steps into achieving my goal. He provided me with several solutions, but I chosen the automatically install DEB via Cydia, since it looks the most simple and elegant method of all.
Nevertheless, I hit some bumps with this method also:
now I am able to succesfully install the .deb file via Cydia; I load the app and a launch daemon in the deb, but the launch daemon is unable to start the app, since installd fails to validate the app, which was fake-signed with ldid (I thought ldid signing is sufficient for running in jailbroken environment); so I guess either I sign it for real or I use a tweak like AppSync, to bypass validation
I also tried the following formula: a launch daemon to launch a bash script, which then starts the app, since I saw that cydia and OpenSSH registers some launch daemons like that, but my script / launch daemon is ignored, so I presume there should be a trick somewhere. Am I missing something here?
Do you have a WiFi? If not, you can use USB tunneling. Then you can SCP your app on a device and install it with SSH (give it persmissions you need and then launch). That's enough for testing. Or you can pack it into debian package with postinst script that will do all the installation. Debian packages can be installed manually through ssh and deb -i command. Or you can copy it into /var/root/Media/Cydia/AutoInstall and it will be installed automatically on device boot.
As for root:wheel, you can do this in your postinst script. The script by default is executed with root permissions. Just set all necessary permissions in it for all your files. If it's a daemon, you can even manually add it to launchd and launch immediatelly.

How to make WiFi work for toshiba C850...?

I have a toshiba laptop c850, dual core. Toshiba does not provide any driver for Wi-Fi for Ubuntu 12.10. I am currently having problem in using DSL modem, Ethernet and Wi-Fi. Can anyone tell me the solution to this problem?
maybe you will find some information there :
http://www.linlap.com/toshiba_satellite_c850-c855
Wireless
A really up to date kernel is required for wireless support, at least
3.5.0 is recommended. Realtek has the Linux drivers available for download but they must be re-complied after upgrades to kernel.
As you commented, you got the Atheros Communications Inc. AR8162 Fast Ethernet Controller.
This is some guesswork here because there are several versions of the driver and some people state only one is working for them, I stick with the most popular for now.
First download this file from another machine:
https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5-u.tar.bz2
If you have Ubuntu or another Linux distro on your second machine you can use wget to download the file:
wget https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/28/compat-drivers-2013-03-28-5-u.tar.bz2
Next, use your preferred method (preferably an USB Drive) to copy it to your target machine (Toshiba C850) and use the following commands in a terminal. Make sure you are in the right directory first and use cd to change to the directory where your downloaded file resides.
tar -xzvf compat-drivers-2013-03-28-5-u.tar.bz2
cd compat-drivers-2013-03-28-5-u
./scripts/driver-select alx
make
sudo make install
sudo modprobe alx
If this doesn't work try a reboot first then you can try one of the other versions, I can't tell which will work for you:
http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2012-02-28-p.tar.bz2
https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/04/compat-drivers-2013-03-04-u.tar.bz2
Sources (for further reading): This question on AskUbuntu and this thread in the Ubuntu forums.

debug bridge for iPhone / shell command prompt

For Android there is ADB (Android debug bridge) which allows to get a shell on the connected device:
adb shell
Is there something similar for iOS?
I'd like to type some shell commands on my Mac that would be executed on the connected iPhone.
Is there a built-in Terminal on iPhone?
There isn't anything for it built in, but if you are jailbroken or can sideload apps (a.k.a., you have a mac with XCode), you can run a local terminal with apps like MobileTerminal, which aren't available on the app store.
To access a shell from a computer, if you are jailbroken (and possibly even if you aren't, if you can sideload apps) you can install openssh or openssh-server from Cydia (I believe it is just called "OpenSSH" in the GUI). Once that is running on your device, you can connect the device over USB and use this shell script I made called idb to access a shell, push and pull files, and so on. This sets up a USB link to relay TCP packets from the SSH server on the device, and then 'wraps' around SSH and SCP to perform the required tasks.
You'll have to compile a program to make it work called iproxy; this program relays TCP over the USB bus to allow ssh over a cable. The comments in the script I wrote explain how to do this (sorry... I plan to move it into README.md eventually).
The program follows most of the syntax of adb and implements some of the more commonly used operations of it.
Without jailbreaking, your options are more limited, but it may be possible to do something. I haven't tried since I don't regularly use iOS anymore.
use ssh through network (e.g. Wi-Fi), and iphone/ipad need download and enable ssh service, firstly.

Resources