Android to Arduino Mega ADK board REconnecting - adk

When I connect my Arduino Mega ADK board to an AOA Android app everything is fine (initially), the connection to the ADK board is fully functional in both directions. However, if the screen rotates, someone hits back, the screen locks, etc, when the app restarts the openAccessory call to the USB manager always returns null. So students have to unplug the USB before the connection can be made again.
I've figured out the problem is related to the Input Stream, because if I don't start the Thread to receive commands then there is no issue. However that's not really a useful fix. :)
My code is here:
https://github.com/ME435/AndroidLibraries_v01/blob/master/src/edu/rosehulman/me435/AccessoryActivity.java
I just subclass my AccessoryActivity in apps like this...
https://github.com/ME435/LED-Toggle/blob/master/src/edu/rosehulman/ledtoggle/LedToggleActivity.java
It's not robust, but it's very simple for students. Thoughts on my issue?

Related

Program to display two low latency desktop streams side by side over LAN

Use case: I have two gaming PCs running a VR game in two separate rooms and a laptop in the living room connected to a projector. The VR headsets are wireless and will be in the same room as the projector with two people playing multiplayer together and the spectator screens of each gaming PC displayed side by side on the projector for others to watch the action. The game is a rhythm game (Beat Saber) so low latency is extremely important. On the other hand I can sacrifice on video quality because each desktop will only display on a 960x540 portion of the 1080p projector screen. Also audio is already taken care of and doesn't need to be transmitted to the laptop.
I have written a program with WPF and C# which displays two webpages side by side with a black bar at the top and bottom. The idea was to log into a low latency screen sharing webpage (for example parsec.app) and connect one of the PCs on each side. This actually works, but the problem is that after connecting the second computer, they both become very laggy and low fps when viewing content with a lot of movement. I really need both video streams to be smooth and with low latency. (<150ms) So using a third party service for the sharing/streaming of the screens seems to be out of the question. So I have to find a way to send the desktop streams directly over the LAN and then display them side by side with my program. I would like to have my own program display the streams so that I have authority over the layout and can add thematic pictures to the unused space on the screen. Maybe even make it customizable with up to four streams simultaneously in the future.
The laptop and one of the gaming PCs are only connected to the LAN via WiFi and the other gaming PC is connected via Ethernet. I have done some research and ffmpg or NDI seem to be the lowest latency ways to send video through a network, only I have no idea how to use them and don't have any experience programming network applications. I tried streaming my screen from one PC to the other with VLC using UDP but couldn't even get that working..
Here's a link to my visual studio project so far:
https://drive.google.com/file/d/1W7khWBvKZ1zMvreH9nyfAHPVQ6BDKN5Z/view?usp=share_link
Here's a video showing my program in action:
https://drive.google.com/file/d/1db3EHHV23mvdky36fcox9--crlrbZXK4/view?usp=share_link
Does anyone have any insights or ideas on how to solve my problem? Of course I'm willing to do some studying too if someone can point me to the resources where I can learn the required skills to make this work.

Any hope for turning on phone Nokia 7.1 using adb

My power button died on my phone. Or got less and less responsive. Last time I was lucky that trying a long time I managed to start up my phone. Since then I kept my phone on perpetually or restarting it if that was required. However, now my phone just suddenly turned off out of nowhere. I tried to turn it on again but had no luck. I had previously turned on USB debugging since I thought that was enough to turn it on from the pc if it ever got turned off. Now it seems that was not enough as it shows up as unauthorized in adb (I never tried actually connecting, very stupid on my part). Is there any hope for turning my device on through adb.
Phone: Nokia 7.1
There are some questions on problems with unauthorized devices (ADB Android Device Unauthorized) but those seem to assume I can still turn on my phone to change settings. Is it impossible otherwise?
tldr; Here is a detailed list of instructions if you want to try your luck with fastboot. Your touchscreen and volume buttons must be functional for this to work.
Make sure the phone is turned off.
Press and hold the Volume Down button. Don't release it.
Plug in a USB charging cable
When the screen turns on and shows a message saying "Download" or "Fastboot" mode, release the Volume Down button.
Charge your phone like this for 2 minutes, to make sure it has enough charge.
Move your phone's USB cable and connect it to a PC.
Download the binary for fastboot.
Run fastboot continue.

Web RTC Local audio issue

I am trying to implement a webrtc-based video chat room and I encountered the following problem. When the call starts and my local stream goes, I listen to my audio on my device before the other device receives it. The devices are far enough apart so that the echo does not affect them. I don't know if that happens because I did something wrong or it is always like that.
I appreciate any recommendations.

Windows TCP/UDP mouse driver

I am working on creating a touch pad device (custom hardware but similar to an android device) that acts as a touchscreen drawing pad similar to the Wacom Bamboo drawing pads. However, the key feature of the device is instead of connecting it to the computer with wires or via Bluetooth, it connects to the local WiFi network and searches for devices with a port open (currently 5000 for testing purposes). Currently, I have a client written in C that when launched opens up a DatagramSocket on port 5000 and waits for a custom UDP packet containing normalized X, Y, and pressure. Then, for testing purposes, I am putting the normalized X and Y into SendInput. SendInput "works" however injecting packets into the computers current mouse is not what I want. Instead, I want to have it considered as a seperate input device so programs like gimp will be able to detect it and assign custom functions based on the data (ie: have gimp utilize the pressure data).
The problem is I dont know where to start to create a driver that does the former. I have been extensively looking at the winddk thinking that might be the key. The problem with the winddk is I cannot find any documentation on creating a HID driver using data that is not from a ps/2 or usb. This tutorial got me thinking about using IOCTLs, but I am not really sure how to make them be considered as input.
As a side note, in the title I said TCP/UDP because I am willing, and considering for security purposes, to change from UDP connection to TCP.
If someone can push me in the right direction or link me to some related documentation and samples, that would be awesome because right now I am lost. Thank you.

gamecenter on 3Gnetwork don't work

I have a problem about the gamecenter,I am developing a multiply-player game, I have finished the connecting part, good luck, I can connect the another device to play the game over the local wifi, but I tried to do it through the 3G network and external wifi, it didn't work, it appeared that the interface stopped at the view of connecting the counterpart, that means they found each other, but they didn't found the match(maybe).Sometimes, one found the match,another one still stop at the view of connecting, it didn't enter the game, I read the log information, that told me the expected number of players was one, that mean there was only one player entered the game,another one did not, the max number was two.I found many website, but no answer, maybe is that because of the sandbox? I have tried in ios5 vs ios5,ios5 vs ios6 ,ios6 vs ios6,

Resources