Well, this appears to have solved the connection issue. But I might have a fragile system since I got this while I had the monitor window left open between connections:
java.io.IOException: jssc.SerialPortException: Port name - COM9; Method name - setEventsMask(); Exception type - Can't set mask.
at processing.app.Serial.dispose(Serial.java:171)
at processing.app.SerialMonitor.close(SerialMonitor.java:147)
at processing.app.AbstractMonitor.suspend(AbstractMonitor.java:113)
at processing.app.Editor$UploadHandler.run(Editor.java:2055)
at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - COM9; Method name - setEventsMask(); Exception type - Can't set mask.
at jssc.SerialPort.setEventsMask(SerialPort.java:279)
at jssc.SerialPort.removeEventListener(SerialPort.java:1064)
at jssc.SerialPort.closePort(SerialPort.java:1090)
at processing.app.Serial.dispose(Serial.java:168)
... 4 more
And with the #if 0
I got 2 minutes without disconnection. I didn’t tested further, so that seems to be the core issue on the problems with monitoring.
I took the liberty of testing with:
#define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 33000>
#define BLADE_DETECT_PIN blade3Pin
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
I tested eight times per Blade ID:
45,403.71
685,978.25
856,263.81
856,263.81
66,096.77
701,608.50
811,800.00
960,882.75
833,461.81
1,173,858.37
45,041.57
1,022,999.00
45,041.57
1,022,999.00
8,513.51
880,296.56
8,513.51
1,173,858.37
8,564.58
1,057,064.00
8,513.51
1,318,680.00
8,513.51
642,840.00
8,513.51
1,132,242.00
8,513.51
604,585.25
8,513.51
685,978.25
6,708.58
1,375,000.87
6,708.58
991,000.94
6,661.97
856,263.81
6,661.97
1,022,999.00
6,661.97
1,318,680.00
6,708.58
656,632.88
856,263.81
833,461.81
856,263.81
833,461.81
856,263.81
856,263.81
833,461.81
833,461.81
833,461.81
856,263.81
833,461.81
856,263.81
856,263.81
833,461.81
811,800.00
856,263.81
833,461.81
Then I went and did a set of tests with Blade Present and no multisampling:
685,978.25
856,263.81
856,263.81
66,096.77
701,608.50
811,800.00
960,882.75
833,461.81
1,173,858.37
45,041.57
1,022,999.00
45,041.57
1,022,999.00
8,513.51
880,296.56
8,513.51
1,173,858.37
8,564.58
1,057,064.00
8,513.51
1,318,680.00
8,513.51
642,840.00
8,513.51
1,132,242.00
8,513.51
604,585.25
8,513.51
685,978.25
6,708.58
1,375,000.87
6,708.58
991,000.94
6,661.97
856,263.81
6,661.97
1,022,999.00
6,661.97
1,318,680.00
6,708.58
656,632.88
856,263.81
833,461.81
856,263.81
833,461.81
856,263.81
856,263.81
833,461.81
833,461.81
833,461.81
856,263.81
833,461.81
856,263.81
856,263.81
833,461.81
811,800.00
856,263.81
833,461.81
Then I redid the test but with Blade Present plus #define BLADE_ID_TIMES 20
.
834,602.06
839,162.44
835,742.19
834,602.06
838,022.38
835,742.19
844,113.63
839,162.44
44,978.63
834,773.06
824,850.00
836,882.25
839,280.94
839,794.69
835,856.19
842,639.69
839,162.44
837,163.13
833,575.94
845,043.00
45,014.68
841,442.63
834,773.06
839,219.44
103,728.33
801,792.50
106,005.69
802,631.00
104,676.30
823,916.19
105,836.09
879,287.31
104,900.10
844,030.94
103,098.16
904,360.94
102,034.46
878,908.00
104,116.52
834,133.63
6,678.28
910,578.44
6,666.64
986,173.00
6,671.29
823,302.44
6,661.98
906,300.44
6,671.29
957,356.31
6,675.96
813,782.56
6,668.96
6,730.42
6,661.98
897,397.81
8,505.87
977,995.00
8,521.18
897,616.13
8,510.98
969,839.63
8,508.42
742,550.75
8,505.87
917,474.44
8,518.62
875,079.63
8,508.43
831,451.69
8,500.79
937,246.19
848,344.81
829,243.56
838,307.38
835,974.69
842,819.81
849,660.44
838,250.38
838,197.94
6,659.65
840,478.13
6,671.29
828,380.19
6,680.63
835,124.19
6,675.96
840,478.13
6,664.32
837,176.38
6,659.65
837,167.25
6,661.99
826,201.88
6,666.65
831,691.00
846,548.63
852,353.63
854,586.69
838,056.69
837,786.75
842,088.94
845,584.13
837,676.88
6,657.11
928,584.19
6,603.64
1,087,600.37
6,714.03
1,188,606.75
6,572.92
1,296,764.87
6,680.00
1,143,575.87
6,619.63
1,033,736.19
6,797.19
1,232,400.87
6,627.92
1,219,759.37
6,708.58
852,941.81
6,689.94
6,689.94
8,508.43
847,617.19
45,059.80
849,423.31
21,679.64
861,316.63
45,005.69
844,985.94
45,077.70
974,889.00
45,150.04
851,949.63
45,403.71
685,978.25
856,263.81
856,263.81
66,096.77
701,608.50
811,800.00
960,882.75
833,461.81
1,173,858.37
45,041.57
1,022,999.00
45,041.57
1,022,999.00
8,513.51
880,296.56
8,513.51
1,173,858.37
8,564.58
1,057,064.00
8,513.51
1,318,680.00
8,513.51
642,840.00
8,513.51
1,132,242.00
8,513.51
604,585.25
8,513.51
685,978.25
6,708.58
1,375,000.87
6,708.58
991,000.94
6,661.97
856,263.81
6,661.97
1,022,999.00
6,661.97
1,318,680.00
6,708.58
656,632.88
856,263.81
833,461.81
856,263.81
833,461.81
856,263.81
856,263.81
833,461.81
833,461.81
833,461.81
856,263.81
833,461.81
856,263.81
856,263.81
833,461.81
811,800.00
856,263.81
833,461.81
When I tested the 45k blade plug the blade was detected but many times not the 45k resistor: May be I didn’t push strong enough since the plug was a bit short? Again, the 39k charging plug was detected on the 105k range. I’m not convinced about the #define BLADE_ID_TIMES 20
ID: 839162.44
NO Blade Detected
[...]
EVENT: Select-On millis=37912
ID: 44978.63
Blade Detected
[...]
EVENT: Select-Off millis=41117
ID: 834773.06
NO Blade Detected
[...]
EVENT: Select-On millis=44198
ID: 824850.00
Blade Detected
[...]
EVENT: Select-Off millis=46766
ID: 836882.25
NO Blade Detected
[...]
EVENT: Select-On millis=51103
ID: 839280.94
Blade Detected
[...]
EVENT: Select-Off millis=54271
ID: 839794.69
NO Blade Detected
[...]
EVENT: Select-On millis=56467
ID: 835856.19
Blade Detected
[...]
EVENT: Select-Off millis=59903
ID: 842639.69
NO Blade Detected
[...]
EVENT: Select-On millis=62510
ID: 839162.44
Blade Detected
[...]
EVENT: Select-Off millis=67636
ID: 837163.13
NO Blade Detected
[...]
EVENT: Select-On millis=71192
ID: 833575.94
Blade Detected
[...]
EVENT: Select-Off millis=74998
ID: 845043.00
NO Blade Detected
[...]
EVENT: Select-On millis=77263
ID: 45014.68
Blade Detected
Or may be I just need to try the #define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>
and see if it makes any difference?