@@ -105,18 +105,30 @@ void createUploadPortsMenu(ControlFont f) {
105105 // Create an StringList of all the Serial ports available
106106 StringList serialPortsList = new StringList ();
107107
108- // // For Linux -> **Spl method due to bug for which Serial.list() doesn't work in linux
109- // if (OS() == 1) {
110- // //printArray(get_serial_ports_in_linux());
111- // serialPortsList = getSerialPortsInLinux();
112- // }
113- // // For mac and win
114- // if (OS() == 0 || OS() == 2) {
115- // for (int i=0; i<Serial.list().length; i++ ) {
116- // serialPortsList.append(Serial.list()[i]);
117- // }
118- // }
119-
108+ /*
109+ AS OF MAY-2022, if using Processing 4.0b8, the serial library is broken for Linux.
110+ Specifically Serial.list() method doesn't list al; available serial ports in LInux.
111+ So you want to use 4.0b8 version of IDE, anyways in Linux, Un comment the below block.
112+ */
113+ /*
114+ // For Linux -> **Spl method due to bug for which Serial.list() doesn't work in linux
115+ if (OS() == 1) {
116+ //printArray(get_serial_ports_in_linux());
117+ serialPortsList = getSerialPortsInLinux();
118+ }
119+ // For mac and win
120+ if (OS() == 0 || OS() == 2) {
121+ for (int i=0; i<Serial.list().length; i++ ) {
122+ serialPortsList.append(Serial.list()[i]);
123+ }
124+ }
125+ */
126+ /*
127+ AS OF MAY-2022, if using Processing 3.5.4, the serial library is working for Linux.
128+ Specifically Serial.list() method correctly lists all available serial ports in Linux.
129+ So you want to use 3.5.4 version of IDE, in Linux (Recommened until seril bug is foxed in Ver 4.X),
130+ Comment out this for loop block below
131+ */
120132 for (int i= 0 ; i< Serial . list(). length; i++ ) {
121133 serialPortsList. append(Serial . list()[i]);
122134 }
@@ -169,17 +181,30 @@ void createDebugPortsMenu(ControlFont f) {
169181 // Create an StringList of all the Serial ports available
170182 StringList serialPortsList = new StringList ();
171183
184+ /*
185+ AS OF MAY-2022, if using Processing 4.0b8, the serial library is broken for Linux.
186+ Specifically Serial.list() method doesn't list al; available serial ports in LInux.
187+ So you want to use 4.0b8 version of IDE, anyways in Linux, Un comment the below block.
188+ */
189+ /*
172190 // For Linux -> **Spl method due to bug for which Serial.list() doesn't work in linux
173- // if (OS() == 1) {
174- // //printArray(get_serial_ports_in_linux());
175- // serialPortsList = getSerialPortsInLinux();
176- // }
177- // // For mac and win
178- // if (OS() == 0 || OS() == 2) {
179- // for (int i=0; i<Serial.list().length; i++ ) {
180- // serialPortsList.append(Serial.list()[i]);
181- // }
182- // }
191+ if (OS() == 1) {
192+ //printArray(get_serial_ports_in_linux());
193+ serialPortsList = getSerialPortsInLinux();
194+ }
195+ // For mac and win
196+ if (OS() == 0 || OS() == 2) {
197+ for (int i=0; i<Serial.list().length; i++ ) {
198+ serialPortsList.append(Serial.list()[i]);
199+ }
200+ }
201+ */
202+ /*
203+ AS OF MAY-2022, if using Processing 3.5.4, the serial library is working for Linux.
204+ Specifically Serial.list() method correctly lists all available serial ports in Linux.
205+ So you want to use 3.5.4 version of IDE, in Linux (Recommened until seril bug is foxed in Ver 4.X),
206+ Comment out this for loop block below
207+ */
183208 for (int i= 0 ; i< Serial . list(). length; i++ ) {
184209 serialPortsList. append(Serial . list()[i]);
185210 }
@@ -314,17 +339,30 @@ void refreshPorts() {
314339 // Create an StringList of all the Serial ports available
315340 StringList serialPortsList = new StringList ();
316341
317- // // For Linux -> **Spl method due to bug for which Serial.list() doesn't work in linux
318- // if (OS() == 1) {
319- // //printArray(get_serial_ports_in_linux());
320- // serialPortsList = getSerialPortsInLinux();
321- // }
322- // // For mac and win
323- // if (OS() == 0 || OS() == 2) {
324- // for (int i=0; i<Serial.list().length; i++ ) {
325- // serialPortsList.append(Serial.list()[i]);
326- // }
327- // }
342+ /*
343+ AS OF MAY-2022, if using Processing 4.0b8, the serial library is broken for Linux.
344+ Specifically Serial.list() method doesn't list al; available serial ports in LInux.
345+ So you want to use 4.0b8 version of IDE, anyways in Linux, Un comment the below block.
346+ */
347+ /*
348+ // For Linux -> **Spl method due to bug for which Serial.list() doesn't work in linux
349+ if (OS() == 1) {
350+ //printArray(get_serial_ports_in_linux());
351+ serialPortsList = getSerialPortsInLinux();
352+ }
353+ // For mac and win
354+ if (OS() == 0 || OS() == 2) {
355+ for (int i=0; i<Serial.list().length; i++ ) {
356+ serialPortsList.append(Serial.list()[i]);
357+ }
358+ }
359+ */
360+ /*
361+ AS OF MAY-2022, if using Processing 3.5.4, the serial library is working for Linux.
362+ Specifically Serial.list() method correctly lists all available serial ports in Linux.
363+ So you want to use 3.5.4 version of IDE, in Linux (Recommened until seril bug is foxed in Ver 4.X),
364+ Comment out this for loop block below
365+ */
328366 for (int i= 0 ; i< Serial . list(). length; i++ ) {
329367 serialPortsList. append(Serial . list()[i]);
330368 }
0 commit comments