Skip to main content

Posts

Showing posts with the label chatGPT

Today I Learned: Samsung S23 One UI Closes WebSocket Connections on Task Switch from Chrome Browser

 During yesterday's POTA activations, I kept losing my control panel connection to Project TouCans. I restarted the rig's Pico-W several times to re-establish the connection before it occurred to me to think through the symptoms which were: Productively using the control panel to key the rig Switch to any other app on the phone besides the Chrome browser Return to control panel on Chrome browser and the connection is gone. On my implementation, the control panel's On button first opens a WebSocket to Project TouCans' Pico-W. As an experiment, rather than power cycling the Pico-W, I simply hit the 'On' button again even though the rig was already on. Sure enough, that did it. The connection was back up and running. I asked ChatGPT what might have caused this. I mentioned that the phone, as Samsung Galaxy 23 had forced an update of One UI. The answer that came back was that versions of One UI newer than 6, (I'm on 7 now), do indeed cut socket connections when...

Today I Learned: Default CZML "great cirlce" aerial paths can be made straight line with "arcType: NONE

 I spent a little bit of time doing math debug this weekend, but in the end it turned out the QSO mapping app had a visualization issue, not a math issue. It was fun to get to look at the math for calculating the apparent launch angle of our antenna using F2 height data and rx/tx station locations. I wouldn't have thought to do the review except I had data that didn't match the maps I was getting back. According to the launch ange calculations made by our, (mine and KO6BTY's), QSO mapping app, the launch angle for the signal from our QTH was 0.00227 degrees. The map however, showed the path of the signal soaring over the very nearby Bay Bridge. The angle shown is much larger than 0.00227 degrees. Here's a picture of the nearby Bay Bridge with our antenna in the foreground. After completely reviewing the underlying math, it occurred to me that CZML likes to make lines that follow great circles. To make something that approximated a circle out of a path with a very low ...

Adding Elevation Control to QSO Maps with ChatGPT and Cesium

When making our QSO skip maps one of the issues we encounter is that the lines from our station to the F2 layer don't always start right at the ground. This seems to be an artifact of CZML and the fact that the Earth is not a sphere, but rather an ellipsoid, and even then, there are all those hills and mountains. The initial QSOs can wind mapped as up coming from underground: or, they can wind up starting from above the surface of the Earth In any event, it's been necessary with each map to adjust the elevation height of our station. I've yet to find a parameter to set in a czml that makes the starting point always be on the ground. "clampToGround" works for polylines that are always on the ground, but not polylines whose next point has an altitude greater than zero as the ground station to F2 layer polylines do. I added a feature into the JavaScript mapping application this week that allows me to adjust the height of all of the QSO's starting points at...

Today I Learned: Google Geocoding Costs More but ChatGPT Helped Me Fix It

 Google changed their billing scheme for geocoding in March. Previously, all users were given a $200 credit for Google geocoding per month. Google removed the credit and replaced it with 10,000 geocoding calls per month, and my bill went up! I've known for a while that my pytest code is running every time the QSO tracker is automatically kicked off by github, (which is about 4 times per hour.) Those test cases make seven Google geocoding API calls each. As of April, they mattered. Adding up all the calls assuming that my QSO tracker spots me zero times in a month and that I log no QSOs, so just the calls from the test cases, gives: geocodes runs/hour hours days/month geocodes/month 7 4 24 30 20160 which is well over the free limit. I asked ChatGPT to change my action  so that the test cases would only run when Python files in the repo changed. This was NOT vibe coding. I had to ask ChatGPT to fix its own coding errors 3 times, handing it the error message each time. It did i...

Today I Learned: Pattern for Specifying the CZML Map to Load in an iframe URL

 I learned a way to make my POTA activation blogs a bit easier to create today.  When to Use the Pattern When you'd like to use the same Sandcastle to open multiple different czml files without having to edit Sandcastle code every time. More generally, the pattern can be used to pass any number of URL encoded parameters to your Sandcastle Javascript via your Sandcastle's web address. What the Pattern Enables The user can specify a czml file URL like this https://sandcastle.cesium.com/standalone.html?mapurl=https://raw.githubusercontent.com/hcarter333/rm-rbn-history/refs/heads/main/maps/2024_11_18_Civic_Center_Juan_Bautista.czml#c=dV... Where the #c is the usual 64 bit encoded contents of your Sandcastle from the share link. Your Sandcastle will need to include this  code  through line 15. At that point, you'll have the address of your map in the variable mapurl2 and can do whatever you like with it. In the example above, the czml file pointed to is simply loaded into...

The Project TouCans CZML Tester: Another o3-mini Rapid Prototyping Tool

 Did you know you can store czml maps in github and then load them into the Cesium Sandcastle to try things out? I didn’t for the longest time, but now I do! I recently ran into an issue where I needed to test the differences between several different versions of the same CZML file with one incrmental change per file to debug an issue I was seeing on my maps. I asked ChatGPT to write some JavaScript code that would allow me to simply place the URL into a text input box, click a button, and view the newly specified map on a web page. It wasn’t quite ‘vibe coding’ but a little while later, I had this tool for working through my test maps. You can load any github (or other cors-exporting-happy site) czml file to visualize it.  As an example, I walked through my use case–debugging the slider position on an animated czml map of ham radio QSOs Finally, if you’d like to play around with the code o3-mini and I generated as the basis for a project of yours, it can be found in this gis...

Using o3-mini to Set up a Log Book Transfer for use with QRZ.com

 New ham cleans up log book on QRZ with the help of o3-mini. A few days back, after the completion of SKCC month, a ham sent out a message asking others to please post their QSOs ot LoTW and/or QRZ.com for award verification. For me, a light bulb burst on. It does matter that I log my QSOs publicly. It had frankly, never occurred to me before, but it made sense. o3-mini and I got to work. I already have a log book built on Datasette for my QSOs. I just needed to get the QSOs from there and ship them off to QRZ.com . I needed it to be automatic though, since there were more than 1,000 QSOs to transfer. I asked o3-mini to write a Python script to do this for me. I gave it the database schema for my QSO database. I also fed it the l ogging API instructions for QRZ.com.  I had something that worked well enough after about 40 minutes. After three hours, that included a 40 minute coffe break, I had a script that automatically calculated my tx grid square, (it changes a lot becuase...

AIs, Coding, and the Age of Ideas ~ Also the Week in Review

 I found ChatGPT o3-mini the day after it relased last weekend. I then spent most of the weekend cranking out apps that I've wanted for months and could now have up and running in about an hour and then fairly polished about an hour after that. It was outstanding! I'd used ChatGPT to help with the CW historgram over the last few weeks. Coding wennt quickly, but occasionally things got dropped on the floor. o3-mini has exceeded all my expectations by just cranking out code that works. Oh! Before I forget, the point of this post was to point out, (pun intended), an article Simon Willison mentioned that talks about the age of having ideas and making them real quickly. The article by Geoffrey Huntley talks about this kind of rapid prototyping and the cultural shifts among developers that are happening around it. Here's a sampling of what I've done with o3-mini: I've wanted a web control panel for our, (we is KO6BTY and I, KD0FNR), ham radio, Project TouCans ever since...

Project TouCans Web Control Panel ala Chat-GPT o3-mini

 Changing TouCans so that the Pico-W that controls the rig could be accessed by my smartphone hot spot did more than just get rid of the noise coming back from the rig. It also allowed me to start thinking about a Project TouCans web based control panel, a project I'd given up on last year when I decided that the Pico-W had to serve as the host of the network for TouCans rahter than just another device hooked onto a larger network. With TouCans hanging on the same netowrk as the laptop I usually use to control it,  the laptop was able to also access the internet at large through the phone's hot spot. I quickly thought through what this might enable. I then, asked o3-mini to write  up a web page for me, and before very long at all, I had: Messages typed into the 'Custom Message' block are sent out over the keyer when the 'Send' button is clicked. The page contains panels that show both the Utah SDR that's most like to pick up TouCans, and the Reverse Beacon ...

Week In Review: TouCans Straight Key, ChatGPT, Tuna Salad Sender, and Halikey

 I started out the week without a straight key for TouCans. By the end of the week, I'd worked with ChatGPT to make the WiFi straight key for TouCans into something pretty cool that worked on both Windows and Chromebook. (Alsthough, Windows is one cool thing ahead at the moment, I'll get to that.) Having decided I wasn't going to be able to get a wired straight key, i took another look at why I'd gone down the wired straight key path. TouCans has had a WiFi sraight key since last year. The issue is that it didn't work with the Chromebook. It was written in Python, and it was a bit more of a chore than I wanted fix it.  Linux on the Chromebook didn't want to provide keyboard access so that a key could be pressed as a straight key.  It also didn't want to provide speaker access, so there was no sidetone. I decided to do an end run and asked ChatGPT to translate the Python version of the WiFi straight key to JavaScript. ChatGPT pulled off the task so perfectly ...

Halikey up and Running With TouCans Keyer and CW Metronome on Windows

 I finally found my Halikey yesterday! And even better, I was albe to put it to use pretty quickly. The tiny (to me) device used to link CW keys with computers had migrated to the floor below the end table where the cool baggy of Halibut Electronics stickers. For our house, with four kids and a dog, that wasn't much of a migration at all in the grand scheme of things. I first tried to use my Halikey with a Chromebook. I'm still working on that. I then got to work on Windows. Benefitting from the Chromebook debug work, (about an hour's worth), the Halikey was up and running in about 10 minutes!  Once again , I asked ChatGPT to translate code , (this time from a pull request from Mark Smith ), from Python to JavaScript. Most of my time in debug on the Windows box was realizing that ChatGPT had somehow taken the serial port sampling code out of a loop. I finally noticed that I could get different serial port signal values if I reloaded the page while shorting out two key le...

CW Metronome Feature ala ChatGPT: Downloadable CW Key Down/Up Histogram Images

 I added a new feature to the CW metronome, namely the ability to download a png image of your histogram to share document your improvement or to share  with others. Once again I used ChatGPT to sketch up the initial code , and then went from there. I'm definitely building software I wouldn't take the time to build otherwise. You can try the new feature on the existing CW metronome page . There's a demo video below. Videos

ChatGPT prototyping large html img downloads

 Last week, I asked ChatGPT to create header maps per QSO from a CZML map of my POTA outing. It dumped out code that I had to fuss a little bit with, but that did the job admirably. The output is text-encode png images in the console of the Cesium Sandcastle window. I would then download those images by copying them into an html file, opening the html file in a browser, and downloading each of the images individually. That was cool, until... Last night, I made 51 QSOs at US-4571 in San Francisco. That's a lot of files to download individually, so I asked ChatGPT: Please write a JavaScript, do not use React, that can save all the images from web page locally. It responded with code that downloaded the first 10 images. I asked it for a fix That only downloaded the first ten. Please modify the code so that it downloads all the imags and uses .png as the default extension. and it produced a modified version of the code that handily downloaded all 50. See the d...

Using ChatGPT to Add CW Straight Key Practice Metrics to the Project TouCans Keyer

 When hammering out CW on the amaetur radio bands, or anywhere else for that matter, it's important to be consistent. Your dahs should sound  like your dahs, your dits like your dits, and other hams should be able to tell where a word stopped and another one started. So, it occurred to me that since I was using the straight key for TouCans, I could have the JavaScript that communicates the key down and up actions to TouCans monitor and record my dah and dit lengths along with intra-character, (time between dahs and dits), intra-word, (time between letters), and word spacings. I asked ChatGPT if it could addd two histograms to measure these values to the web page I asked it to make for the web page yesterday, and voila! Right! I also asked ChatGPT to add a 'Practice Mode' button so that when I was practicing I didn't have to worry about calls being made to the Pico-W on TouCans. ChatGPT cranked out all the histogramming code quite easily. The only small snag was asking i...

ChatGPT Prototyping Project TouCans' Straight Key and Failing Fast

 It turns out MicroPython for the Raspberry Pi Pico-W doesn't support threads. Ask me how I know. :) I'm adding a straight key to Projec TouCans for SKCC straight key month . Getting the straight key to work on its own was pretty straightforward by tweaking and incorporating code that ChatGPT provided. The next step, after proving the key worked at all, was to get it to play nicely on the Pico-W with the autokeyer code that's already there. The auto-keyer is accessed over WiFi, (TouCans used to be used solely while embedded in a dipole antenna several feet of f the ground.) I asked ChatGPT to write some code for me that would enable me to easily switch back and forth between the straight key and the auto-keyer. The auto-keyer blocks while waiting on a socket access call, that's kind of a problem if you're not using the auto-keyer. ChatGPT's solution was to place the straight ke code and the auto-keyer codes in separate threads. It sounded good, but like I said,...

ChatGPT Prototyping of Ham Radio Mapping Applications

 I used ChatGPT to get a quick and dirty protoype for an application that would make a map of each individual QSO from a given CZML map I had already created. All in all, it took ChatGPT and I about 20 minutes to come up with a prototype of an application that takes one of my CZML POTA maps, walks through it QSO by QSO, creates a label on the map with embedded QSO information and then dumps out a text encoded PNG image of the QSO on an OpenStreets map. =======================draft notes, skip to next equals line till polished============== Here's my first question to ChatGPT: Can I write Javascript that positions and frames a Cesium Ion map based on data read in through a czml file? I quickly followed that up with  Please write a method to zoom to any polyline defined in the czml file. Zoom to each polyline, wait three seconds, and then zoom to the next polyline in the order they are defined in the file. Next, I asked for a single line at a time: Please modify the method...