It will empower you to do -for example- things like this:
See also: VR Mech Simulator - YouTube
But this time for Armory3D!
If you figure out how to interpret the real time data stream from your phone, you can use it as an awesome input device. As it seems that there is some quite heavy math involved, i decided to publish it now and don´t let you wait until me slowpoke has figured out the math to rotate the default cube according to phone movement. If someone is good and fast at math, you are welcome to see this as a little challenge (see game_rotation_vector, me scratch head, hmm quaternion maybe?) to further develop it. It is also a demo for websockets and how to access other computers on your network.
How-to for Linux:
Should also work on legacy OS (Win, Äppel). Its just that i don´t like to support this yesterday sh
Get my blend, bundled canvas and install GitHub - umer0586/SensorServer: Android app which stream phone's motion sensors to websocket clients ( PC , raspberry pi , arduino , webbrowser etc ) over Wi-Fi , USB and device's Hotspot.
Sensor server apk compiles fine using git clone, but he also offers a readily made apk. Min. Android 5.
Good if you happen for example to have an old S5. They are packed with all kind of sensors.
Phone and PC must be logged in to the same WLAN.
Install and run Sensor server. Read IP and choose sensor name, paste it in the blend node setup as client addresses.
Example:
ws://192.168.0.100:8081/sensor/connect?type=android.sensor.pressure
It should work with all offered sensors.
I open up a new client for every sensor. Does anybody know how to do this more elegantly?
Optional support commands under Linux (not necessary as phone app shows ip address at server start)
Scan and show all connected computers on your WLAN.
nmap -sP 192.168.0.1/24
Find IP address of your phone
Deactivate WLAN on your phone, run above command, note ip addresses.
Activate WLAN and run again. Note difference.
Ip route
Shows you which one is your router. You do not want to mix up your phone with the router.
Note: If you stopped the connection for more than some minutes you will probably have to stop and restart the server on your phone.
WS_android_sensors_WLAN_2_values.blend (945.4 KB)
Bundled.zip.hx (3.9 KB)
License: Zlib
Note: In order to use all the sensor data on your phone app after development open settings in the sensor app and activate local host. Replace remote address with local host one in Blender before you generate the Android source. Then compile and upload. This renders the sensor app a requirement to run your software on Android. But, hey, at least it works.