Is there a way to have a USB device act as a Host and an application on a Windows based system to act as the Peripheral? We have a USB device that is the host and we need it to connect to our application running on a Windows based system. The device is using USB 2.0 On-the-go specification, but it needs to run in Host role. We have found a few libraries and what not but they seem to only work if the application is host and the device is the peripheral. Any information or leads would be greatly appreciated.
Thanks.
The USB Ports on a typical Windows PC can only talk in Host mode. This means that if your device is directly connected to a PC (including hubs), it has to run in device mode.
There are devices that can talk to 2 USB hosts at one (e.g. some USB<->USB PC connection cables). That could be one solution to your problem, but to me it looks more like you just have to adapt your devices software some bits.
Related
I am doing a project using Android things,I have downloaded image and flashed in memory card ,n I got Android things os screen.... Until this is all fine..
Now I want develop app..how to connect to raspberry pi from Android studio so that the device should visible in deployment target of Android studio...so that I can debug ,put break point n see logcat...etc..I am using WINDOWS 7 OS For development system...I have installed Google USB driver from sdk manager,puTTy I have downloaded serial debug IP configuration did,..now adb is not detecting raspberry pi 3 .....but if I connect my mobile phone I can easily see the device in deployment target of Android studio....I have ref many sites ... But not working....if anybody have worked on Android thing with Windows Os plz provide me a full solutions right from scratch....n also suggest me site and books for Android things
The USB port of the Raspberry Pi is for charging only, it does not support data transmissions. You need to use adb over the network (either WiFi or wired).
First make sure to get the Raspberry Pi on the same network as your laptop. If you have access to a screen, you should also be able to see the IP under settings.
Once you know that, you can just use:
adb connect [Raspberry Pi]
And then you will be able to use it from Android Studio.
In theory you can also use:
adb connect Android.local
But that will not work if you have more than one android device on your network.
You cannot use the USB port from the Raspberry Pi for debugging. You need to connect its Ethernet port to your computer and debug over Ethernet.
See Android Things on Raspberry Pi.
I'm developing a Java application which should listen on specific port on computer using Sockets.
The another app, which will run on Android device connected to the same WiFi, should find this computer with my Java program.
How can I find the computer in the network?
I've tried it in the small LAN (where are all devices connected to 192.168.*.*) using InetAddress.getByName(ipAddress).isReachable(); but in the bigger network (like eduroam or my school WiFi) I'm not able to scan whole network.
Is there another option how to connect two devices to each other apart from using Sockets and scanning whole network?
I'm not sure I understand your entire system requirements, but I'm thinking you could create a very small database at a hosting site (such as this) and have your PC periodically upload its private IP address to that database.
Then, when you need to connect to the PC on your android device, you query the database and determine the PC's current address, then connect to the device.
I have a virtual machine hosting a server located at 192.168.18. This server is listening on port 20000 for a connection from my Android application. I am doing this locally for testing purposes.
The Genymotion virtual machine is located at 192.168.57.1, and it does not appear to be able to communicate with the other server.
Is there a way to change Genymotion so that it will operate in the 192.168.1/24 subnet, or a way to get them to communicate properly?
You can easily achieve this. You need to ask your Genymotion device to have a Bridged network connection instead of a NAT.
Open VirtualBox
Select the device you want to see on your local network
Click on settings
Open the Network tab and the Adapter 2
Then switch from NAT to Bridged Adapter
Start your Genymotion device
After that, your local DHCP will handle this new device and give it a local IP. You will be able then to reach you local network from it.
Note: This should be handled very soon directly from Genymotion soft, no need to open VirtualBox for this settings.
I have an application made of a device I made to connect through USB emulating a Serial port. Now, I need to connect the same device via bluetooth so I'm using a RN-42 (Bluetooth to serial port) in my device to send the data over RF.
Then I pair my device in Windows with the laptop's internal BT module which creates to COM ports a Outgoing and a Incoming one. Then if I connect using Br#ay's terminal I receive the expected data when I connect to the Outgoing COM port.
The problem is that when I use my Java app where I am using the last RXTX libraries, I can discover the COM port (which is the problem that everyone has, at least thats all what i found in forums) and it seems to connect but then I don't receive no data. Using the same exact program but connecting using a cable it works just fine as the terminal does.
I also tried to use the BlueCove libraries, I can find the bluetooth devices but I don't really know how to discover it services and then connect to it using RFComm. I can't find a complete example of how to do that.
Any help will be appreciated!
I'm getting similar problem with default Windows Bluetooth stack.
With Toshiba stack communication is ok.
I recently developed an Android application with which the Android device can communicate with another Android device running the application.
The communication works over sockets, therefore I developed a server which i run on my computer.
Here is my problem:
The communication between the devices over the Server running on my PC works fine, as long as all devices as well as the PC are in the same LAN (connected over the same Router for example).
Now I want to get the server online, so that the Android devices can connect to the "online" server and communicate with each other over the server from anywhere.
I simply have no idea of how to get the server online and running. How can I do that?
The main issue is, that I know about Client/Server communication locally, but have no experience in the "online" sector.
It is more a network problem than a programming one. Your server open a socket and therefore is available to anyone able to reach that socket.
You have to do a redirection on your router. The problem is that your machine doesn't have a public IP, only your router has one. So when your router receive a packet on port 21 for example, it doesn't know what to do with it. You have to configure it to say "the port 21 has to redirected to the local IP XXX"
Also the public IP of your modem/router can change, depending on your ISP. If your have a fixed IP, it won't change, otherwise you will have to install a software like dyndns to have a domain name associated with your IP.