umer0586 / sensorserver Goto Github PK
View Code? Open in Web Editor NEWAndroid app which let you stream various phone's sensors to websocket clients
License: GNU General Public License v3.0
Android app which let you stream various phone's sensors to websocket clients
License: GNU General Public License v3.0
Is this feature already implemented? If not, is there a plan for the future?
When I am trying to read the GPS data with websocket with python, showing the gps is connected both on the server app and the terminal app but no data is coming out.
The GPS permission is allowed in the app settings, and the GPS is on.
The full code:
import websocket
import json
def on_message(ws, message):
data = json.loads(message)
x = data["longitude"]
print("x = ", x)
def on_error(ws, error):
print("error occurred ", error)
def on_close(ws, close_code, reason):
print("connection closed : ", reason)
def on_open(ws):
print("connected")
def connect(url):
ws = websocket.WebSocketApp(url,
on_open=on_open,
on_message=on_message,
on_error=on_error,
on_close=on_close)
ws.run_forever()
connect("ws://172.20.10.2:8080/gps")
For context, I'm trying to capture location and accelerometer data at the same time (separate packets) but the timestamp for accelerometer data is nanoseconds since reboot and the time associated with location is unix time. Most importantly, the sampling rate is different so I get about 1 gps coord for every 50 accelerometer reading. I would like for my data to be perfectly synced (I don't need perfect unix time just for both data to be taken at the same time)
TLDR is there some way (that isn't a boge on my end; not lazy btw I just trust a solution you make is more accurate in the end than mine) to get the same timestamp for both gps and accelerometer data (i.e. both unix or both nanoseconds since reboot) in a way that would be precise?
Appreciate your work btw ๐
5.0 wanted Java17 first: https://monitor.f-droid.org/builds/log/github.umer0586.sensorserver/23#site-footer
So I added that: https://gitlab.com/fdroid/fdroiddata/-/blob/b8ea88726347a153db79c42a612f271733dc0385/metadata/github.umer0586.sensorserver.yml#L34-L37
And another fix: #31
But now it's not repro anymore? https://gitlab.com/fdroid/fdroiddata/-/jobs/4805397553#L458
@umer0586 did you build https://github.com/umer0586/SensorServer/releases/tag/v5.0.0 with Java17?
/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/49451aee4d1bac13fa9c7d6709898ad36d883663
Hi. Cool app! I managed to open a websocket and stream GPS and Acellerometer data. However, when i try to access the settings to change my sampling rate, the app crashes. I'm currently on Android 11, and I'm using the newest release from the repo: https://github.com/umer0586/SensorServer/releases/tag/v5.3.0
Is there a workaround I can use to set the sample rate?
Best regards,
Gustav
hello, i use this Action build your project, but i got this:
FAILURE: Build failed with an exception. can you help me. thanks
my workflows file:
https://github.com/mvwtest/SensorServer/blob/main/.github/workflows/SensorServer.yml
and biuld log:
https://github.com/mvwtest/SensorServer/runs/4952176375?check_suite_focus=true
how can i do it? thank you.
Hi, I would like to know... what happened to your sms server app? Is there any plan to add sms server in this SensorServer app?
Phone: Samsung Galaxy S22; Android 14; Kernel 5.10.177; One UI version 6.0.
Bug: The server does not stop after activating the stop button on the main screen of the App. The App and server even keep running after closing it. Only "force stop option from Settings/Applications works.
Add material themed app icon
When i tried to make a client and establish the connection, it shows "connection failed". Can you suggest me the possible reason for this.
Hi, I followed the instruction on this link, https://github.com/umer0586/SensorServer/wiki/Getting-Data-From-GPS.
But the python script (both two scripts) can still not get the location.
The python only output 'connected!' but no information even I move the phone from place to place.
The information of my phone is:
Galaxy S21 5G
one UI version: 6.1
android version: 14
Note that I use USB to connect the device with PC, all other sensors work perfectly.
for example samsung galaxy watch 6 ?
Is there any way to send the Gyroscope data using usb serial communication instead of websockets. Because the latency is too much. And I am on a project that requires low latency.
=========== RESTART: \wsocket_client.py ==========
error occurred
[WinError 10061] No connection could be made because the target machine actively refused it
connection close
close code : None
reason : None
Maybe phone firewall have a reject rule and thus do not work well as servers.
I have tried with two devices (Samsung and Huawei). I have tried different ports. I am on a local Wireless LAN.
I have been trying to open the app Sensor Server v4.0.0, but it closes immediately.
Version v3.2.1 works fine
Android Version 13
Oneplus device
Can this app start the websocket server automatically during Android phone boot up?
Hi,
first thing, thank you for this awesome app!
The only issue I have is that app stops providing data when screens shuts down. Connection is not dropped, but data stops flowing.
This issue might be partially similar to #4 .
Power saving is good, but sometimes I need longer recording and keeping screen on for whole time consumes even more power.
Please support landscape mode.
I want to run this app on a tablet.
Crash report received via email
{
"REPORT_ID": "6fa2a8ce-66bf-4794-996b-7b931a087614",
"APP_VERSION_CODE": 27,
"APP_VERSION_NAME": "6.0.0",
"PACKAGE_NAME": "github.umer0586.sensorserver",
"FILE_PATH": "/data/user/0/github.umer0586.sensorserver/files",
"PHONE_MODEL": "SM-G925F",
"BRAND": "samsung",
"PRODUCT": "zeroltexx",
"ANDROID_VERSION": "7.0",
"STACK_TRACE": "java.lang.AbstractMethodError: abstract method \"void android.location.LocationListener.onStatusChanged(java.lang.String, int, android.os.Bundle)\"\n\tat android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:304)\n\tat android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java)\n\tat android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:154)\n\tat android.os.HandlerThread.run(HandlerThread.java:61)\n",
}
The webpage at ws://myphone'sip:8081/sensor/connect?type=android.sensor.rotation_vector might be temporarily down or it may have moved permanently to a new web address. and i get code ERR_UNKNOWN_URL_SCHEME. what can i do about this?
Crash report received via email
{
"REPORT_ID": "bed42db3-dd8f-40a0-9f44-2b4c2e45972b",
"APP_VERSION_CODE": 30,
"APP_VERSION_NAME": "6.2.0",
"PACKAGE_NAME": "github.umer0586.sensorserver",
"FILE_PATH": "/data/user/0/github.umer0586.sensorserver/files",
"PHONE_MODEL": "SM-S711B",
"BRAND": "samsung",
"PRODUCT": "r11sxins",
"ANDROID_VERSION": "14",
"BUILD": {
"BOARD": "s5e9925",
"BOOTLOADER": "S711BXXS4CXF8",
"BRAND": "samsung",
"CPU_ABI": "arm64-v8a",
"CPU_ABI2": "",
"DEVICE": "r11s",
"DISPLAY": "UP1A.231005.007.S711BXXS4CXF8",
"FINGERPRINT": "samsung/r11sxins/r11s:14/UP1A.231005.007/S711BXXS4CXF8:user/release-keys",
"HARDWARE": "s5e9925",
"HOST": "VPHMRB638",
"ID": "UP1A.231005.007",
"IS_DEBUGGABLE": false,
"IS_EMULATOR": false,
"MANUFACTURER": "samsung",
"MODEL": "SM-S711B",
"ODM_SKU": "unknown",
"PERMISSIONS_REVIEW_REQUIRED": true,
"PRODUCT": "r11sxins",
"RADIO": "unknown",
"SKU": "unknown",
"SOC_MANUFACTURER": "Samsung",
"SOC_MODEL": "s5e9925",
"SUPPORTED_32_BIT_ABIS": [
"armeabi-v7a",
"armeabi"
],
"SUPPORTED_64_BIT_ABIS": [
"arm64-v8a"
],
"SUPPORTED_ABIS": [
"arm64-v8a",
"armeabi-v7a",
"armeabi"
],
"TAGS": "release-keys",
"TIME": 1718955069000,
"TYPE": "user",
"UNKNOWN": "unknown",
"USER": "dpi",
"VERSION": {
"ACTIVE_CODENAMES": [],
"BASE_OS": "samsung/r11sxins/r11s:14/UP1A.231005.007/S711BXXU2CXCF:user/release-keys",
"CODENAME": "REL",
"INCREMENTAL": "S711BXXS4CXF8",
"KNOWN_CODENAMES": "{HoneycombMr1, HoneycombMr2, Lollipop, Kitkat, Tiramisu, Gingerbread, Cupcake, IceCreamSandwichMr1, JellyBean, IceCreamSandwich, LollipopMr1, M, N, O, P, Q, R, S, Sv2, Base, NMr1, OMr1, JellyBeanMr1, JellyBeanMr2, Donut, Froyo, GingerbreadMr1, EclairMr1, UpsideDownCake, Honeycomb, Eclair01, KitkatWatch, Base11, Eclair}",
"MEDIA_PERFORMANCE_CLASS": 0,
"PREVIEW_SDK_FINGERPRINT": "REL",
"PREVIEW_SDK_INT": 0,
"RELEASE": "14",
"RELEASE_OR_CODENAME": "14",
"RELEASE_OR_PREVIEW_DISPLAY": "14",
"SDK": "34",
"SDK_INT": 34,
"SECURITY_PATCH": "2024-07-01",
"SEM_FIRST_SDK_INT": 33,
"SEM_INT": 3401,
"SEM_PLATFORM_INT": 150100
}
},
"TOTAL_MEM_SIZE": 113038589952,
"AVAILABLE_MEM_SIZE": 39501242368,
"BUILD_CONFIG": {
"APPLICATION_ID": "github.umer0586.sensorserver",
"BUILD_TYPE": "release",
"DEBUG": false,
"VERSION_CODE": 30,
"VERSION_NAME": "6.2.0"
},
"CUSTOM_DATA": {},
"IS_SILENT": false,
"STACK_TRACE": "org.java_websocket.exceptions.WebsocketNotConnectedException\n\tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:673)\n\tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:649)\n\tat github.umer0586.sensorserver.websocketserver.SensorWebSocketServer.onSensorChanged(SensorWebSocketServer.kt:582)\n\tat android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:1108)\n\tat android.os.MessageQueue.nativePollOnce(Native Method)\n\tat android.os.MessageQueue.next(MessageQueue.java:335)\n\tat android.os.Looper.loopOnce(Looper.java:187)\n\tat android.os.Looper.loop(Looper.java:319)\n\tat android.os.HandlerThread.run(HandlerThread.java:67)\n",
"INITIAL_CONFIGURATION": {
"colorMode": 5,
"densityDpi": 450,
"fontScale": 1,
"fontWeightAdjustment": 0,
"hardKeyboardHidden": "HARDKEYBOARDHIDDEN_YES",
"keyboard": "KEYBOARD_NOKEYS",
"keyboardHidden": "KEYBOARDHIDDEN_NO",
"locale": "en_IN",
"mcc": 404,
"mnc": 10,
"navigation": "NAVIGATION_NONAV",
"navigationHidden": "NAVIGATIONHIDDEN_YES",
"orientation": "ORIENTATION_PORTRAIT",
"screenHeightDp": 804,
"screenLayout": "SCREENLAYOUT_SIZE_NORMAL+SCREENLAYOUT_LONG_YES+SCREENLAYOUT_LAYOUTDIR_LTR+SCREENLAYOUT_ROUND_NO",
"screenWidthDp": 384,
"semButtonShapeEnabled": 0,
"semDesktopModeEnabled": 0,
"semDisplayDeviceType": -1,
"semMobileKeyboardCovered": -1,
"seq": 73750,
"smallestScreenWidthDp": 384,
"touchscreen": "TOUCHSCREEN_FINGER",
"uiMode": "UI_MODE_TYPE_NORMAL+UI_MODE_NIGHT_YES",
"userSetLocale": false
},
"CRASH_CONFIGURATION": {
"colorMode": 5,
"densityDpi": 450,
"fontScale": 1,
"fontWeightAdjustment": 0,
"hardKeyboardHidden": "HARDKEYBOARDHIDDEN_YES",
"keyboard": "KEYBOARD_NOKEYS",
"keyboardHidden": "KEYBOARDHIDDEN_NO",
"locale": "en_IN",
"mcc": 404,
"mnc": 10,
"navigation": "NAVIGATION_NONAV",
"navigationHidden": "NAVIGATIONHIDDEN_YES",
"orientation": "ORIENTATION_PORTRAIT",
"screenHeightDp": 804,
"screenLayout": "SCREENLAYOUT_SIZE_NORMAL+SCREENLAYOUT_LONG_YES+SCREENLAYOUT_LAYOUTDIR_LTR+SCREENLAYOUT_ROUND_NO",
"screenWidthDp": 384,
"semButtonShapeEnabled": 0,
"semDesktopModeEnabled": 0,
"semDisplayDeviceType": -1,
"semMobileKeyboardCovered": -1,
"seq": 73882,
"smallestScreenWidthDp": 384,
"touchscreen": "TOUCHSCREEN_FINGER",
"uiMode": "UI_MODE_TYPE_NORMAL+UI_MODE_NIGHT_YES",
"userSetLocale": false
},
"DISPLAY": {
"0": {
"currentSizeRange": {
"smallest": [
1080,
1012
],
"largest": [
2260,
2260
]
},
"flags": "FLAG_SUPPORTS_PROTECTED_BUFFERS+FLAG_SECURE",
"metrics": {
"density": 2.8125,
"densityDpi": 450,
"scaledDensity": "x2.8125",
"widthPixels": 1080,
"heightPixels": 2260,
"xdpi": 403.4110107421875,
"ydpi": 401.593994140625
},
"realMetrics": {
"density": 2.8125,
"densityDpi": 450,
"scaledDensity": "x2.8125",
"widthPixels": 1080,
"heightPixels": 2340,
"xdpi": 403.4110107421875,
"ydpi": 401.593994140625
},
"name": "Built-in Screen",
"realSize": [
1080,
2340
],
"rectSize": [
0,
0,
1080,
2260
],
"size": [
1080,
2260
],
"rotation": "ROTATION_0",
"isValid": true,
"orientation": 0,
"refreshRate": 60,
"height": 2260,
"width": 1080,
"pixelFormat": 1
}
},
"USER_COMMENT": null,
"USER_EMAIL": "N/A",
"USER_APP_START_DATE": "2024-08-04T11:50:33.277+05:30",
"USER_CRASH_DATE": "2024-08-04T11:50:46.553+05:30",
"DUMPSYS_MEMINFO": "",
"LOGCAT": "08-04 11:50:33.476 I/ViewRootImpl@4bfd6e5[MainActivity](13015): handleWindowFocusChanged: 1 0 call from android.view.ViewRootImpl.-$$Nest$mhandleWindowFocusChanged:0\n08-04 11:50:33.476 D/ViewRootImpl@4bfd6e5[MainActivity](13015): mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb400006f14c6f8d0}\n08-04 11:50:33.477 D/InputMethodManagerUtils(13015): startInputInner - Id : 0\n08-04 11:50:33.477 I/InputMethodManager(13015): startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus\n08-04 11:50:33.484 D/InputMethodManagerUtils(13015): startInputInner - Id : 0\n08-04 11:50:33.489 I/InsetsSourceConsumer(13015): applyRequestedVisibilityToControl: visible=false, type=ime, host=github.umer0586.sensorserver/github.umer0586.sensorserver.activities.MainActivity\n08-04 11:50:34.027 I/ViewRootImpl@4bfd6e5[MainActivity](13015): ViewPostIme pointer 0\n08-04 11:50:34.117 I/ViewRootImpl@4bfd6e5[MainActivity](13015): ViewPostIme pointer 1\n08-04 11:50:34.118 D/AnimatorSet(13015): mReversing is false. Don't call initChildren.\n08-04 11:50:34.122 D/ServerFragment(13015): startServer() called\n08-04 11:50:34.128 D/WebsocketService(13015): onStartCommand()\n08-04 11:50:34.135 W/System.err(13015): SLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\n08-04 11:50:34.135 W/System.err(13015): SLF4J: Defaulting to no-operation (NOP) logger implementation\n08-04 11:50:34.135 W/System.err(13015): SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n08-04 11:50:34.140 D/TrafficStats(13015): tagSocket(129) with statsTag=0xffffffff, statsUid=-1\n08-04 11:50:34.184 D/AnimatorSet(13015): mReversing is false. Don't call initChildren.\n08-04 11:50:34.261 D/ServerFragment(13015): onServerStarted() called\n08-04 11:50:34.265 D/CompatibilityChangeReporter(13015): Compat change id reported: 160794467; UID 10416; state: ENABLED\n08-04 11:50:34.268 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): server started successfully 192.168.1.35/192.168.1.35:8080\n08-04 11:50:34.268 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): sampling rate 200000\n08-04 11:50:34.297 D/AnimatorSet(13015): mReversing is false. Don't call initChildren.\n08-04 11:50:37.392 I/ViewRootImpl@4bfd6e5[MainActivity](13015): onDisplayChanged oldDisplayState=2 newDisplayState=2\n08-04 11:50:39.349 D/ProfileInstaller(13015): Installing profile for github.umer0586.sensorserver\n08-04 11:50:45.070 D/CompatibilityChangeReporter(13015): Compat change id reported: 247079863; UID 10416; state: ENABLED\n08-04 11:50:45.078 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): New connection/192.168.1.37:55901 Resource descriptor : /sensor/connect?type=android.sensor.accelerometer\n08-04 11:50:45.092 D/SensorManager(13015): registerListener :: 1, LSM6DSVTR Accelerometer, 200000, 0, \n08-04 11:50:45.092 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.094 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.290 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Connection closed /192.168.1.37:55901 with exit code 1000 additional info: \n08-04 11:50:45.291 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Sensor : android.sensor.accelerometer Connections : 1\n08-04 11:50:45.293 D/SensorManager(13015): unregisterListener\n08-04 11:50:45.293 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Total Connections : 0\n08-04 11:50:45.293 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.294 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.367 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): New connection/192.168.1.37:55902 Resource descriptor : /sensor/connect?type=android.sensor.accelerometer\n08-04 11:50:45.376 D/SensorManager(13015): registerListener :: 1, LSM6DSVTR Accelerometer, 200000, 0, \n08-04 11:50:45.376 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.377 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.507 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Connection closed /192.168.1.37:55902 with exit code 1000 additional info: \n08-04 11:50:45.507 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Sensor : android.sensor.accelerometer Connections : 1\n08-04 11:50:45.511 D/SensorManager(13015): unregisterListener\n08-04 11:50:45.512 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Total Connections : 0\n08-04 11:50:45.512 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.513 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.576 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): New connection/192.168.1.37:55903 Resource descriptor : /sensor/connect?type=android.sensor.accelerometer\n08-04 11:50:45.583 D/SensorManager(13015): registerListener :: 1, LSM6DSVTR Accelerometer, 200000, 0, \n08-04 11:50:45.583 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.584 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.714 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Connection closed /192.168.1.37:55903 with exit code 1000 additional info: \n08-04 11:50:45.714 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Sensor : android.sensor.accelerometer Connections : 1\n08-04 11:50:45.720 D/SensorManager(13015): unregisterListener\n08-04 11:50:45.721 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Total Connections : 0\n08-04 11:50:45.721 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.721 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.791 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): New connection/192.168.1.37:55905 Resource descriptor : /sensor/connect?type=android.sensor.accelerometer\n08-04 11:50:45.798 D/SensorManager(13015): registerListener :: 1, LSM6DSVTR Accelerometer, 200000, 0, \n08-04 11:50:45.798 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.802 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:45.931 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Connection closed /192.168.1.37:55905 with exit code 1000 additional info: \n08-04 11:50:45.931 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Sensor : android.sensor.accelerometer Connections : 1\n08-04 11:50:45.933 D/SensorManager(13015): unregisterListener\n08-04 11:50:45.933 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Total Connections : 0\n08-04 11:50:45.933 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:45.935 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:46.010 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): New connection/192.168.1.37:55906 Resource descriptor : /sensor/connect?type=android.sensor.accelerometer\n08-04 11:50:46.022 D/SensorManager(13015): registerListener :: 1, LSM6DSVTR Accelerometer, 200000, 0, \n08-04 11:50:46.023 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:46.023 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 1\n08-04 11:50:46.150 E/SensorManager(13015): Exception dispatching input event.\n08-04 11:50:46.151 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Connection closed /192.168.1.37:55906 with exit code 1000 additional info: \n08-04 11:50:46.151 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Sensor : android.sensor.accelerometer Connections : 1\n--------- beginning of crash\n08-04 11:50:46.151 E/AndroidRuntime(13015): FATAL EXCEPTION: Handler Thread\n08-04 11:50:46.151 E/AndroidRuntime(13015): Process: github.umer0586.sensorserver, PID: 13015\n08-04 11:50:46.151 E/AndroidRuntime(13015): org.java_websocket.exceptions.WebsocketNotConnectedException\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:673)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:649)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat github.umer0586.sensorserver.websocketserver.SensorWebSocketServer.onSensorChanged(SensorWebSocketServer.kt:582)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:1108)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat android.os.MessageQueue.nativePollOnce(Native Method)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat android.os.MessageQueue.next(MessageQueue.java:335)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat android.os.Looper.loopOnce(Looper.java:187)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat android.os.Looper.loop(Looper.java:319)\n08-04 11:50:46.151 E/AndroidRuntime(13015): \tat android.os.HandlerThread.run(HandlerThread.java:67)\n08-04 11:50:46.152 E/ACRA (13015): ACRA caught a WebsocketNotConnectedException for github.umer0586.sensorserver\n08-04 11:50:46.152 E/ACRA (13015): org.java_websocket.exceptions.WebsocketNotConnectedException\n08-04 11:50:46.152 E/ACRA (13015): \tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:673)\n08-04 11:50:46.152 E/ACRA (13015): \tat org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:649)\n08-04 11:50:46.152 E/ACRA (13015): \tat github.umer0586.sensorserver.websocketserver.SensorWebSocketServer.onSensorChanged(SensorWebSocketServer.kt:582)\n08-04 11:50:46.152 E/ACRA (13015): \tat android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:1108)\n08-04 11:50:46.152 E/ACRA (13015): \tat android.os.MessageQueue.nativePollOnce(Native Method)\n08-04 11:50:46.152 E/ACRA (13015): \tat android.os.MessageQueue.next(MessageQueue.java:335)\n08-04 11:50:46.152 E/ACRA (13015): \tat android.os.Looper.loopOnce(Looper.java:187)\n08-04 11:50:46.152 E/ACRA (13015): \tat android.os.Looper.loop(Looper.java:319)\n08-04 11:50:46.152 E/ACRA (13015): \tat android.os.HandlerThread.run(HandlerThread.java:67)\n08-04 11:50:46.155 D/SensorManager(13015): unregisterListener\n08-04 11:50:46.155 I/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): Total Connections : 0\n08-04 11:50:46.155 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n08-04 11:50:46.155 D/github.umer0586.sensorserver.websocketserver.SensorWebSocketServer(13015): notifyConnectionsChanged() : 0\n",
"INSTALLATION_ID": "1f666923-7f9e-4fe9-be7b-58a5dfa727ce",
"DEVICE_FEATURES": {
"android.hardware.sensor.proximity": true,
"com.google.android.feature.DSE_CHOICE_SCREEN": true,
"com.samsung.android.sdk.camera.processor": true,
"com.samsung.feature.aodservice_v10": true,
"com.sec.feature.motionrecognition_service": true,
"com.sec.feature.cover.sview": true,
"android.hardware.telephony.ims.singlereg": true,
"android.hardware.sensor.accelerometer": true,
"android.software.controls": true,
"android.hardware.faketouch": true,
"com.sec.feature.battauthmanager": true,
"android.software.telecom": true,
"com.samsung.feature.audio_listenback": true,
"android.hardware.telephony.subscription": true,
"android.software.contextualsearch": true,
"android.hardware.telephony.euicc": true,
"android.hardware.usb.accessory": true,
"android.hardware.telephony.data": true,
"android.software.backup": true,
"android.hardware.touchscreen": true,
"android.hardware.touchscreen.multitouch": true,
"android.software.erofs": true,
"android.software.print": true,
"android.software.activities_on_secondary_displays": true,
"com.sec.feature.nfc_authentication_cover": true,
"android.hardware.wifi.rtt": true,
"com.samsung.feature.SAMSUNG_EXPERIENCE": true,
"com.google.android.feature.ACCESSIBILITY_PRELOAD": true,
"com.sec.feature.nfc_authentication": true,
"android.software.voice_recognizers": true,
"android.software.picture_in_picture": true,
"android.hardware.fingerprint": true,
"com.samsung.android.knox.knoxsdk": true,
"android.hardware.sensor.gyroscope": true,
"android.hardware.audio.low_latency": true,
"android.software.vulkan.deqp.level": true,
"android.software.cant_save_state": true,
"android.hardware.security.model.compatible": true,
"android.hardware.telephony.messaging": true,
"com.samsung.feature.device_category_phone": true,
"com.samsung.android.nfc.t4temul": true,
"android.hardware.telephony.calling": true,
"android.hardware.opengles.aep": true,
"com.sec.feature.sensorhub": true,
"android.hardware.bluetooth": true,
"android.software.window_magnification": true,
"android.hardware.telephony.radio.access": true,
"android.hardware.camera.autofocus": true,
"android.hardware.telephony.gsm": true,
"android.hardware.telephony.ims": true,
"com.sec.feature.cocktailpanel": true,
"android.software.incremental_delivery": true,
"android.software.sip.voip": true,
"android.hardware.se.omapi.ese": true,
"android.software.opengles.deqp.level": true,
"com.sec.feature.saccessorymanager": true,
"com.samsung.feature.samsung_experience_mobile": true,
"com.samsung.android.camerasdkservice": true,
"com.samsung.android.camera.cameraserviceworker": true,
"android.hardware.camera.concurrent": true,
"android.hardware.usb.host": true,
"android.hardware.audio.output": true,
"android.software.verified_boot": true,
"android.hardware.camera.flash": true,
"android.hardware.camera.front": true,
"android.hardware.se.omapi.uicc": true,
"android.hardware.strongbox_keystore": true,
"android.hardware.screen.portrait": true,
"com.google.android.feature.ASI": true,
"android.hardware.nfc": true,
"com.google.android.feature.TURBO_PRELOAD": true,
"com.samsung.feature.ipsgeofence": true,
"com.nxp.mifare": true,
"com.samsung.feature.SAMSUNG_EXPERIENCE_AM": true,
"android.hardware.sensor.stepdetector": true,
"android.software.home_screen": true,
"vendor.android.hardware.camera.preview-dis.back": true,
"android.hardware.microphone": true,
"com.sec.feature.cover.clearcameraviewcover": true,
"com.samsung.feature.aremoji.v2": true,
"android.software.autofill": true,
"com.samsung.android.sdk.camera.processor.effect": true,
"android.software.securely_removes_users": true,
"android.hardware.bluetooth_le": true,
"android.hardware.sensor.compass": true,
"android.hardware.touchscreen.multitouch.jazzhand": true,
"android.hardware.sensor.barometer": true,
"android.software.app_widgets": true,
"android.software.input_methods": true,
"android.hardware.sensor.light": true,
"android.hardware.vulkan.version": true,
"android.software.companion_device_setup": true,
"com.samsung.feature.galaxyfinder_v7": true,
"com.sec.feature.wirelesscharger_authentication": true,
"android.software.device_admin": true,
"android.hardware.wifi.passpoint": true,
"android.hardware.camera": true,
"android.software.credentials": true,
"android.hardware.screen.landscape": true,
"com.google.android.feature.AER_OPTIMIZED": true,
"android.hardware.ram.normal": true,
"com.samsung.feature.samsungpositioning.snlp": true,
"com.samsung.android.authfw": true,
"com.samsung.android.api.version.2402": true,
"com.samsung.android.api.version.2403": true,
"com.samsung.android.api.version.2501": true,
"com.samsung.android.api.version.2502": true,
"com.samsung.android.api.version.2601": true,
"com.samsung.android.api.version.2701": true,
"com.samsung.android.api.version.2801": true,
"com.samsung.android.api.version.2802": true,
"com.samsung.android.api.version.2803": true,
"com.samsung.android.api.version.2901": true,
"com.samsung.android.api.version.2902": true,
"com.samsung.android.api.version.2903": true,
"com.samsung.android.api.version.3001": true,
"com.samsung.android.api.version.3002": true,
"com.samsung.android.api.version.3101": true,
"com.samsung.android.api.version.3201": true,
"com.samsung.android.api.version.3301": true,
"com.samsung.android.api.version.3302": true,
"com.samsung.android.api.version.3401": true,
"com.sec.feature.cover": true,
"android.software.managed_users": true,
"com.sec.feature.nsflp": true,
"android.software.webview": true,
"android.hardware.sensor.stepcounter": true,
"android.hardware.camera.capability.manual_post_processing": true,
"android.hardware.camera.any": true,
"android.hardware.camera.capability.raw": true,
"android.hardware.vulkan.compute": true,
"android.software.connectionservice": true,
"android.hardware.touchscreen.multitouch.distinct": true,
"android.hardware.location.network": true,
"com.sec.android.secimaging": true,
"android.software.cts": true,
"android.software.sip": true,
"android.hardware.camera.capability.manual_sensor": true,
"android.software.app_enumeration": true,
"android.hardware.camera.level.full": true,
"com.sec.feature.usb_authentication": true,
"android.hardware.wifi.direct": true,
"android.software.live_wallpaper": true,
"com.sec.feature.pocketmode": true,
"android.software.ipsec_tunnels": true,
"android.software.freeform_window_management": true,
"android.hardware.audio.pro": true,
"android.hardware.nfc.hcef": true,
"android.hardware.nfc.uicc": true,
"com.samsung.feature.support_repair_mode": true,
"android.hardware.location.gps": true,
"com.samsung.android.camera.deviceinjector": true,
"android.software.midi": true,
"com.samsung.feature.samsungpositioning": true,
"android.hardware.nfc.any": true,
"android.hardware.nfc.ese": true,
"android.hardware.nfc.hce": true,
"android.hardware.hardware_keystore": true,
"android.hardware.wifi": true,
"android.hardware.location": true,
"android.hardware.vulkan.level": true,
"android.hardware.keystore.app_attest_key": true,
"com.sec.feature.cover.flip": true,
"com.samsung.android.cameraxservice": true,
"com.samsung.android.knox.knoxsdk.api.level.33": true,
"com.samsung.android.knox.knoxsdk.api.level.34": true,
"com.samsung.android.knox.knoxsdk.api.level.35": true,
"com.samsung.android.knox.knoxsdk.api.level.36": true,
"com.samsung.android.knox.knoxsdk.api.level.37": true,
"android.hardware.wifi.aware": true,
"android.software.secure_lock_screen": true,
"android.hardware.biometrics.face": true,
"com.samsung.feature.EXPERIENCE_CTS": true,
"android.hardware.telephony": true,
"com.sec.android.smartface.smart_stay": true,
"android.software.file_based_encryption": true,
"glEsVersion": "3.2"
},
"ENVIRONMENT": {
"getDataDirectory": "/data",
"getDataSystemDirectory": "/data/system",
"getDownloadCacheDirectory": "/data/cache",
"getExternalStorageDirectory": "/storage/emulated/0",
"getExternalStorageState": "mounted",
"getInternalMediaDirectories": "[/system/media, /oem/media, /product/media, /omr/res, /data/overlays/media]",
"getLegacyExternalStorageDirectory": "/sdcard",
"getOdmDirectory": "/odm",
"getOemDirectory": "/oem",
"getProductDirectory": "/product",
"getProductServicesDirectory": "/product_services",
"getRootDirectory": "/system",
"getStorageDirectory": "/storage",
"getSystemExtDirectory": "/system_ext",
"getVendorDirectory": "/vendor",
"isExternalStorageEmulated": true,
"isExternalStorageLegacy": false,
"isExternalStorageManager": false,
"isExternalStorageRemovable": false
},
"SHARED_PREFERENCES": {
"default": "empty"
}
}
It would be great to get screen touch points as x, y coordinates in realtime using sockets.
Additional could be Multi point touch stream.
I was using IP WebCam to fetch sensor data over https, and my code was able to clear previous graphs from left side while new graphs are plotting from right side of screen as shown in below video.
But when I am running your code, it is not clearing instead it's squeezing as shown below.
python live_plot.py
C:\Users\Vicky\anaconda3\lib\site-packages\pyqtgraph\colors\palette.py:1: RuntimeWarning: PyQtGraph supports Qt version >= 5.15, but 5.9.7 detected.
from ..Qt import QtGui
connected to : 192.168.0.102:8080
Why, when I set the sample rate to 500000 microseconds, does the data come in much more often than twice per second?
websocat.x86_64-pc-windows-gnu.exe ws://192.168.4.44:8080/sensor/connect?type=android.sensor.accelerometer
{"values":[0.251,4.209,5.818],"accuracy":3,"timestamp":1621374624190440}
{"values":[0.366,4.745,4.899],"accuracy":3,"timestamp":1621374645422133}
{"values":[0.481,4.324,3.884],"accuracy":3,"timestamp":1621374666618445}
{"values":[-0.303,6.009,4.573],"accuracy":3,"timestamp":1621374687813666}
{"values":[0.232,5.779,6.891],"accuracy":3,"timestamp":1621374709009359}
{"values":[1.075,4.668,8.347],"accuracy":3,"timestamp":1621374730205508}
{"values":[0.443,4.688,8.845],"accuracy":3,"timestamp":1621374751401281}
{"values":[0.423,4.573,9.189],"accuracy":3,"timestamp":1621374772616441}
{"values":[0.921,4.209,9.879],"accuracy":3,"timestamp":1621374793784571}
{"values":[0.998,4.056,10.224],"accuracy":3,"timestamp":1621374814976873}
{"values":[0.826,4.056,9.975],"accuracy":3,"timestamp":1621374836151340}
{"values":[0.749,4.036,10.128],"accuracy":3,"timestamp":1621374857396960}
{"values":[0.998,4.017,9.783],"accuracy":3,"timestamp":1621374878596889}
{"values":[0.711,4.17,8.538],"accuracy":3,"timestamp":1621374899765047}
{"values":[0.423,4.285,7.466],"accuracy":3,"timestamp":1621374920994965}
{"values":[0.423,4.151,6.968],"accuracy":3,"timestamp":1621374942210585}
{"values":[0.309,3.941,6.738],"accuracy":3,"timestamp":1621374963401508}
{"values":[0.136,3.596,7.676],"accuracy":3,"timestamp":1621374984600364}
{"values":[0.73,3.021,8.787],"accuracy":3,"timestamp":1621375005796903}
{"values":[0.462,2.734,8.462],"accuracy":3,"timestamp":1621375026993143}
{"values":[-0.112,2.389,8.308],"accuracy":3,"timestamp":1621375048188676}
{"values":[0.136,1.834,8.653],"accuracy":3,"timestamp":1621375069382922}
{"values":[0.787,1.067,9.438],"accuracy":3,"timestamp":1621375090584230}
{"values":[0.634,0.569,10.454],"accuracy":3,"timestamp":1621375111785080}
{"values":[0.079,0.32,11.277],"accuracy":3,"timestamp":1621375132985926}
{"values":[-0.016,-0.023,12.484],"accuracy":3,"timestamp":1621375154186403}
{"values":[0.404,-0.464,14.955],"accuracy":3,"timestamp":1621375175386643}
{"values":[1.592,-0.56,16.411],"accuracy":3,"timestamp":1621375196586258}
{"values":[-1.299,0.512,6.91],"accuracy":3,"timestamp":1621375217783643}
{"values":[-0.533,0.455,10.837],"accuracy":3,"timestamp":1621375238983032}
{"values":[-0.054,0.148,10.454],"accuracy":3,"timestamp":1621375260182807}
{"values":[0.098,0.167,9.841],"accuracy":3,"timestamp":1621375281384052}
{"values":[-0.15,0.225,10.109],"accuracy":3,"timestamp":1621375302584903}
{"values":[-0.476,0.263,10.013],"accuracy":3,"timestamp":1621375323785980}
{"values":[-0.131,0.167,10.051],"accuracy":3,"timestamp":1621375344986980}
{"values":[-0.15,0.206,10.013],"accuracy":3,"timestamp":1621375366187369}
{"values":[-0.15,0.206,10.051],"accuracy":3,"timestamp":1621375387387835}
{"values":[-0.131,0.206,10.051],"accuracy":3,"timestamp":1621375408588686}
{"values":[-0.189,0.206,10.013],"accuracy":3,"timestamp":1621375429788153}
{"values":[-0.15,0.206,9.994],"accuracy":3,"timestamp":1621375450988065}
{"values":[-0.169,0.167,10.09],"accuracy":3,"timestamp":1621375472185911}
{"values":[-0.15,0.206,10.051],"accuracy":3,"timestamp":1621375493382137}
{"values":[-0.15,0.206,10.051],"accuracy":3,"timestamp":1621375514574829}
{"values":[-0.169,0.167,10.032],"accuracy":3,"timestamp":1621375535772147}
{"values":[-0.208,0.206,10.032],"accuracy":3,"timestamp":1621375556970696}
{"values":[-0.169,0.186,10.071],"accuracy":3,"timestamp":1621375578170768}
Hello,
The server app is running, the right ws url is introduced in the ws test app, the client and server are on the same network, but nothing happens, it remains disconnected at every atttempt.
Hi, thank you for working on this amazing app!
I have a wireguard network, where my PC is 10.219.135.1 and my smartphone is 10.219.135.2
Your app forces user to have Wi-Fi enabled, but Wi-Fi is absolutely not necessary when using VPN.
I tried checking the Local Host checkbox, but then it only listens to localhost and wg doesn't work either.
Could you add an option to listen on 0.0.0.0, so that users can use VPNs?
Crash report received via email
version v5.2.0
Android 14
java.lang.RuntimeException: Unable to start service github.umer0586.sensorserver.service.SensorService@dbf14d7 with null: java.lang.NullPointerException: Parameter specified as non-null is null: method github.umer0586.sensorserver.service.SensorService.onStartCommand, parameter intent\n\tat android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5286)\n\tat android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:2531)\n\tat android.os.Handler.dispatchMessage(Handler.java:106)\n\tat android.os.Looper.loopOnce(Looper.java:230)\n\tat android.os.Looper.loop(Looper.java:319)\n\tat android.app.ActivityThread.main(ActivityThread.java:8893)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)\nCaused by: java.lang.NullPointerException: Parameter specified as non-null is null: method github.umer0586.sensorserver.service.SensorService.onStartCommand, parameter intent\n\tat github.umer0586.sensorserver.service.SensorService.onStartCommand(Unknown Source:2)\n\tat android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5268)\n\t... 9 more\n
It would be great if the server wasn't shutting down after we close the app.
And a "start on boot" option would be useful too.
(sorry if opening an issue wasn't necessary for this, I don't really know how github works.)
Could you add sonar as a sensor, like in the "Sleep As Android" program?
(For these purposes, they use a built-in speaker, microphone and frequencies above 20 kHz.)
Can I use this app using HTTP API? (POST/GET)
Hi! This would be a very useful feature...
The app is now available in the main repo, see https://f-droid.org/en/packages/github.umer0586.sensorserver/
Please use a F-Droid badge with this link in the README here.
Last release now includes Bugsnag, which triggered an alert here in my repo (where your app is listed. Is it configured opt-in, or transmitting data by default? What data is transmitted, and is that transparent to the user (e.g. details are shown and user then can decide to send or not)?
Hi,
I noticed during trying out the app/websocket, I noticed, the step_detector is absent. It's mentioned in the readme-ov-file#usage section.
I choose it due to it's mentioned step detector "capability".
My question:
Is there any chance the step detection gets added? At the moment it's t he single reason why I choose this fairly quick without thinking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.