Jump to content

[Hardware, Plugin] Arduino based physical display + serial port io+ tutorial (24-11-19)


zitronen

Recommended Posts

Hey everyone :)

In case other people are also wanting to work with the current SOI, I have worked out a way to calculate it.

Holy cow that's awesome, you should post your project in mulbin's thread: http://forum.kerbalspaceprogram.com/threads/66763-Custom-hardware-simpit-repository-For-people-who-take-KSP-a-little-too-far

I have thought about sending the SOI with a byte, with each number representing a body. Will have to think about it some more.

Link to comment
Share on other sites

I've been making very slow progress on my controller. But finally found some time last week to get the first few panels cut, and this week I wired up the staging interface and had a quick stab at writing some software for it. It even mostly works!

Link to comment
Share on other sites

RX is blinking, so the plugin is sending data to the board.

Check! All fine so far...

Check! Still just as you describe...

Nope. No green LED (but I know it works from the handshake on the main menu).

Nope, no lights at all during flight :(

Hi. I've the same problem. And I tried to launch from VAB, and it didn't work.

My kerbal is the last version, 0.24.2.559 and i'm using Arduino Uno.

Thanks.

Link to comment
Share on other sites

Can you post the debug log? (Press Alt+F2)

[LOG 13:35:46.429] KSPSerialIO: Roll 0

[LOG 13:35:46.429] KSPSerialIO: Pitch 90

[LOG 13:35:46.430] KSPSerialIO: Heading 0.3995374

[LOG 13:35:46.514] KSPSerialIO: Roll 0

[LOG 13:35:46.515] KSPSerialIO: Pitch 90

[LOG 13:35:46.515] KSPSerialIO: Heading 0.3995374

[LOG 13:35:46.595] KSPSerialIO: Roll 0

[LOG 13:35:46.596] KSPSerialIO: Pitch 90

[LOG 13:35:46.597] KSPSerialIO: Heading 0.3995374

[LOG 13:35:46.679] KSPSerialIO: Roll 0

[LOG 13:35:46.680] KSPSerialIO: Pitch 90

[LOG 13:35:46.680] KSPSerialIO: Heading 0.3995374

[LOG 13:35:46.762] KSPSerialIO: Roll 0

[LOG 13:35:46.763] KSPSerialIO: Pitch 90

[LOG 13:35:46.763] KSPSerialIO: Heading 0.3995374

[LOG 13:35:46.846] KSPSerialIO: Roll 0

[LOG 13:35:46.846] KSPSerialIO: Pitch 90

[LOG 13:35:46.847] KSPSerialIO: Heading 0.3995374

[LOG 13:35:46.929] KSPSerialIO: Roll 0

[LOG 13:35:46.929] KSPSerialIO: Pitch 90

[LOG 13:35:46.930] KSPSerialIO: Heading 0.3995374

Is it only doing Roll, pitch and heading?

Link to comment
Share on other sites

Not so weekly "Weekly" update 13

Changes: Re-uploaded the correct files for 0.15.3 and Arduino demo8!!!

Oops, there were some problems with the latest version. I accidentally uploaded the debug version for 0.15.3 and demo8, so it didn't work properly. If you have recently downloaded the plugin and Arduino code, you need to re-download them again. Really sorry about that.

Link to comment
Share on other sites

Not so weekly "Weekly" update 13

Changes: Re-uploaded the correct files for 0.15.3 and Arduino demo8!!!

Oops, there were some problems with the latest version. I accidentally uploaded the debug version for 0.15.3 and demo8, so it didn't work properly. If you have recently downloaded the plugin and Arduino code, you need to re-download them again. Really sorry about that.

Great. I will give it a try later. Thank you.

Link to comment
Share on other sites

Ok I've been stalking this thread for a long long while now and my other AVR projects are coming to an end so its time to start this one ;).

Question: Any idea if / which other *duino clones are supported by the plugin? My guess is that any ATMega328p with on-board USB-to-serial converter should work. Or are there any other requirements that I don't see? If not I'd prefer to solder my own circuit with the ATMega328p and a USB-to-serial converter.

A bit of background: I'll be using this plugin only to display telemetry data on a ton of 7-segment displays. For controls I have another project almost finished that will act as combined joystick/keyboard to the computer so I don't need this plugin for that. (The benefit of the other controller being that it's not limited to KSP since its a generic USB-HID device).

Thanks a lot for any advice and for the plugin as a whole!

Link to comment
Share on other sites

Of course you don't need to use an Arduino. I'm not, I made my own clone board. I made this thread mostly for beginners. You can use rasberry pi, beaglbone, avr, pic, you can even send the data via bluetooth serial to your phone. As long as your device can receive serial data you should be fine.

All you need to do is to have whatever device you chose receive and read the serial packet, which is explained in the first post. You can use the arduino code as a starting point, but obviously you are on your own with the code.

Link to comment
Share on other sites

Thanks for the clarification. I actually had some time to play a little with the Arduino code and managed the display the vessel altitude on a prototyping board pretty much straight away. Looks like tweaking this to my plan will be easier than I thought although I'm not looking forward to translate the whole thing to AVR C ;) - nothing wrong with your code by the way, it's just generally tedious and error prone. I'll make sure to keep my inputs in this thread as I do along with the development.

Also, expect a git repository when I'm done. CC BY will be maintained of course with proper credits.

Link to comment
Share on other sites

Hello,

First of all: Thanks for your plugin. It really brought me into tinkering with microcontrollers and serial communication.

Now to my problem: Is your mod working with 0.24.2? I experience the same issue Mulbin had.

With 0.23.5 Everything works as intended, as soon as i fire up my 0.24.2 i get the "RX constantly flashing, TX dead" behaviour

that is described earlier in this thread.

I tried the following:

  • Removing all mods except KSPSerialIO
  • Changed the delay in the config (up to 40 seconds, confirmed new value via debug-console in main-screen)
  • Changed baud-rate
  • Changed value of #define IDLETIMER
  • Changed value of #define CONTROLREFRESH
  • Tried 0.24.2 32bit and 64bit

I receive the message, that the COM5-port is used (correct port), as soon as the scene is loaded and then the RX-flashery starts.

Here is the KSP-Log of my (unmodded) 0.24.2 Game: http://pastebin.com/hFqVR3Tk

Any hints on what this may cause? Any help is really appreciated :)

Link to comment
Share on other sites

If you are talking about RCS, SAS, etc., I don't know how to get the status from the game.

I might have missed a more recent post on this, but did you figure out how to display the current state of things like SAS, RCS, GEAR, LIGHT...? I realized I have a bit of space on my hardware for status lights and was wondering whether those might be coming in a future update?

Link to comment
Share on other sites

Sorry im a bit confused on how you connect the arduino do you just plug the board in run the sketch run ksp and it does it autmagically or is there more involved. Thanks

Pretty much.

Install the KSPIO mod into KSP.

Upload the sketch to the Arduino

Start KSP.

It'll automatically connect once you load a vessel (so not in VAB etc)

Link to comment
Share on other sites

Hello,

First of all: Thanks for your plugin. It really brought me into tinkering with microcontrollers and serial communication.

Now to my problem: Is your mod working with 0.24.2? I experience the same issue Mulbin had.

With 0.23.5 Everything works as intended, as soon as i fire up my 0.24.2 i get the "RX constantly flashing, TX dead" behaviour

that is described earlier in this thread.

I tried the following:

  • Removing all mods except KSPSerialIO
  • Changed the delay in the config (up to 40 seconds, confirmed new value via debug-console in main-screen)
  • Changed baud-rate
  • Changed value of #define IDLETIMER
  • Changed value of #define CONTROLREFRESH
  • Tried 0.24.2 32bit and 64bit

I receive the message, that the COM5-port is used (correct port), as soon as the scene is loaded and then the RX-flashery starts.

Here is the KSP-Log of my (unmodded) 0.24.2 Game: http://pastebin.com/hFqVR3Tk

Any hints on what this may cause? Any help is really appreciated :)

Have you tried this: http://forum.kerbalspaceprogram.com/threads/66393-Hardware-Plugin-Arduino-based-physical-display-serial-port-io-tutorial-%2808-Sep%29?p=1401709&viewfull=1#post1401709

Make sure you re-download both the plugin and the arduino code.

Link to comment
Share on other sites

Thanks for your reply. It's greatly appreciated.

I've downloaded the version 0.15.3 from your first post (recommended stable), with the corresponding demo8 arduino code, that i used as a base for my code.

I am using the same version with my 0.23.5 setup, where everything works fine. Is it possible, that another mod

causes this behaviour? If so, how do i check? What can i do to help you helping me? :D

Link to comment
Share on other sites

Thanks for your reply. It's greatly appreciated.

I've downloaded the version 0.15.3 from your first post (recommended stable), with the corresponding demo8 arduino code, that i used as a base for my code.

I am using the same version with my 0.23.5 setup, where everything works fine. Is it possible, that another mod

causes this behaviour? If so, how do i check? What can i do to help you helping me? :D

Not quite sure if this will be helpful to you but I've downloaded V0.15.3 just like you did, installed it in 24.2 without any other mods and it was working fine from what I could tell within an hour or so (only displaying data such as altitude, not using the controls).

Anyway, a simple but boring way to find out whether mods conflict with KSPIO is this:

First, upload a clean copy of the demo8 code onto your arduino and see if that works with all your mods. If it does, the problem is in your Arduino code.

If not:

- make a copy of your whole KSP folder

- clear the GameData directory of any mods

- install the KSPIO mod from a fresh download

- upload the unaltered demo code from the first post in this thread onto your microcontroller

- start KSP and see whether KSPIO works (it should)

- if it does, shut KSP down and copy one mod from your "original" KSP folder to the test environment. Restart KSP and see if it works.

- rinse and repeat the previous step

- if a mod breaks KSP/KSPIO, delete it again, take a note and continue with the next mod

That way you can easily isolate all mods that are conflicting. It's a bit tedious but very straight forward.

Link to comment
Share on other sites

[...]

First, upload a clean copy of the demo8 code onto your arduino and see if that works with all your mods. If it does, the problem is in your Arduino code.

[...]

Big thanks for pointing that out. Looks like something is wrong with my arduino code. Though i can not figure out what right now.

With Demo8-Code, my controls are working, with my code, the indicators are working. Guess i have to merge that now somehow...

Back to the drawing board for me :)

Thank you, for your help.

Link to comment
Share on other sites

Have you re-downloaded the demo 8 code lately (since 10 says ago)? If not you need to do that. There was a version mismatch since I uploaded the wrong code.

If you have problems with indicators it seems like you have the wrong version.

You can easily check: the struct VesselData in the first arduino tab should have 45 elements in the new version.

Edited by zitronen
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...