Jump to content

DrMarcel

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by DrMarcel

  1. Cool project and I'm impressed, how simple the TCP connecting is implemented on STM devices. I have seen much worse on other microcontrollers. If you get trouble with high lantency you could set the TCP_NODELAY option for the socket. As I've seen there is a .set_option function for the socket class but I could't find further information how to call this. I had problems without the flag because my network adapter started to bundle many small packets to bigger ones.
  2. Oh, so much activity here . Thanks for all the response and sorry for my inactivity the last weeks. @Wakestrap : Cool project and congrats for the really fast progress you performed. I think creating a controller with a STM is very niche so thank you to share this project with us. @BamBam , @RowBear : I'm glad to hear that the App is working fine so far. I have only one device to test the App, so I'm really happy to see it's also working on other devices without any trouble. @f0restperson : Using a RaspberryPi as a control desk is possible, but not "out of the box". The server ( = the KSP Addon) doesn't care which device is connected to it, so it's possible to connect a RaspberryPi as well. But so far I have neither a RPI image nor some nearly finished source code for that. So there is some work to do on the client side. If you program the RPI in Java it's possible to use much code from the Android App without any change. The open ToDos of the App are nice to have but currently not essential. So I can not say when I will implement them. But if you recognize some bugs or have any pull requests for it, just contact me. The next thing I will focus on is the RPI client. Stay healthy and have a good flight
  3. Update 10.03.20: Release notes KSPEthernetIO 0.1.2 Bugfix: watchdogDisable bit didn't disable the watchdog, thanks @Wakestrap Fixed version counter: File version didn't match the version in the post (v1.x.0 -> v0.1.x)
  4. Hi Wakestrap, nice to hear you are using this project to create your controller. Implementing TCP on a microcontroller sounds very interesting. So far I have only worked with small PICs and Atmegas but never with network communication. I hope you share your results here Thanks for the info about the watchdog timer. You are totally right, the background worker of the packet handler doesn't check for the _watchdogDisable bit. I will fix this tomorrow and upload a new compiled version. If you need it today and compile the addon by yourself, you could change L362 of PacketHandler: if (_server.ClientConnected && (HandshakeReceived || _handshakeDisable) && !_watchdogDisable)
  5. Hi sandroxil, I randomly saw you were testing KSPEthernetIO and had problems connecting your mobile phone to KSP. Sorry, I don't speak spanish, but I would like to find the problem. If you still want to test it, here are some advices that might solve the problem: It would be helpful to know your operating system, KSP version and other installed mods. Make sure to have the latest version of the KSPEthernetIO installed. Version 1.0.0 is no longer compatible with the client version 0.2b in the PlayStore. Make sure the computer and the mobile phone are in the same WLAN. Make sure KSPEthernetIO is load properly on startup. After starting the game press "alt gr"+"F12" to open the ingame console. If you scroll up a bit there should appear the messages [KSPEthernetIO]: Waiting for TCP client... It may be necessary to open port 2342 for incoming connection on your computer. Maybe you could send me the KSP logfile "KSP.log" in the game installation folder. If you do so previously open KSP, wait for main menu to appear, try to connect with your mobile phone and then close KSP. If you have done that you can send the logfile to [email protected] . I'm also working on an RaspberryPi client, but this may take a while because currently I'm having exams and not that much time. But so far I have tested the Java client code on my computer on Eclipse and it seems to work. I'm thinking of using the Pi4J library to access the GPIO of the RaspberryPi. I'm also having a 1.2" 128x128px RGB oled here and I'm really excited about using that for an external Navball. [Translation - hopefully -.-] Hola sandroxil, Al azar, vi que estaba probando KSPEthernetIO y tuve problemas para conectar su teléfono móvil a KSP. Lo siento, no hablo español, pero me gustaría encontrar el problema. Si aún desea probarlo, aquí hay algunos consejos que podrían resolver el problema: Sería útil conocer su sistema operativo, la versión de KSP y otras modificaciones instaladas. Asegúrese de tener instalada la última versión de KSPEthernetIO. La versión 1.0.0 ya no es compatible con la versión del cliente 0.2b en PlayStore. Asegúrese de que la computadora y el teléfono móvil estén en la misma WLAN. Asegúrese de que KSPEthernetIO se cargue correctamente en el inicio. Después de comenzar el juego, presiona "alt gr" + "F12" para abrir la consola del juego. Si se desplaza un poco hacia arriba, deberían aparecer los mensajes [KSPEthernetIO]: Waiting for TCP client... Puede ser necesario abrir el puerto 2342 para la conexión entrante en su computadora. Tal vez podría enviarme el archivo de registro de KSP "KSP.log" en la carpeta de instalación del juego. Si lo hace, abra KSP anteriormente, espere a que aparezca el menú principal, intente conectarse con su teléfono móvil y luego cierre KSP. Si lo ha hecho, puede enviar el archivo de registro a [email protected]. También estoy trabajando en un cliente RaspberryPi, pero esto puede llevar un tiempo porque actualmente estoy haciendo exámenes y no tengo mucho tiempo. Pero hasta ahora he probado el código del cliente Java en mi computadora en Eclipse y parece funcionar. Estoy pensando en usar la biblioteca Pi4J para acceder al GPIO de RaspberryPi. También estoy teniendo un 1.2 "128x128px RGB oled aquí y estoy muy emocionado de usar eso para un Navball externo.
  6. Update 17.02.20: Release notes KSPEthernetIO Android client 0.2 beta KSPEthernetIO 0.1.1 Data is now synchronized on vessel change. Added vesselSync value in VesselData and ControlPacket. Sync value is increased by the host on every vessel change - the client mirrors the sync value so the client can synchronize with the preselected actiongroups of the new vessel to avoid bad things happening on vessel change. Custom action group names in App settings App settings now saved permanent on device Added new StatusPacket from host to client to transmit flight start and flight end Some color adjustments Added more orbital info Small bugfixes on navball velocity vectors The new App Version is not compatible with the initial KSPEthernetIO release. If you update the App you also have to update the KSP Add-On as well.
  7. Update 14.02.20: Added PlayStore link Added some TODOs Code documentation done (JavaDoc and xml summaries) New develop branch in Android Client git Some tidy up in Android Client (Matrix3x1 replaced by Vector class because of redundancy, some refactoring) The Android App is currently in beta state, so if there are any crashes, bugs or other issues contact me or send the crash reports. I can review the crash logs from the PlayStore console.
  8. Sorry for that, I didn't use this domain for some time and had SSL not enabled so far. Activated and changed link to https. Should work now, I double checked from another computer -.-
  9. Thanks for the response and the positive feedback I have changed the broken download link. Even after a reupload google drive filesharing didn't work. About the packet size: The payload is 29 bytes from client to host and 212 bytes from host to client. But there is some overhead by the TCP headers. The actual packet size is 83 and 266 bytes. But as you can see in the wireshark snippet below you don't get any overhead by the TCP ACK commands because they are automaticly bundled with the data packets. Currently I'm running very stable with 50ms refresh time on both sides. I've tried down to 20ms is still stable. The main problem is at some point the network adapter starts prebuffering small packets, so that more than one data packet is sent within the same TCP packet. When live rendering the packets that's equal to a packet loss. It's not possible to fully turn off this behaviour by software, so currently the refresh rate is limited somewhere above 10ms. A short look into wireshark also shows a high latency of ~15ms on the client side. You can see the host packet comes with stable 50ms but the client with the same settings is sending all 65ms with some jitter. I think a good improvement would be to buffer the incoming packages while measuring the average receive clock and the make some adaptive playout from the package buffer to get a "smooth and continous" data stream rather than rendering the data live. Than it wouldn't matter if more than one data package is bundled in the same TCP packet. I gonna test this out the next days.
  10. First of all thanks @zitronen. I really Like this project. Based on this project I have created an ethernet based version of KSPSerialIO with an Android client running on any mobile phone. With that all those who don't have the electrical equipment to build an Arduino input device can now simply use their mobile phones. In the next step I want to extend the App and also create a RaspberryPi client. If you are interested take a look at Maybe it's possible to add the link to the original post?
  11. Inspired by the original KSPSerialIO by @zitronen I wanted to create my own physical display and input device for KSP. My plan was to add an external Navball but the limited hardware of the Arduino makes it nearly impossible to do the vector calculation and rendering on it. So I decided to use a RaspberryPi. In first step I have edit the original KSPSerialIO to create a similar Add-On using a TCP connection for data exchange so that it's possible to connect any client in the same network with the host computer. The second step was to create and test a client application. I decided to use Java for the client to create an Android client as well as a RaspberryPi client with (nearly) the same code. Currently I'm testing the KSPEthernetIO Plug-In with the Android client. If this works reliable I start working on the RaspberryPi client. KSPEthernetIO [0.1.2]: Description: Opens a TCP server and sends broadcasts through the network. Waits for incoming connection. When connected performs optional handshake to verify client. Continously exchanges control and vessel data between client and host. Tested on Windows 7 and Windows 10 Tested with KSP 1.8.1 and 1.9 Functionality: All functions of the original KSPSerialIO Slighly extended version of the original KSPSerialIO data packets Automatic client detection via UDP broadcasts Connection control and automatic reconnect Some new functions (control camera and ui mode, open main menu, toggle map) Download: Add-On (Windows): v0.1.2: https://perske.eu/KSPEthernetIO-0.1.2.zip Source: https://github.com/DrMarcel/KSPEthernetIO Old versions: v0.1.0: https://perske.eu/KSPEthernetIO-0.1.0.zip v0.1.1: https://perske.eu/KSPEthernetIO-0.1.1.zip KSPEthernetIO Android client [0.2 beta]: Description: Remote control App for KSPEthernetIO. Automatic connect to a KSPEthernetIO host and remote control your vessel. Currently I can only provide a download link for the APK. I have uploaded the current version to the Android PlayStore but the release may take a few days. If you struggle to install an APK from an external source just wait a few days until I can provide a download link for the PlayStore. Edit: App is now avaiable in Google Playstore. Functionality: Live render navball Show vector nodes on navball Control SAS, RCS, ActionGroups, etc. Show velocity, altitude and some orbit information Show fuel states Change UI and Camera Mode Toggle Map Open Main Menu (a little bit hidden - long press the "..."-button for that) Download: PlayStore: https://play.google.com/store/apps/details?id=com.kspethernetiodemo APK: https://perske.eu/KSPEthernetIO-AndroidClient.0.2.zip Source: https://github.com/DrMarcel/KSPEthernetIO-Android-Client Old versions: APK: https://perske.eu/KSPEthernetIO-AndroidClient.0.1.zip Screenshots: Demo: KSPEthernetIO RaspberryPi Client: Description: Planned for the next weeks, currently wip. Additional information: Original post: Settings: <int name="Port">2342</int> <int name="Refresh">50</int> <int name="BroadcastDisable">0</int> <int name="Broadcast">1000</int> <int name="WatchdogDisable">0</int> <int name="WatchdogTimeout">1500</int> <int name="HandshakeDisable">0</int> <int name="HandshakeTimeout">1500</int> <int name="ThrottleEnable">2</int> <int name="PitchEnable">2</int> <int name="RollEnable">2</int> <int name="YawEnable">2</int> <int name="TXEnable">2</int> <int name="TYEnable">2</int> <int name="TZEnable">2</int> <int name="WheelSteerEnable">2</int> <int name="WheelThrottleEnable">2</int> <double name="SASTol">0.2</double> Port: Communication TCP port Refresh: Data send delay in milliseconds BroadcastDisable: 1=Disable sending broadcast messages Broadcast: Broadcast send delay in milliseconds WatchdogDisable: 1=Disable watchdog timer WatchdogTimeout: If no data is received within this time the connection is reset HandshakeDisable: 1=Accept all incoming connections HandshakeTimeout: If no data is received within this time after connection the connection is reset ThrottleEnable: enable value of throttle axis PitchEnable: enable value of pitch axis RollEnable: enable value of roll axis YawEnable: enable value of yaw axis TXEnable: enable value of translation X axis TYEnable: enable value of translation Y axis TZEnable: enable value of translation Z axis SASTol: The SAS will override your controls when you turn it on, this value allows you to override SAS if you move the roll pitch yaw control over a certain limit (10% travel by default) Enable value settings for axes: 0: The internal value (supplied by KSP) is always used 1: The external value (read from serial packet) is always used 2: If the internal value is not zero use it, otherwise use the external value 3: If the external value is not zero use it, otherwise use the internal value See above for default config Issues / TODOs: Bring client application to the PlayStore [12.02.2020] Add more orbital infos [17.02.2020] Permanent save app settings [17.02.2020] Custom actiongroup names in settings [17.02.2020] Centralize all coloring in config files Tests on different screen sizes Reset data on active vessel change - Transmit vessel ID ? [17.02.2020] Code documentation [14.02.2020] Clean compiler warning Buffer incoming data with adaptive playout to get "smooth" data stream Navball rendering is very CPU intense - Implement OpenGL rendering Split fight info in smaller classes License: CC BY 4.0 https://creativecommons.org/licenses/by/4.0 Epilogue: I hope you like this project. I'm happy about any feedback, bug reports and ideas. Have a good flight DrMarcel Edit: [10.02.2020] Changed broken download links [10.02.2020] Changed download link http->https [12.02.2020] Added playstore link [14.02.2020] Updated TODO list [17.02.2020] Release KSPEthernetIO 0.1.1 and Client 0.2 beta [10.03.2020] Changed version numbers 1.x.0 was actually 0.1.x [10.03.2020] Release KSPEthernetIO 0.1.2
×
×
  • Create New...