Jump to content

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


zitronen

Recommended Posts

 

On 10/27/2016 at 2:04 AM, Soulis6 said:

I am having a problem however getting the throttle to work. I am on windows 10, which may be causing problems, but everything else is working so far (SAS controls, LED warning lights, staging), so i'm not totally sure. I did try the debug tool that KingLuxor made and that wouldn't connect to the serial port. 

Has anyone else had any problems like this? It seems like things mostly work, except for the throttle and debug tool.

Are you using genuine arduino's or things ordered off amazon / ebay?

5 hours ago, c4ooo said:

I recently ordered some arduinos, so hopefully i'll be able to make a mini control panel or something :) (Unfortunately shipping from china takes ages :( )

To make sure i understand correctly, the arduinos and computer is linked via a USB cable, right? In the posts above there was a mention of a " usb->ttl adapter", not sure what that is :( 

Yes arduino's are connected via a usb cable but there are some issues that I'll outline below that make a usb ttl adapter needed.

A usb ttl adapter is basically a usb thing that converts usb commands into serial commands which allows you to control an arduino. All arduinos have one built in but a driver issue makes the genuine arduino not work correctly on Win10 so the question above actually matters in this case because most ebay / amazon ones tend to use what's cheaper since they're selling it for cheaper, however in this case the cheaper usb to serial adapter works better. So you're bypassing the bulit in arduino usb serial adapter for a cheaper one that works with win 10.

Link to comment
Share on other sites

9 hours ago, ryan00793 said:

Yes arduino's are connected via a usb cable but there are some issues that I'll outline below that make a usb ttl adapter needed.

A usb ttl adapter is basically a usb thing that converts usb commands into serial commands which allows you to control an arduino. All arduinos have one built in but a driver issue makes the genuine arduino not work correctly on Win10 so the question above actually matters in this case because most ebay / amazon ones tend to use what's cheaper since they're selling it for cheaper, however in this case the cheaper usb to serial adapter works better. So you're bypassing the bulit in arduino usb serial adapter for a cheaper one that works with win 10.

Ohh ok. I was worried i had to buy more hardware :/

 

@Sputnix i was refering to these icons: http://imgur.com/6cO721V.png

Link to comment
Share on other sites

  • 2 weeks later...
Just now, wingcutangel said:

Hi. I have a problem with this plugin. Ive connected my arduino on COM2 and dropped the files in KSP/GameData/ folder but the RX and TX diodes never blink during the game. I have no idea why :/

Also, can you please tell us what OS you are using?

Link to comment
Share on other sites

Hmm also not working for me [on windows 7]. Looking through the log file, i see this:

Quote

[LOG 16:40:26.695] Error opening serial port COM1: CreateFile Failed: 2
[LOG 16:40:26.700] KSPSerialIO: trying port \??\Root#PORTS#0000#{86e0d1e0-8089-11d0-9ce4-08003e301f73} - COM11
[LOG 16:40:26.702] Error opening serial port COM11: CreateFile Failed: 2
[LOG 16:40:26.703] KSPSerialIO: trying port \??\Root#PORTS#0001#{86e0d1e0-8089-11d0-9ce4-08003e301f73} - COM12
[LOG 16:40:26.704] Error opening serial port COM12: CreateFile Failed: 2
[LOG 16:40:26.706] KSPSerialIO: trying port \Device\Serial2 - COM13
[LOG 16:40:26.707] Error opening serial port COM13: CreateFile Failed: 2

The arduino sketch i am compiling is KSPIODemo13.

 

(The arduino is connected through COM13)

 

PS: for some reason i the reply box is glitched and i cant get rid of the thing quote below :(

On 10/29/2016 at 3:30 AM, ryan00793 said:
 
Edited by c4ooo
Link to comment
Share on other sites

Here is my list of suggestions for this mod (in order of importance)

-Control SAS vectoring (prograde, retrograde, etc), also send this to the arduino.

-Send info needed to dock (not sure about what's needed)

-switch between orbital/surface/target mode on navball

-time warp controls 

-send state of conection (eg whether you have a connection to KSC)

 

Thank :)

If I figure out how to compile C# code, then I would be glad to give it a shot my self. (As the plugin is open source) :)

Link to comment
Share on other sites

1 hour ago, c4ooo said:

Here is my list of suggestions for this mod (in order of importance)

-Control SAS vectoring (prograde, retrograde, etc), also send this to the arduino.

-Send info needed to dock (not sure about what's needed)

-switch between orbital/surface/target mode on navball

-time warp controls 

-send state of conection (eg whether you have a connection to KSC)

 

Thank :)

If I figure out how to compile C# code, then I would be glad to give it a shot my self. (As the plugin is open source) :)

If you read thru the 60 odd pages (and I don't blame you if you didn't :P When I first joined up it was only about 30 I had to go thru :wink: ) - @zitronen commented: 

 

On 7/10/2015 at 8:09 AM, zitronen said:

Ok so we are using 189 out of 255 bytes in the packet, so 66 bytes left. It's not a disaster if we run out of bytes, since we can just add another packet. However, since RAM is very limited on the AVR chips (255 bytes is a large chunk of RAM!), I would still avoid using too much.

So we are running out of 'space' for what we can send / receive to the arduino and the game. 

Some of these are shortcuts which you could send as 'keystrokes' over the arduino; the others -- well, that's up for discussion with the almighty creator / curator  :D 

Link to comment
Share on other sites

Hi everyone. It's been a while scene I played around with the Arduino. I got everything hooked up for the warning LED demo. I can tell I am receiving a handshake (green led turns on for about a sec right before the Launch pad loads.) and I am getting a IO Awake and No Display Found notification on the top right of the screen. I am running Windows 10 and KSP 1.1.3 using a Arduino UNO. All LEDs have been tested so I know they work. I'm really running out of ideas as to why this won't talk. Any help would be appreciated. Thanks.

Link to comment
Share on other sites

Didn`t  Stibbons have some vectoring stuff for his navball? Maybe he can enlighten us about it. I would like to know more too :)  

Anyway, having more stuff is always nice (docking aid would be cool, but again, it only about target vectors. Damn vectors! :D ), but having more you need more compute power and also something to show that info. Not all the time you need all the info. 

 

Link to comment
Share on other sites

Just wondering, what is ControlPacket.AdditionalControlByte1/2 ? Can't seem to find a use for it in the code. 

Anyways, i got the plugin to send the SAS mode to the arduino correctly, working on receiving the mode now; will send a pull request when i finish :)

Link to comment
Share on other sites

28 minutes ago, Mattew said:

Didn`t  Stibbons have some vectoring stuff for his navball? Maybe he can enlighten us about it. I would like to know more too :) 

Different vectors. I was only interested in outputting orbital vectors to display on a navball, @c4ooo is talking about changing the SAS mode. 

My stuff is... not in a working state. I declined that pull request until I've picked up a better understanding of how things work behind the scenes.

Link to comment
Share on other sites

3 hours ago, Freakout242 said:

Hi everyone. It's been a while scene I played around with the Arduino. I got everything hooked up for the warning LED demo. I can tell I am receiving a handshake (green led turns on for about a sec right before the Launch pad loads.) and I am getting a IO Awake and No Display Found notification on the top right of the screen. I am running Windows 10 and KSP 1.1.3 using a Arduino UNO. All LEDs have been tested so I know they work. I'm really running out of ideas as to why this won't talk. Any help would be appreciated. Thanks.

Probably Windows 10 compatibility issue.

Edit: wait you are using 1.1.3? Which version of the plugin and arduino code are you using?

 

3 hours ago, c4ooo said:

Just wondering, what is ControlPacket.AdditionalControlByte1/2 ? Can't seem to find a use for it in the code. 

Anyways, i got the plugin to send the SAS mode to the arduino correctly, working on receiving the mode now; will send a pull request when i finish :)

They are just pace holders for things we have not implemented yet, prograde/retrograde could use them at some point.

If you can get them working that would be great. All the SAS control stuff should fit in one byte, so shouldn't be too bad for packet size.

Edited by zitronen
Link to comment
Share on other sites

9 hours ago, Freakout242 said:

 I can tell I am receiving a handshake (green led turns on for about a sec right before the Launch pad loads.) and I am getting a IO Awake and No Display Found notification

This is 100% behavior of kspio on w10. LED turn on and off during loading and thus plugin start means your arduino recived handshake (like "hey, are you KSP Display?") but whatever reason on win10 even your display respond correctly ("yes I am KSP Display") plugin will ignore it. Sadly no permanent fix atm. Workaround 1: disable handshake and only recive data. Workaround 2: get ch340 usb-ttl convertor (1$ on ebay) 

 

8 hours ago, stibbons said:

Different vectors. I was only interested in outputting orbital vectors to display on a navball, @c4ooo is talking about changing the SAS mode. 

My stuff is... not in a working state. I declined that pull request until I've picked up a better understanding of how things work behind the scenes.

Aaaah, sad to hear. I was interested more in your work. Realy cool stuff!  

About SAS mode and etc. Here is link to topic about "same" issue. Somebody try to make keybinds. I am not expert but i belive those exact commands could be impleneted and send in packet by ksoio. Looks simple enought :)  

 

Link to comment
Share on other sites

10 hours ago, Mattew said:

This is 100% behavior of kspio on w10. LED turn on and off during loading and thus plugin start means your arduino recived handshake (like "hey, are you KSP Display?") but whatever reason on win10 even your display respond correctly ("yes I am KSP Display") plugin will ignore it. Sadly no permanent fix atm. Workaround 1: disable handshake and only recive data. Workaround 2: get ch340 usb-ttl convertor (1$ on ebay) 

 

 

 From what I was reading, I thought that the Windows 10 glitch was for inputs to KSP only.

Link to comment
Share on other sites

@Mattew is correct, you need to disable handshake in the cfg file, and manually set the COM port in there as well, then it will work but without inputs. I probably need to add something to the first post to explain it better.

Also 18.3 is not compatible with KSP 1.1, please see first post for info.

Edited by zitronen
Link to comment
Share on other sites

1 hour ago, zitronen said:

@Mattew is correct, you need to disable handshake in the cfg file, and manually set the COM port in there as well, then it will work but without inputs. I probably need to add something to the first post to explain it better.

Also 18.3 is not compatible with KSP 1.1, please see first post for info.

Setting it to 1 will disable the handshake, correct? And I should set the com port to the same one the arduino software uses to upload sketches?

Link to comment
Share on other sites

Do you guys think the arduino should receive what autopilot modes are available? 

Edit: setting / receiving SAS stuff works now :)

Edit 2: Pull request (hopefully) created :) [And hopefully works :P ]

Edited by c4ooo
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...