having a curious issue, more wondering if this is just me than aiming for a solution just yet.
I have two MCU, an Arduino Nano and a Raspberry Pi Pico, both programmed with the Arduino IDE with the same code except for one line to define where the on board LED lives.
very simple code, open the serial port, sit want wait - if a character comes through flash the light (using non-blocking code) and if the character is 0x01, respond with 0x02 and go back to sleep.
compiles, installs and runs perfectly on both - the Nano is COM5 and the Pico is COM24.
the Serial Monitor can talk to both - obviously it cannot send binary but the light flashes, a terminal programme that can send Binary shows this works exactly as expected.
so far so good.
I then have a C# console application.. this will talk to the Nano on COM5 but will hang trying to talk to the Pico on COM24...
has anyone else had entertainment trying to get C# to talk to COM ports with numbers above 9?
Hi, I did try "\.\COM...." generates an error message that the name cannot start with ""
C# sharp code could be bugged, its quite basic with minimal error checking, however it talks to other MCU quite nicely. and when liberally sprinkled with exceptions handlers etc none of them trigger
it just locks up.
I suspect the issue is something about the nature of the virtual port driver for the chip on the Pi Pico as a bit more testing and it does work with an Arduino Mega on COM23
have filed it under "one of them things", largely because I was only fiddling trying to see why code written by someone else in C# will talk to an Arduino, and stuff like an ESP32 etc, but not the Pi Pico
when the code on the Pi Pico will work just fine when a terminal programme is talking to it - issue seems to be in the guts of C# - next step is to try talking using the Win32 API and if that works maybe generate my own little library that can be called from C# to manage it
these things are sent to try us, cheers for the reply though
not come across this problem with C#
I have had similar problems with other software when attempting to use COM ports with high number
I fixed the problem by removing unused COM ports so low numbered COM ports can be reused