Jump to content

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


zitronen

Recommended Posts

Is it possible to damage an arduino in such a way that everything appears to be functional when tested.. but it stops communicating correctly with the plugin? Baffled as to what could have changed since this morning. Tried everything I can think of short of buying another mega.

EDIT - ok... some progress, just got it working with my old .23.0 game. Confused as hell as it was working fine with .23.5 this morning. Any known issues with the new build? Perhaps there is an intermittent bug?

Edited by Mulbin
Link to comment
Share on other sites

Is it possible you are running into a latency issue? I had similar issues and resolved them by changing the 'refresh' in the plugin's config.xml file. I started at 0.5 and worked it back down to 0.41. Also test your hand shaking delay.

- R

Is it possible to damage an arduino in such a way that everything appears to be functional when tested.. but it stops communicating correctly with the plugin? Baffled as to what could have changed since this morning. Tried everything I can think of short of buying another mega.

EDIT - ok... some progress, just got it working with my old .23.0 game. Confused as hell as it was working fine with .23.5 this morning. Any known issues with the new build? Perhaps there is an intermittent bug?

Link to comment
Share on other sites

Is it possible to damage an arduino in such a way that everything appears to be functional when tested.. but it stops communicating correctly with the plugin? Baffled as to what could have changed since this morning. Tried everything I can think of short of buying another mega.

EDIT - ok... some progress, just got it working with my old .23.0 game. Confused as hell as it was working fine with .23.5 this morning. Any known issues with the new build? Perhaps there is an intermittent bug?

Does it not work with my example code?

Link to comment
Share on other sites

This keeps getting stranger.

I tried updating the structs (I assume the ones in Demo 4 are correct?) and it made no difference. The only setup I can get working is your previous version running on .23 - but I definitely had it running on .23.5 for a while, just can't get it to any more.

Now here is the odd part, On the old version I have had mixed results, I have had everything working, but the last time only the dials worked, but none of the switches! So I seemed to have only one way serial working!!

A couple of questions...

Is it possible the plugin has issues trying to push this much data through? As far as I know my board is using more pins than anyone else.

Also, could power be an issue? Will the board start to struggle powering everything from USB?

I really want to avoid buying another mega just to test (and having to rewire!).

Link to comment
Share on other sites

Now here is the odd part, On the old version I have had mixed results, I have had everything working, but the last time only the dials worked, but none of the switches! So I seemed to have only one way serial working!!

A couple of questions...

Is it possible the plugin has issues trying to push this much data through? As far as I know my board is using more pins than anyone else.

Also, could power be an issue? Will the board start to struggle powering everything from USB?

If the dials are working then the output packet from KSP is correct, but the input from arduino is wrong. That make perfect sense be cause the old versions (0.13-0.14.1) had a different input format.

Check your settings file, did you change some settings by any chance? Also check and make sure your plugin is version 0.14.2 (version is shown in the debug log at launch). I just realized that the version on the first page is 0.14.1. The link for 14.2 was posted a couple pages ago. I will get all the versions straight when I get home.

Link to comment
Share on other sites

yes... but the switches work if I unplug the dials!... and the problem still happens when I istall the old version of KSPSerial AS WELL AS the old version of my arduino code...sometimes, more often I just get nothing at all. I'll do some more tests with 0.14.2

still confused as to how it was working one minute, then not the next... the only thing I did was change which USB port it was plugged into, which is what made me wonder if the board was faulty in some way.

Is the demo on the first page up to date?

Link to comment
Share on other sites

Downloaded 14.2 and still not working at all.

Here is my code, not sure if there is an issue or not as the control panel was working fine before and has stopped, seemingly with no change to anything.

//pins for LEDs
#define GLED 40
#define YLED 41
#define RLED 42
#define RCSLED 44
#define RCSWARNLED 43
#define RWLED 45
#define RWWARNLED 46
#define MONOWARNLED 47

//pins for input
#define RCSPIN 22
#define SASPIN 23
#define CG1PIN 24
#define CG2PIN 25
#define CG3PIN 26
#define CG4PIN 27
#define CG5PIN 28
#define CG6PIN 29
#define LIGHTPIN 30
#define BRAKEPIN 31
#define GEARPIN 32
#define CG7PIN 33
#define CG8PIN 34
#define CG9PIN 35
#define CG10PIN 36
#define ABORTPIN 37
#define STAGEPIN 38

//pins for gauges
#define MONOPIN 2
#define CHARGEPIN 3
#define DRAWPIN 4

#define THROTTLEDB 4 //Throttle axis deadband

#define SAS 7
#define RCS 6
#define LIGHTS 5
#define GEAR 4
#define BRAKES 3
#define PRECISION 2
#define ABORT 1
#define STAGE 0

//macro
#define details(name) (uint8_t*)&name,sizeof(name)

//if no message received from KSP for more than 2s, go idle
#define IDLETIMER 2000
#define CONTROLREFRESH 25

//warnings
#define GWARN 9 //9G Warning
#define GCAUTION 5 //5G Caution
#define FUELCAUTION 10.0 //10% Fuel Caution
#define FUELWARN 5.0 //5% Fuel warning

unsigned long deadtime, deadtimeOld, controlTime, controlTimeOld;
unsigned long now;

boolean Connected = false;

byte caution = 0, warning = 0, id;

struct VesselData
{
byte id; //1
float AP; //2
float PE; //3
float SemiMajorAxis; //4
float SemiMinorAxis; //5
float VVI; //6
float e; //7
float inc; //8
float G; //9
long TAp; //10
long TPe; //11
float TrueAnomaly; //12
float Density; //13
long period; //14
float RAlt; //15
float Alt; //16
float Vsurf; //17
float Lat; //18
float Lon; //19
float LiquidFuelTot; //20
float LiquidFuel; //21
float OxidizerTot; //22
float Oxidizer; //23
float EChargeTot; //24
float ECharge; //25
float MonoPropTot; //26
float MonoProp; //27
float IntakeAirTot; //28
float IntakeAir; //29
float SolidFuelTot; //30
float SolidFuel; //31
float XenonGasTot; //32
float XenonGas; //33
};

struct HandShakePacket
{
byte id;
byte M1;
byte M2;
byte M3;
};

struct ControlPacket {
byte id;
byte MainControls; //SAS RCS Lights Gear Brakes Precision Abort Stage
byte Mode; //0 = stage, 1 = docking, 2 = map
unsigned int ControlGroup; //control groups 1-10 in 2 bytes
byte AdditionalControlByte1; //other stuff
byte AdditionalControlByte2;
int Pitch; //-1000 -> 1000
int Roll; //-1000 -> 1000
int Yaw; //-1000 -> 1000
int TX; //-1000 -> 1000
int TY; //-1000 -> 1000
int TZ; //-1000 -> 1000
int Throttle; // 0 -> 1000
};

HandShakePacket HPacket;
VesselData VData;
ControlPacket CPacket;

void setup(){
Serial.begin(38400);

initLEDS();
InitTxPackets();
controlsInit();

LEDSAllOff();
}

void loop()
{
input();
output();
}


// Handshake

void Handshake(){
digitalWrite(GLED,HIGH);

HPacket.id = 0;
HPacket.M1 = 3;
HPacket.M2 = 1;
HPacket.M3 = 4;

KSPBoardSendData(details(HPacket));
//Serial.println(F("KSP;0"));
delay(1000);
}


void input() {
now = millis();

if (KSPBoardReceiveData()){
deadtimeOld = now;
switch(id) {
case 0: //Handshake packet
Handshake();
break;
case 1:
Indicators();
break;
}

//We got some data, turn the green led on
digitalWrite(GLED,HIGH);
Connected = true;
}
else
{ //if no message received for a while, go idle
deadtime = now - deadtimeOld;
if (deadtime > IDLETIMER)
{
deadtimeOld = now;
Connected = false;
LEDSAllOff();
}
}
}


uint8_t rx_len;
uint8_t * address;
byte buffer[256]; //address for temporary storage and parsing buffer
uint8_t structSize;
uint8_t rx_array_inx; //index for RX parsing buffer
uint8_t calc_CS; //calculated Chacksum

//This **** contains stuff borrowed from EasyTransfer lib
boolean KSPBoardReceiveData() {
if ((rx_len == 0)&&(Serial.available()>3)){
while(Serial.read()!= 0xBE) {
if (Serial.available() == 0)
return false;
}
if (Serial.read() == 0xEF){
rx_len = Serial.read();
id = Serial.read();
rx_array_inx = 1;

switch(id) {
case 0:
structSize = sizeof(HPacket);
address = (byte*)&HPacket;
break;
case 1:
structSize = sizeof(VData);
address = (byte*)&VData;
break;
}
}

//make sure the binary structs on both Arduinos are the same size.
if(rx_len != structSize){
rx_len = 0;
return false;
}
}

if(rx_len != 0){
while(Serial.available() && rx_array_inx <= rx_len){
buffer[rx_array_inx++] = Serial.read();
}
buffer[0] = id;

if(rx_len == (rx_array_inx-1)){
//seem to have got whole message
//last uint8_t is CS
calc_CS = rx_len;
for (int i = 0; i<rx_len; i++){
calc_CS^=buffer[i];
}

if(calc_CS == buffer[rx_array_inx-1]){//CS good
memcpy(address,buffer,structSize);
rx_len = 0;
rx_array_inx = 1;
return true;
}
else{
//failed checksum, need to clear this out anyway
rx_len = 0;
rx_array_inx = 1;
return false;
}
}
}

return false;
}

void KSPBoardSendData(uint8_t * address, uint8_t len){
uint8_t CS = len;
Serial.write(0xBE);
Serial.write(0xEF);
Serial.write(len);

for(int i = 0; i<len; i++){
CS^=*(address+i);
Serial.write(*(address+i));
}

Serial.write(CS);
}


void output() {
now = millis();
controlTime = now - controlTimeOld;
if (controlTime > CONTROLREFRESH){
controlTimeOld = now;
controls();
}
}

void controls() {
if (Connected) {

if (VData.MonoPropTot != 0)
analogWrite(MONOPIN, round(VData.MonoProp/VData.MonoPropTot*255));
else
analogWrite(MONOPIN, 0);

if (VData.EChargeTot != 0)
analogWrite(CHARGEPIN, round(VData.ECharge/VData.EChargeTot*255));
else
analogWrite(CHARGEPIN, 0);

if (VData.EChargeTot != 0)
analogWrite(DRAWPIN, round(VData.ECharge/VData.EChargeTot*255));
else
analogWrite(DRAWPIN, 0);

if (digitalRead(SASPIN))
MainControls(SAS, LOW);
else
MainControls(SAS, HIGH);

if (digitalRead(RCSPIN))
MainControls(RCS, LOW);
else
MainControls(RCS, HIGH);

if (!(digitalRead(RCSPIN)) && (VData.MonoProp ==0))
digitalWrite(RCSWARNLED, HIGH);
else
digitalWrite(RCSWARNLED, LOW);

if (!(digitalRead(RCSPIN)) && (VData.MonoProp >0))
digitalWrite(RCSLED, HIGH);
else
digitalWrite(RCSLED, LOW);

if (VData.MonoProp <=2)
digitalWrite(MONOWARNLED, HIGH);
else
digitalWrite(MONOWARNLED, LOW);

if (digitalRead(LIGHTPIN))
MainControls(LIGHTS, LOW);
else
MainControls(LIGHTS, HIGH);

if (digitalRead(GEARPIN))
MainControls(GEAR, LOW);
else
MainControls(GEAR, HIGH);

if (digitalRead(BRAKEPIN))
MainControls(BRAKES, LOW);
else
MainControls(BRAKES, HIGH);

if (digitalRead(ABORTPIN))
MainControls(ABORT, LOW);
else
MainControls(ABORT, HIGH);

if (digitalRead(STAGEPIN))
MainControls(STAGE, LOW);
else
MainControls(STAGE, HIGH);

if (digitalRead(CG1PIN))
ControlGroups(1, HIGH);
else
ControlGroups(1, LOW);

if (digitalRead(CG2PIN))
ControlGroups(2, LOW);
else
ControlGroups(2, HIGH);

if (digitalRead(CG3PIN))
ControlGroups(3, LOW);
else
ControlGroups(3, HIGH);

if (digitalRead(CG4PIN))
ControlGroups(4, LOW);
else
ControlGroups(4, HIGH);

if (digitalRead(CG5PIN))
ControlGroups(5, LOW);
else
ControlGroups(5, HIGH);

if (digitalRead(CG6PIN))
ControlGroups(6, LOW);
else
ControlGroups(6, HIGH);

if (digitalRead(CG7PIN))
ControlGroups(7, LOW);
else
ControlGroups(7, HIGH);

if (digitalRead(CG8PIN))
ControlGroups(8, LOW);
else
ControlGroups(8, HIGH);

if (digitalRead(CG9PIN))
ControlGroups(9, LOW);
else
ControlGroups(9, HIGH);

if (digitalRead(CG10PIN))
ControlGroups(10, LOW);
else
ControlGroups(10, HIGH);

KSPBoardSendData(details(CPacket));
}
}

void controlsInit() {
pinMode(SASPIN, INPUT_PULLUP);
pinMode(RCSPIN, INPUT_PULLUP);
pinMode(LIGHTPIN, INPUT_PULLUP);
pinMode(GEARPIN, INPUT_PULLUP);
pinMode(BRAKEPIN, INPUT_PULLUP);
pinMode(ABORTPIN, INPUT_PULLUP);
pinMode(STAGEPIN, INPUT_PULLUP);
pinMode(CG1PIN, INPUT_PULLUP);
pinMode(CG2PIN, INPUT_PULLUP);
pinMode(CG3PIN, INPUT_PULLUP);
pinMode(CG4PIN, INPUT_PULLUP);
pinMode(CG5PIN, INPUT_PULLUP);
pinMode(CG6PIN, INPUT_PULLUP);
pinMode(CG7PIN, INPUT_PULLUP);
pinMode(CG8PIN, INPUT_PULLUP);
pinMode(CG9PIN, INPUT_PULLUP);
pinMode(CG10PIN, INPUT_PULLUP);
pinMode(RCSLED, OUTPUT);
pinMode(RCSWARNLED, OUTPUT);
pinMode(MONOPIN, OUTPUT);
pinMode(CHARGEPIN, OUTPUT);
}

void MainControls(byte n, boolean s) {
if (s)
CPacket.MainControls |= (1 << n); // forces nth bit of x to be 1. all other bits left alone.
else
CPacket.MainControls &= ~(1 << n); // forces nth bit of x to be 0. all other bits left alone.
}

void ControlGroups(byte n, boolean s) {
if (s)
CPacket.ControlGroup |= (1 << n); // forces nth bit of x to be 1. all other bits left alone.
else
CPacket.ControlGroup &= ~(1 << n); // forces nth bit of x to be 0. all other bits left alone.
}


void Indicators() {
caution = 0;
warning = 0;

caution += VData.G > GCAUTION;
warning += VData.G > GWARN;
caution += VData.LiquidFuel/VData.LiquidFuelTot*100 < FUELCAUTION;
warning += VData.LiquidFuel/VData.LiquidFuelTot*100 < FUELWARN;

if (caution != 0)
digitalWrite(YLED,HIGH);
else
digitalWrite(YLED,LOW);

if (warning != 0)
digitalWrite(RLED,HIGH);
else
digitalWrite(RLED,LOW);
}

void initLEDS() {
pinMode(GLED,OUTPUT);
digitalWrite(GLED,HIGH);

pinMode(YLED,OUTPUT);
digitalWrite(YLED,HIGH);

pinMode(RLED,OUTPUT);
digitalWrite(RLED,HIGH);
}

void LEDSAllOff() {
digitalWrite(GLED,LOW);
digitalWrite(YLED,LOW);
digitalWrite(RLED,LOW);
}


void InitTxPackets() {
HPacket.id = 0;
CPacket.id = 1;
}

Link to comment
Share on other sites

The demo 4 on the first page should work with 0.14.2. If the demo works (LED and switch) then the plugin is working, it's something with your code or hardware.

Have you checked your wiring and voltages?

Also all your gauges and led code is in "controls()", which is in "output()". They should be in the "input()" function. Output is for switches and axes.

Link to comment
Share on other sites

The code is the same as when it was working 48 hours ago, but I'll swap them over to input in case it helps. I have completely stripped and replugged everything back in to the board. Might have to buy another cheap mega to test, I might have fried something.

Link to comment
Share on other sites

Right.... this is messed up! Sorry for flooding with this problem but it keeps getting stranger and you guys are the experts!

Did a set of clean installs to test under different parameters, I cut back the circuit so it is just the input switches, no dials or lights... here is what I got...

KSP.23.0 + KSPSerial 13.5 + old arduino code - COM port recognised, switches not working.

KSP.23.0 + KSPSerial 14.2 + new arduino code- COM port recognised, switches not working.

KSP.23.5 + KSPSerial 13.5 + old arduino code - COM port recognised, switches not working.

KSP.23.5 + KSPSerial 14.2 + new arduino code - COM port recognised, switches not working.

However...

My old, heavily modded install of .23.0 (which is also KSPSerial 13.5 + old arduino code) - switches working perfectly!

Also, when I briefly had it working on .23.5 I had copied the gamedate over from the same instal (except squad)

So... what the heck?

The absolutely only possible conclusion is that there is something else other than KSPserial in my gamedata folder that I need to make this work on my mega!!!!

Any ideas? This is very, very strange.

EDIT - before you say it! - no, I've checked the config file, it is identical. And if I copy the kspserial folder from the working install to another... it doesn't work. The only time it has ever worked is if I copy all the other mods across with it.

Edited by Mulbin
Link to comment
Share on other sites

Update - I can confirm that, yes, I do need another mod installed to make your mod work!

I copied the entire install of KSP that works.

Tired the new copy, your plugin still works on the copy.

I then deleted all of the other mods in game data (except for squad, kspserial)... your plugin no longer worked.

I pasted all of the mods back into the folder... you plugin works again.

So for some reason I have to have someone elses mod installed for kspserial to work, I will now remove them one at a time to see which mod it is... so I can begin to understand what...the...heck.. is going on!

Link to comment
Share on other sites

And here is the weirdest post yet.

It's Chatterer.

Your plugin only works if chatterer is also installed. I've pasted it into all other ksp variants (ksp 23 and 23.5, using both kspserial 13 and 14).. and with all versions my switch panels works just fine as long as chatterer is installed. If I remove chatterer.... my switches no longer function.

In fact now I think about it I removed chatterer from my nasa install as it was causing lag... shortly afterwards I noticed the panel no longer worked.

Sorry for presenting you with such an odd bug zitronen, but i've tested and tested and can confirm that with my arduino mega, your plugin just doesn't function unless Chatterer is installed!

How insane is that!??!

Perhaps you could spare the time to llok at the chatterer code to see if you can think what is going on?

Edited by Mulbin
Link to comment
Share on other sites

So have you tested the demo4 code or not?

Also the config files should not be exactly the same. For 14.2 the default config is


<?xml version="1.0" encoding="utf-8"?>
<config>
<double name="refresh">0.08</double>
<string name="DefaultPort">COM1</string>
<int name="BaudRate">38400</int>
<int name="HandshakeDelay">2500</int>
<bool name="ThrottleEnable">0</bool>
<bool name="PitchEnable">0</bool>
<bool name="RollEnable">0</bool>
<bool name="YawEnable">0</bool>
<bool name="TXEnable">0</bool>
<bool name="TYEnable">0</bool>
<bool name="TZEnable">0</bool>
<double name="SASTol">0.1</double>
</config>

I just tested demo4 with 14.2 again in 23.5, works fine.

Edited by zitronen
Link to comment
Share on other sites

hang on double checking the demo again....

EDIT - ok, tested and I can confirm...

Your demo works just fine... as long as chatterer is installed!

If I remove chatterer, once again the demo does not work.

I have now carried out 4 hours of testing across ksp 23 and 23.5 using both the old and new plugin and code, across two computers and 3 unique operating systems. They all work just fine with chatterer, but don't function at all without it.

Sorry Zitronen but I'm afraid it's conclusive.. I know it's odd but your plugin is dependent on something in the chatterer code (at least with my funduino mega). I don't know enough about code to work out why this is, but it's a completely repeatable and consistent bug.

Edited by Mulbin
Link to comment
Share on other sites

Can you check if it happen when you launch from VAB vs launch pad?

It will be difficult to work out what's happening when I can't reproduce it. Anyone else having the problem? I'm putting the next update on hold until the issue is resolved.

Link to comment
Share on other sites

yep, exactly the same from vab or pad... everything works just fine from either, as long as chatterer is installed. If not the panel just doesn't work no matter how you launch.

Later tonight I will start to pick chatterer apart and see if I can isolate which file it is my board needs to work.

The assumption I'm making is that my specific board has a design flaw which means it doesn't work with your plugin by default, but by pure chance the chatterer mod does something while it is running that cures/bypasses the bug. If I can pin it down it might be a bit of code that can be added to your plugin to increase compatibility with my cheap chinese arduino clone!

And yes, as a further bit of research... how many people are currently using a mega with Zitronen's plugin... and of those people, how many happen to have chatterer installed? If you are using both could you remove chatterer and see if it causes any problems.

One thing is for sure, its a very weird bug.

Usually of course I wouldn't mind as I generally always use chatterer as its a great mod... but it is causing lag in 23.5 and it isn't really being updated much any more.

Link to comment
Share on other sites

What happens if you increase the #define CONTROLREFRESH 25 to 250? Maybe it's sending stuff too quickly?

edit: Also try increasing and decreasing the serial Baud rate in the settings and arduino, try 9600 and 115200.

Edited by zitronen
Link to comment
Share on other sites

Ok, I'll bite. Whats 'Chatter'?

I'm just running the zitronen latest plugin. Nothing special on the Arduino except a few modded functions to handle i2C calls to a LCD and MCP2017. No additional plugins. I've tested it on a few types of Mega boards and 3 other Ardruino variants. Surprisingly it even works on a Leonardo.

hang on double checking the demo again....

EDIT - ok, tested and I can confirm...

Your demo works just fine... as long as chatterer is installed!

If I remove chatterer, once again the demo does not work.

I have now carried out 4 hours of testing across ksp 23 and 23.5 using both the old and new plugin and code, across two computers and 3 unique operating systems. They all work just fine with chatterer, but don't function at all without it.

Sorry Zitronen but I'm afraid it's conclusive.. I know it's odd but your plugin is dependent on something in the chatterer code (at least with my funduino mega). I don't know enough about code to work out why this is, but it's a completely repeatable and consistent bug.

Link to comment
Share on other sites

What happens if you increase the #define CONTROLREFRESH 25 to 250? Maybe it's sending stuff too quickly?

edit: Also try increasing and decreasing the serial Baud rate in the settings and arduino, try 9600 and 115200.

I'll give those things a try.

Ok, I'll bite. Whats 'Chatter'?

Chatterer is a mod for KSP that adds radio chatter. There is no logical reason why I should need it for this plugin to work... but I do.

http://forum.kerbalspaceprogram.com/threads/25367-0-23-Chatterer-v-0-5-9-2

Link to comment
Share on other sites

ok, here are the results...

Changing the CONTROLREFRESH had no effect, plugin still needs Chatterer in the mod folder to work. (Although I like your thinking, chatterer could have been slowing things down and allowing my board to keep up...)

Changing the Baud rate also makes no difference. Plugin works fine with chatterer installed, and not at all if chatterer is removed.

I have taken snippets from the ksp logs to see if there is anything suspicious happening when the flight starts...

This is a clean install with just KSP serial (which doesn't work)


[LOG 23:34:25.312]
[WRN 23:34:27.546] [HighLogic]: =========================== Scene Change : From LOADING to MAINMENU =====================
[LOG 23:34:28.828] AddonLoader: Instantiating addon 'SettingsNStuff' from assembly 'KSPSerialIO'
[LOG 23:34:28.843] KSPSerialIO: Loading settings...
[LOG 23:34:28.906] Parsing double
[LOG 23:34:28.906] Parsing string
[LOG 23:34:28.921] Parsing int
[LOG 23:34:28.921] Parsing int
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing bool
[LOG 23:34:28.921] Parsing double
[LOG 23:34:28.937] KSPSerialIO: Default Port = COM1
[LOG 23:34:28.937] KSPSerialIO: Refreshrate = 0.08
[LOG 23:34:28.937] KSPSerialIO: BaudRate = 38400
[LOG 23:34:28.937] KSPSerialIO: Handshake Delay = 5000
[LOG 23:34:28.937] KSPSerialIO: Throttle Enable = False
[LOG 23:34:28.937] KSPSerialIO: Pitch Enable = False
[LOG 23:34:28.937] KSPSerialIO: Roll Enable = False
[LOG 23:34:28.953] KSPSerialIO: Yaw Enable = False
[LOG 23:34:28.953] KSPSerialIO: Translate X Enable = False
[LOG 23:34:28.953] KSPSerialIO: Translate Y Enable = False
[LOG 23:34:28.953] KSPSerialIO: Translate Z Enable = False
[LOG 23:34:28.953] KSPSerialIO: SAS Tol = 0.1
[LOG 23:35:05.078] ScenarioTypes: List Created 3 scenario types loaded from 3 loaded assemblies.
[WRN 23:35:05.093] [HighLogic]: =========================== Scene Change : From MAINMENU to SPACECENTER =====================
[LOG 23:35:07.453] [VesselSpawner]: No new objects this time. (Odds are 1:2)
[LOG 23:35:11.125] Clicked
[LOG 23:35:12.546] Resuming Flight on LaunchPad
[LOG 23:35:12.546] Flight State Captured
[LOG 23:35:12.546] Saving Achievements Tree...
[LOG 23:35:12.546] Saving Achievements Tree...
[LOG 23:35:12.562] Game State Saved as persistent
[WRN 23:35:12.562] [HighLogic]: =========================== Scene Change : From SPACECENTER to FLIGHT =====================
[EXC 23:35:12.593] NullReferenceException: Object reference not set to an instance of an object
[LOG 23:35:14.421] AddonLoader: Instantiating addon 'KSPSerialPort' from assembly 'KSPSerialIO'
[LOG 23:35:14.437] KSPSerialIO: Version 0.14.2
[LOG 23:35:14.437] KSPSerialIO: Getting serial ports...
[LOG 23:35:14.437] KSPSerialIO: Output packet size: 129/255
[LOG 23:35:14.437] KSPSerialIO: Found 3 serial ports
[LOG 23:35:14.437] KSPSerialIO: trying default port COM1
[LOG 23:35:20.984] KSPSerialIO: KSP Display not found
[LOG 23:35:20.984] KSPSerialIO: trying port \Device\Serial0 - COM1
[LOG 23:35:27.500] KSPSerialIO: KSP Display not found
[LOG 23:35:27.500] KSPSerialIO: trying port \Device\USBSER000 - COM3
[LOG 23:35:32.593] KSPSerialIO: found KSP Display at COM3
[LOG 23:35:32.593] AddonLoader: Instantiating addon 'KSPSerialIO' from assembly 'KSPSerialIO'
[LOG 23:35:32.625] ------------------- initializing flight mode... ------------------
[LOG 23:35:32.640] Target vessel index: 1 vessel count: 2
[LOG 23:35:32.640] [FLIGHT GLOBALS]: Switching To Vessel Untitled Space Craft ----------------------
[LOG 23:35:32.640] setting new dominant body: Kerbin
FlightGlobals.mainBody: Kerbin
[LOG 23:35:32.656] Reference Frame: Rotating
[LOG 23:35:32.687] [Untitled Space Craft]: landed - waiting for ground contact to resume physics...
[LOG 23:35:32.703] Camera Mode: AUTO
[LOG 23:35:32.718] stage manager resuming...
[LOG 23:35:35.453] all systems started
[LOG 23:35:35.718] KSPSerialIO: Handshake received - 314
[LOG 23:35:35.828] [VesselSpawner]: No new objects this time. (Odds are 1:2)
[LOG 23:35:35.890] [PlanetariumCamera]: Focus: Untitled Space Craft
[LOG 23:35:36.093] Flight State Captured
[LOG 23:35:36.093] Saving Achievements Tree...
[LOG 23:35:36.093] Saving Achievements Tree...
[LOG 23:35:36.093] Game State Saved as persistent
[LOG 23:35:37.125] [Untitled Space Craft]: ground contact! - error: 0.108m
[LOG 23:35:37.125] Unpacking Untitled Space Craft
[LOG 23:35:50.828] [VesselSpawner]: New object found!
[LOG 23:35:50.843] Flyby orbit Created: Pe = 58,701,563m, dV = 120m/s
[LOG 23:36:06.015] [VesselSpawner]: New object found!
[LOG 23:36:06.031] Flyby orbit Created: Pe = 80,801,060m, dV = 334m/s
[LOG 23:36:36.468] [VesselSpawner]: New object found!
[LOG 23:36:36.468] Flyby orbit Created: Pe = 43,303,948m, dV = 449m/s
[LOG 23:36:51.640] [VesselSpawner]: New object found!
[LOG 23:36:51.640] Flyby orbit Created: Pe = 15,090,068m, dV = 402m/s

And this is with KSPserial and chatterer in the gamedata folder (which works great) - as you can see chatterer is quite active during the loading and start of the scene... could this have anything to do with it? Something is happening here which allows my mega to work...


[LOG 23:39:48.843]
[WRN 23:39:51.078] [HighLogic]: =========================== Scene Change : From LOADING to MAINMENU =====================
[LOG 23:39:52.406] AddonLoader: Instantiating addon 'SettingsNStuff' from assembly 'KSPSerialIO'
[LOG 23:39:52.406] KSPSerialIO: Loading settings...
[LOG 23:39:52.500] Parsing double
[LOG 23:39:52.500] Parsing string
[LOG 23:39:52.500] Parsing int
[LOG 23:39:52.500] Parsing int
[LOG 23:39:52.500] Parsing bool
[LOG 23:39:52.500] Parsing bool
[LOG 23:39:52.500] Parsing bool
[LOG 23:39:52.515] Parsing bool
[LOG 23:39:52.515] Parsing bool
[LOG 23:39:52.515] Parsing bool
[LOG 23:39:52.515] Parsing bool
[LOG 23:39:52.515] Parsing double
[LOG 23:39:52.515] KSPSerialIO: Default Port = COM1
[LOG 23:39:52.515] KSPSerialIO: Refreshrate = 0.08
[LOG 23:39:52.515] KSPSerialIO: BaudRate = 38400
[LOG 23:39:52.531] KSPSerialIO: Handshake Delay = 5000
[LOG 23:39:52.531] KSPSerialIO: Throttle Enable = False
[LOG 23:39:52.531] KSPSerialIO: Pitch Enable = False
[LOG 23:39:52.531] KSPSerialIO: Roll Enable = False
[LOG 23:39:52.531] KSPSerialIO: Yaw Enable = False
[LOG 23:39:52.531] KSPSerialIO: Translate X Enable = False
[LOG 23:39:52.531] KSPSerialIO: Translate Y Enable = False
[LOG 23:39:52.531] KSPSerialIO: Translate Z Enable = False
[LOG 23:39:52.546] KSPSerialIO: SAS Tol = 0.1
[LOG 23:40:00.578] ScenarioTypes: List Created 3 scenario types loaded from 4 loaded assemblies.
[WRN 23:40:00.578] [HighLogic]: =========================== Scene Change : From MAINMENU to SPACECENTER =====================
[LOG 23:40:02.890] [VesselSpawner]: No new objects this time. (Odds are 1:2)
[LOG 23:40:07.468] Clicked
[LOG 23:40:08.375] Resuming Flight on LaunchPad
[LOG 23:40:08.375] Flight State Captured
[LOG 23:40:08.375] Saving Achievements Tree...
[LOG 23:40:08.375] Saving Achievements Tree...
[LOG 23:40:08.390] Game State Saved as persistent
[WRN 23:40:08.390] [HighLogic]: =========================== Scene Change : From SPACECENTER to FLIGHT =====================
[EXC 23:40:08.421] NullReferenceException: Object reference not set to an instance of an object
[LOG 23:40:10.171] AddonLoader: Instantiating addon 'chatterer' from assembly 'Chatterer'
[LOG 23:40:10.187] [CHATR] blizzy78's Toolbar plugin not found, enabling default Chatterer icon
[LOG 23:40:10.187] [CHATR] Awake() starting...
[LOG 23:40:10.187] [CHATR] C:\Documents and Settings\Administrator\Desktop\23.5 and 14.2\GameData\Chatterer\Plugins/PluginData/Chatterer/ exists
[WRN 23:40:10.203] Directory 'C:\Documents and Settings\Administrator\Desktop\23.5 and 14.2\GameData\Chatterer\Plugins/PluginData/Chatterer/../../../Sounds/AAE/soundscape/' could not be found
[LOG 23:40:10.203] [CHATR] Chatterer/Sounds/AAE/effect/breathing loaded OK
[LOG 23:40:10.203] [CHATR] Chatterer/Sounds/AAE/effect/airlock loaded OK
[LOG 23:40:10.203] [CHATR] Chatterer/Sounds/AAE/wind/mario1298__weak-wind loaded OK
[WRN 23:40:10.203] [CHATR] Chatterer/Sounds/AAE/loop/suspense1 not found
[LOG 23:40:10.218] [CHATR] icon textures exist, loading...
[LOG 23:40:10.218] [CHATR] icon textures loaded
[LOG 23:40:10.218] [CHATR] load_plugin_settings() START
[LOG 23:40:10.234] [CHATR] load_shared_settings() START
[LOG 23:40:10.250] [CHATR] "Default" AudioClip set :: current_clip = ch0cchi__alien-ship-idle
[LOG 23:40:10.265] [CHATR] "Default" AudioClip set :: current_clip = drni__gas-stove-space-ship
[LOG 23:40:10.265] [CHATR] audiosets found: 3 :: reloading chatter audio
[LOG 23:40:10.265] [CHATR] loading chatter audio...
[WRN 23:40:10.281] [CHATR] directory [russian/capcom] NOT found, skipping...
[LOG 23:40:10.296] [CHATR] toggled sets loaded OK
[LOG 23:40:10.296] [CHATR] loading beepsource
[LOG 23:40:10.296] [CHATR] "First" AudioClip set :: current_clip = 3beeps
[LOG 23:40:10.296] [CHATR] beep AudioClip set :: current_clip = 3beeps
[LOG 23:40:10.296] [CHATR] loading beepsource
[LOG 23:40:10.312] [CHATR] "First" AudioClip set :: current_clip = 3beeps
[LOG 23:40:10.312] [CHATR] beep AudioClip set :: current_clip = 3beeps
[LOG 23:40:10.312] [CHATR] loading beepsource
[LOG 23:40:10.312] [CHATR] "First" AudioClip set :: current_clip = 3beeps
[LOG 23:40:10.312] [CHATR] beep AudioClip set :: current_clip = 3beeps
[LOG 23:40:10.312] [CHATR] load_shared_settings() END
[LOG 23:40:10.312] [CHATR] load_plugin_settings() END
[LOG 23:40:10.328] [CHATR] loading Quindar clip
[LOG 23:40:10.328] CHATR] Quindar clip loaded
[WRN 23:40:10.328] Only custom filters can be played. Please add a custom filter or an audioclip to the audiosource (rbr_chatter_player).
[WRN 23:40:10.328] Only custom filters can be played. Please add a custom filter or an audioclip to the audiosource (rbr_chatter_player).
[LOG 23:40:10.328] [CHATR] new delay between exchanges: 12
[LOG 23:40:10.328] [CHATR] new sstv timer limit set: 0
[LOG 23:40:10.343] [CHATR] skin list built, count = 10
[LOG 23:40:10.343] [CHATR] Awake() has finished...
[LOG 23:40:10.343] AddonLoader: Instantiating addon 'KSPSerialPort' from assembly 'KSPSerialIO'
[LOG 23:40:10.359] KSPSerialIO: Version 0.14.2
[LOG 23:40:10.359] KSPSerialIO: Getting serial ports...
[LOG 23:40:10.359] KSPSerialIO: Output packet size: 129/255
[LOG 23:40:10.359] KSPSerialIO: Found 3 serial ports
[LOG 23:40:10.359] KSPSerialIO: trying default port COM1
[LOG 23:40:16.906] KSPSerialIO: KSP Display not found
[LOG 23:40:16.906] KSPSerialIO: trying port \Device\Serial0 - COM1
[LOG 23:40:23.421] KSPSerialIO: KSP Display not found
[LOG 23:40:23.421] KSPSerialIO: trying port \Device\USBSER000 - COM3
[LOG 23:40:28.515] KSPSerialIO: found KSP Display at COM3
[LOG 23:40:28.515] AddonLoader: Instantiating addon 'KSPSerialIO' from assembly 'KSPSerialIO'
[LOG 23:40:28.562] ------------------- initializing flight mode... ------------------
[LOG 23:40:28.562] Target vessel index: 1 vessel count: 2
[LOG 23:40:28.578] [FLIGHT GLOBALS]: Switching To Vessel Untitled Space Craft ----------------------
[LOG 23:40:28.578] setting new dominant body: Kerbin
FlightGlobals.mainBody: Kerbin
[LOG 23:40:28.578] Reference Frame: Rotating
[LOG 23:40:28.625] [Untitled Space Craft]: landed - waiting for ground contact to resume physics...
[LOG 23:40:28.640] Camera Mode: AUTO
[LOG 23:40:28.656] stage manager resuming...
[LOG 23:40:31.390] all systems started
[LOG 23:40:31.671] KSPSerialIO: Handshake received - 314
[LOG 23:40:31.718] [CHATR] Update() run-once :: calling load_vessel_settings_node()
[LOG 23:40:32.031] [CHATR] load_vessel_settings_node() :: vessel_settings.cfg loaded OK
[LOG 23:40:32.046] [CHATR] Update() run-once :: calling search_vessel_settings_node()
[LOG 23:40:32.046] [CHATR] START search_vessel_settings_node()
[LOG 23:40:32.046] [CHATR] active vessel id = f272a47a-3699-4f0f-9655-7032549bf34b
[LOG 23:40:32.046] [CHATR] n.GetValue("vessel_id") = b7b529b1-4001-4514-a4d2-afea8b5b2459
[LOG 23:40:32.046] [CHATR] no match, continuing search...
[LOG 23:40:32.046] [CHATR] n.GetValue("vessel_id") = 8d433885-1862-4d8e-85e2-78a07512946d
[LOG 23:40:32.062] [CHATR] no match, continuing search...
[LOG 23:40:32.062] [CHATR] n.GetValue("vessel_id") = 82cd4864-4287-444b-9f77-f393dbf4c3a0
[LOG 23:40:32.062] [CHATR] no match, continuing search...
[LOG 23:40:32.062] [CHATR] n.GetValue("vessel_id") = 9b3f54bd-df84-4291-bdfa-88c2706aa472

EDIT - to my untrained eyes it really looks like CHATR is throwing a hell of a lot of code around before KSPSerial even gets a chance to try to handshake. Could it be this delay that is allowing my board to function correctly?

Edited by Mulbin
Link to comment
Share on other sites

Just ordered another mega to see if it is just this specific brand of board. Also ordered a Leonardo to use as a keyboard emulator (going to push all of my momentary commands on to this as they don't need your plugin so I can free up pins on the mega for toggle switches and readouts).

Link to comment
Share on other sites

Ok, tried the debug plugin with and without Chatterer installed.

Here is the log with Chatterer (control panel working fine)

[LOG 22:30:30.406] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.421] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.421] KSPSerialIO: SAS: True, RCS: True, Lights: False, Gear: False, Brakes: False, Precision: False, Abort: False, Stage: False

[LOG 22:30:30.437] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.453] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.468] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.468] KSPSerialIO: SAS: True, RCS: True, Lights: False, Gear: False, Brakes: False, Precision: False, Abort: False, Stage: False

[LOG 22:30:30.484] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.500] KSPSerialIO: ActiveVessel found

[LOG 22:30:30.515] KSPSerialIO: SAS: True, RCS: True, Lights: False, Gear: False, Brakes: False, Precision: False, Abort: False, Stage: False

But without Chatterer installed the panel still doesn't function and the debug just does this constantly...

[LOG 22:12:17.828] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.843] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.859] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.875] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.890] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.906] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.921] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.937] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.953] KSPSerialIO: ActiveVessel found

[LOG 22:12:17.968] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.000] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.015] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.031] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.046] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.062] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.078] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.093] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.109] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.125] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.140] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.156] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.171] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.187] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.203] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.234] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.250] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.265] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.281] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.296] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.312] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.328] KSPSerialIO: ActiveVessel found

[LOG 22:12:18.343] KSPSerialIO: ActiveVessel found

So when I don't have chatterer in the gamedata folder it looks like the plugin isn't updating information at all.

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...