Android -> Cant get it to work

Official forum for open source FreePIE discussion and development.
Post Reply
Maximus-CZ
One Eyed Hopeful
Posts: 8
Joined: Tue Aug 19, 2014 9:01 am

Android -> Cant get it to work

Post by Maximus-CZ »

Hey, I have problem getting this to work.

I install latest apk to my android (4.4)
I start FreePIE on PC, I start it on phone

on phone, i set IP (192.168.0.2 <- Im sure)
target port, leave 5555
Device Index 0
Check one of Send Orientation or Send raw data, doest matter in my problem
Fastest method
Press ON

In Debug: There is blank Accelerometer, blank Gyro, Blank magnetometer and 3 numbers at Orientation. That numbers change accordingly as I rotate my phone.

FreePIE on PC just wont move mouse at all

So I went to detect if UDP packets are actually hitting my PC. Downloaded "UDP Test Tool" and saw:
when I check Send raw data, no packets come.
when I check Send orientation, packets come nicely and cleanely. -> I am using only Send orientation now in phone settings. I see packets are comming.

When I am trying with FreePie, my UDP Test tool is off, so its not binded to adapter/port. I checked.


I try this code to move my mouse.

Code: Select all

def update():
	global yaw
	global roll
	global pitch
	yaw = android[0].googleYaw
	roll = android[0].googleRoll
	pitch = android[0].googlePitch
	
	
	mouse.deltaX = -deltaYaw*600
	mouse.deltaY = -deltaRoll*1000

if starting:
	yaw = 0
	roll = 0
	pitch = 0
	enabled = False
	android[0].update += update
	
	diagnostics.watch(yaw)
	diagnostics.watch(roll)
	diagnostics.watch(pitch)
	
	deltaYaw = filters.delta(yaw)
	deltaPitch = filters.delta(pitch)
	deltaRoll = filters.delta(roll)
Conclusion: Packets are incoming to PC, FreePIE is binding that network/port (when I try to sniff when Script is running, I get error in UDP Test Tool, that that adapter is unavaible), but when I move my phone as I want, mouse wont mowe at all.

Any help?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android -> Cant get it to work

Post by CyberVillain »

Sounds like your phone does not support the way we read raw values (I have a 4.4 phone myself which works btw (HTC One M8).
Anyway, orientation works thats good. You are not blocking FreePIE.exe with software firewall like the built in one in Windows?

Start simple just try this script

Code: Select all

diagnostics.watch(android[0].googleYaw)
Maximus-CZ
One Eyed Hopeful
Posts: 8
Joined: Tue Aug 19, 2014 9:01 am

Re: Android -> Cant get it to work

Post by Maximus-CZ »

May be that phone doesnt support it, KitKat is a lot different from previous versions, but it should work anyway with Orientation (which is sent properly). Strange it works on your HTC, im using LG L9 II (605).
I am not blocking anything. I have all firewalls off, no antivirus, nothing. UDP Test Tool can detect packet out of the box, and I even tried starting FreePIE as admin, or in compatibility mode. No change what so ever.

With your command, i can clearly see Yaw in Watch window, as it shows on phone. THANK YOU! This is first sign that transfering packets is working correctly.

Now to the problem to move mouse with it.:D (Later, I will try to modify it to work as freetrack, ofc:) )

PS: You really should add some signalisation like if its listening on port for android, and if it sees anything there. Till now, I wasnt even sure if its receiving some input from phone or not



EDIT: I managed to see why its not updating on PC, because in that code I pasted in OP, I had All "diagnose" lines after "if starting:"
Seems its filters.delta what is returning 0


EDIT 2 : I managed to get it working with example code, where I switched android[0].pitch to android[0].googlePitch.
Mouse now finally moves when I move my phone, but its tooooo jerky and it goes to wierd directions (I move it up, it goes mostly up, but left and right too)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android -> Cant get it to work

Post by CyberVillain »

when using orientation you are pretty much in the knee of the Phones fusion, FreePIE just reads the values of the UDP stream
Try calibrate the sensors from Settings on phone
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android -> Cant get it to work

Post by CyberVillain »

Also I have noticed that you get best results when holding the phone like when you play a game on it. I guess its because the on board fusion is optimized for games when you use the phone screen. This is offcourse fine when you usen the phone as a HMD
Maximus-CZ
One Eyed Hopeful
Posts: 8
Joined: Tue Aug 19, 2014 9:01 am

Re: Android -> Cant get it to work

Post by Maximus-CZ »

Hmm, will try.

How about emulating TrackIR with this?

I want to use it for DCS World
Look at his settings in THIS video, at 15:57
You can see he have TrackIR row there, but I dont.
Dont you know how can I overcome this?
When I launch FacetrackNoIR, select "game protocol" to freetrack and check "dummy TrackIR.exe procces" in settings, I do see the row in game, but its not taking data from moving my phone
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android -> Cant get it to work

Post by CyberVillain »

Maximus-CZ
One Eyed Hopeful
Posts: 8
Joined: Tue Aug 19, 2014 9:01 am

Re: Android -> Cant get it to work

Post by Maximus-CZ »

I already saw that, im experimenting. I know how to write to freetrack / trackir, but DCS is done that I need TrackIR to use that, or if FreeTrack, I need some kind of fix. I dont know how to write to freetrack so DCS can see it, and when I write to TrackIR, dcs cant see its process, or something, so it doesnt show up in game
Post Reply

Return to “FreePIE”