So, I have seen various posts regarding the use of an android phone as a keyboard and as a game pad. I'm actually working on a project that does just that. As you could imagine, I've hit a massive roadblock when it comes to sending the signal from the phone to the PC via USB.
I decided to use unity as the base of this project. I have a functioning GUI and I have some simple code to basically open the port, push through the Serial.write command, and close the port. I also understand that is code will not do me any good without the PC I'm connected to via USB recognizes the phone as a source of input.
That's where I'm stuck.
I've seen posts that involve explanations of how USB works, the different hex codes mapped to keys, ideas of modifying the kernel, third party programs, and third party devices, but nothing concrete on how to move forward in a video game on my PC by simply tapping the screen on my phone. It should be simple right?
So, I'm asking whether or not this project is worth pursuing for the few months I have left to do it or should I consider pivoting to a project that's a little closer to my pay grade(free)?
Although I am not sure if this post is a SO standard question, my train of thought would be to use bluetooth instead of using USB, client-server etc. as they are plagued by problems. While there maybe a certain lag in using bluetooth, programmatically this should be easily achievable. This maybe of interest to you: https://github.com/temach/HIDInterface
Related
I am working on a C# development project which aims at controlling a flying robot thanks to a set of Optitrack cameras (infrared Motion capture system). The concept works really well, you get a position from the camera system, our application can access to these data and we can control the robot.
The problem comes, I believe, from the communication chain. We have a USB cable linking our PC to an STM32F4 based board, which acts as a bridge and simply sends everything received on USB to radio thanks to an embedded NRF module (nRF24L01+ chip). This mechanic goes both way (NRF -> USB -> PC). The board is running under C using FreeRTOS. The PC runs Windows 10.
On the PC side we use the official STM32 VCP driver 1.4 from ST. On the board firmware, we have this user-made library for VCP on STM32F4: https://stm32f4-discovery.net/2014/08/library-24-virtual-com-port-vcp-stm32f4xx/
There are no queues on the bridge board except the ones from the radio module itself and potentially the STM32 VCP driver itself. I checked, there is a circular buffer in this driver used for in and out messages. Using JSCOPE I can visualize in real time how this circular buffer behaves and I've never seen an overflow happening.
My problem comes from the fact that a delay suddenly appears.
The system works perfectly for tens of minutes (between 10 to 20 minutes) and then a delay is clearly perceptible, which makes the controller oscillate. This happens when I do a second flight.
The following have been tried:
- Restart the C# application
- Run the C# application in debug mode and stand alone mode
- Change USB cable (shorter)
- Change USB port
- Change of computer
- Reinstall the ST VCP drivers
- Lower drastically the communication frequency (the control loop)
When the problem appears, the above solutions didn't work, the delay remains completely and none of the above proved to make it more reliable.
On the C# application, I reset all communication Lists before each flight. The SerialPort port object (from System.IO) has its buffers reset as well (DiscardOutBuffer, DiscardInBuffer, BaseStream.Flush methods)
I found a "hack" to make it work, but it is not what we want as a final solution. The "hack" is to simply physically disconnect / reconnect the USB connecting the board acting as a bridge. After this manipulation, the delay disappears.
So my questions are:
What could possibly bring this delay, knowing it doesn't look to be application dependant, nor frequency related (bandwidth).
What could explain why this disappear when unplugging/plugging the bridge board ?
I know this question is about a big project and could be hard to understand from outside. Feel free to ask me for more details if needed.
Cheers,
Marc
My understanding of how this stuff works is very limited, as I usually just make library calls which make the audio / video magically show up.
I want to be able to do MITM "attacks" to programs on my own computer. (I'd be the guy intercepting signals between the software and the hardware). This kind of thing could be useful in a number or scenarios.
For instance, for audio:
XP doesn't have a way to change the audio for specific programs while keeping the others unchange. It only has one audio
manager across all its programs. If I could intercept the signal (and
detect which program it was coming from) I could in theory make my own audio manager.
I could record conversations, possibly testing out any audio -> text software I may have/create.
many more.
For video:
(Primary goal here): record conversations. I have used a third party program, but I'm guessing what it is doing is taking snapshots because 1) the video is choppy and 2) when the mouse or other thing gets in the way of the video, it records that too. Wouldn't it be easier just to record the signal going to the video card from the specific program of my interest, then play it back when I want to see it again?
For network traffic:
For recording traffic to and from my computer, possibly discovering
programs that are communicating that shouldn't be.
For keyboard/mouse:
This could be useful for easily creating macros to fill out forms or
whatever, and I could custom encrypt the data to make sure it's
secure rather than relying on some third party software.
I'm sure there are many other applications for which this could be useful.
Thanks.
I want to develop an application for voice calls between two android devices on my home network (WiFi). I'm new to programming so don't really know where to begin, I have researched around but cannot find anything that fits what I need to do.
The application has to be written in C# as I have a basic understanding of that language and it's the language I want to expand my knowledge in. I'm using MonoDevelop which allows the creation of android apps through C#.
The call will be peer to peer so very basic and no security or encryption will be necessary in these early stages of development.
All help will really be appreciated!
I'd start with this link at code project:
http://www.codeproject.com/Articles/138484/Simple-SIP-VOIP-based-phone-in-C
You will have to adapt it to android, but again is a probably a good starting point to understand how to do voice over IP.
The big things that may differ on android are:
User interface
method to get microphone input
method to play audio output
access to the IP stack
but the basic (encoding, decoding, etc...) should be there.
The Problem:
I'm writing an application that needs to receive electrical input from a machine every time the machine does something.
I have a Limit switch set up to the machine and it currently completes a circuit every time the machine does it's thing
I need it to input into a computer using usb as oppose to just complete a circuit.
I had a dataq 'dl-148u-sp' And i got the c# code to produce a graph using ActiveX controls but all i really need is the digital output from the circuit being completed (which for the life of me i couldn't figure out how to do)..
I ended up frying the device(i think) even the software it came with doesn't recognize it anymore...
I need a new device, and it turns out they discontinued the one i had, and the next one up after shipping is like 90$.
The Question:
Is there a Better/Cheaper/Easier way of doing this? Or can anyone suggest a Good device that's easy to get the output using c# code so i can incorporate it into a program i made?
It's not clear if you are asking for a hardware or software solution here. Are you asking what the best way to facilitate that data transfer from your machine to the PC? If so, this may not be the place to ask, but you might look at a USB to GPIO module.
http://numato.com/8-channel-usb-gpio-module is an example.
I'd recommend an Arduino:
http://www.arduino.cc/playground/Main/InterfacingWithHardware
They dev kits are cheap and there's a ton of open/free libraries that interface the Arduino to C#.
More expensive and complex board is IOFirebug with c# library and many functions. Input voltage range is from 5V to 30V.
I am building a Windows Desktop software that will respond to SMS request and sending a SMS as reply automatically.
The software is ready and working just fine but it works only and only with Nokia Mobiles and the prerequisite is that Nokia's PC Suit has to be installed first before my app can work.
But now my customer wants to change his mobile so he wants me to change programming so that it works with any mobile.
I am at loss as to how to do this?
Can someone please help me here. I am ready to recode the whole app if required.
My preferred platforms are Delphi, VB.NET and VB6.
There are extended AT commands that you can send to your phone's virtual serial interface that tend to work well on many phones. See this for more info: http://www.developershome.com/sms/howToSendSMSFromPC.asp
Now all you need to do is find serial drivers for the supported phones. This used to be really simple, but is harder these days. Bottom line is, it is probably your best option.
"Any mobile"? That's a tall order. I'm not sure your customer knows what he's asking for. Different types of phones are different and there isn't some way to make the same program run on all of them.
What you can do, though, is make it run on any supported mobile. You can keep most of your existing PC-side code; only the part that talks to the phone has to change. Encapsulate that into some sort of interface in a separate module, and that's your specific code for talking to Nokia phones. Your app now supports Nokia.
Then figure out how to do the same thing for an Android, or a Blackberry or an iPhone. Build those specific parts into their own modules that all implement the same basic interface. With each new phone type you figure out how to talk to, your list of supported devices will grow.