The WiFi straight key on Project TouCans is up and running!
There were a few steps to the process. First, I realized yesterday that most of my audio delay issues with the sidetone on the Chromebook that I usually use to control Project TouCans keyer were caused by using the Linux Chrome browser on that machine as opposed to the built-in Chrome browser. I'd originally made this choice becuase I thought running the Linux browser with the
--disable-web-security
argument was the only way to make cross-origin resource sharing accesses from the keyer's locally served, (via file), web page, to the Pico-W.
It turns out I was incorrect about that. by using fetch,
fetch(`http://192.168.4.1/light/skgo?msg=${cwmsg}`, { mode: 'no-cors' })
.then(() => console.log("CW message sent successfully."))
.catch(err => console.error("Error sending CW message:", err));
with a no-cors mode. This results in the browser issuing an error message, but the request lands at the Pico-W on TouCans, which is all I need it to do.
The second step was to realize that at some point ChatGPT had munged the (originally) very pretty and functional code it created for the keyer. I noticed that when I used newer versions of the keyer code which is virutally the same as the CW metronome code, the resulting keyer output on TouCans was garbled. That led me to build a playback feature into the metronome. Sure enough, the playback on the metronome page was also garbled. ChatGPT had stopped adding the time the key was up to the string it sent to the Pico-W.
To clarify a bit, when the operator presses down a key on the keyboard, the app records how long the key was down and stores that number in integer milliseconds in a string. The app then records the lenght of time the key is not pressed and appends that to the same string. Consequently, me tapping out CQ looks like this:
291+112+113+90+204+118+105+248+247+90+270+113+67+90+338+
where my first day lasted 291 ms, the gap was 112 ms, then my first dit lasted 113 ms, followed by 90 ms of silence, and so on.
Intstead of sending the above string, ChatGPT had munged the code so that the following was sent instead:
291+113+204+105+247...
I made a quick fix and the keyer was up and running!
The histograms were really helpful once the sidetone issues were resolved. When my dit and dah consistency looked like this, (click the image for a larger picture):
I turned up on the Reverse Beacon Network with my full callsign! I'm super-pleased, because I usually do not get spotted when I'm using the rig with a straight key. Turns out practice works :)Their's still some quirkiness in the Pico-W code that was introduced when I tried to implement a wired straight key. The result is that I'm occasionally locked out of the Pico-W's server loop unti I reset the device. I'll be removing the wired straight key handling loop this morning to remedy that problem.
Comments
Post a Comment
Please leave your comments on this topic: