|
Forum Index : Microcontroller and PC projects : AI Research Project Ongoing
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11779 |
Not yet but..... |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3870 |
Prompt for Claude Code: A program for you to write in MMBasic and get running on a WebMite Pico W RP2040 W: DS18B20 temperature sensors are on GP9 (ambient, ID-"A"), GP27 (upstairs boiler zone feed, "Y"), GP26 (Livingroom boiler zone feed, "X"), GP8 (Basement, "B"). Reading of 1000 is invalid. For ID "A" and "B" report changes of more than 1 degree; for X & Y, 5 degrees. Send result via UDP to port 46225 at 192.168.2.70. If ping of 192.168.2.70 doesn't work, send to 192.168.2.65. Format of record is ID temperature 1 2.7 timestamp (where timestamp is in the form YYMMDDhhmmss. Time is set with: WEB NTP -3 (ADT)--recalibrate when AST in effect. Note that the DS18B20 on GP8 is not presently connected, so fail gracefully. Webmite is at 192.168.2.37 There was some initial back and forth because it said it couldn't read the Webmite Manual PDF I had provided it, so it guessed about MMBasic syntax, but I used an Adobe online process to convert it to a Word docx, which it was fine with. It went on its merry way making and fixing syntax errors even faster than I do, and quickly produced a suitable program. I checked, and the udp logger was receiving and logging the message, but without CRLF. I asked it to add that. I said it would be replacing an ESP32-C3Supermini which frequently lost wifi, such that when I found I couldn't ping it, I power-cycled a Tasmotized SONOFF Basic switch that it was plugged into. Claude suggested adding a check and retry in the program, and setting up the watchdog. I said to go ahead and do that. I replaced the ESP, and it's running. No wifi dropouts so far. I bought 3 of the Pico 2 Ws from Adafruit for $7 each before I returned to Canada from Florida. I wish I'd bought 3 more--Adafruit wants $56 to ship to Canada. PiHut has become very expensive to ship to Canada (used to be cheap). Aliexpress prices are ridiculous for the 2W. MMBasic code development has never been easier. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4370 |
It can cope with such somewhat (only slightly, e.g. missing paren) malformed and quite terse input - wow. John |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3870 |
Also catches and silently adjusts misspellings and other errors. Pretty good at understanding what I meant rather than what I said--without asking me about it. Regarding terse, it did ask if I meant literally "1 2.7" or whether that stood for something. I said literally, and on it went. This morning I noted that I had no readings for today. I had forgotten to tell it to reset just after midnight. So I told it that, and it fixed it immediately--remotely, where I have no serial access from my laptop. While I am doing this over telnet with a "W" Pico, it should also work over serial. But it's the remote access that seals the deal for me. Pico W and 2 W for me going forward. So far the Pico W wifi seems more reliable than the connection on the ESP32-C3Supermini was that the Pico replaced--even though I had enhanced the ESP with a big cap on power and Peter Neufeld's great antenna mod from the Annex forum. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3870 |
In which ChatGPT in browser tells me how to instruct codex ChapGPT to connect a new current monitor I have Sonoff POWR316 current monitors flashed with Tasmota monitoring on/off and current and daily cumulative kWh usage on my fridge, freezer, well pump, and boiler. The monitoring program will also tell me if, for instance, the freezer is not cycling as often as expected. The Sonoff devices are polled every 3 seconds For the POWR316, you have to take it apart, flash it, and wire plug and socket. Making it grounded (3-prong in the U.S. and Canada) is another issue. Looking for an alternative, AI suggested the TP-Link KP125M--a 15A 3-prong plug and socket. The problem is, it uses its own protocol for being polled. I asked browser Chat to walk me through getting codex (running in Powershell) to talk to my Seagate Dockstar over serial, locate and talk to the KP125M. There was a fair amount of back and forth, with codex chat having to build a python tool on the Dockstar to facilitate access. At one point it looked like it would want to install gcc so it could compile on the Dockstar (which would have been fine), but it found another way. Now, without my having to take a device apart, I have another current-monitoring wifi switch (2 actually). I will use this to monitor all the electricity usage of my electronics suite (maybe a dozen devices) and then be able to shut it all down to test my backup power arrangement. It was a learning experience. I saw Chat instruct codex to do far more than I would have known to do. It's far more thorough and careful than I am. All throughout there were instructions, "First do no harm". So another productive experience with AI. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 2229 |
Lizby with those picoW's micro-python V1.28 can be flashed straight onto the picoW and with using AI setting it up will be breeze where it just works One can set it up for network and wifi too so with multiple devices the static IP is a huge bonus for transferring files. Got one 2040W talking to my club.py where it broadcasts to any of the 4 boards I have setup as I'm designing up a wifi GPS dongle so the GPS can get the best eye to the sky. Regards Bryan |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3870 |
Bryan -- I've been watching your progress with interest, how you're using AI to work with both hardware and software. Yes, I've had Claude Code talking directly to micropython on the Pico Computer 3 over serial (and also MMBasic). It's a huge step which takes me out of the grind of program development and extends the range of my use of the tools. Love your work with the car club. And the car diagnostics reader. What's the chance that you would ever meet a human who knew enough to do that and also had the free time to work through it with you? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 2229 |
Lisby claude can get into the pico3 via USB but as far as transferring files forget it as it just won't work, so there has been 100's of SDCard swaps with doing 4 boards. Now letting it have access it does do a heap of testing before committing to write the code. An email popped up this morning for a 38 pin round Merc plug to a 16 pinOBD2 plug only to find they won't ship to Oz from the US, anyway another link was there so getting one from Tasi so I'm looking to see if the pico3 has enough pins for the OBD2 and that new camera OV6220 (sp) as may aswell use all the pins on the pico. In the past we did try a USB stick without success and with this 10" IPS screen coming USB is going to be needed so the USB stack will be written for micro-python so the capacitive touch screen and USB sticks work for data transfer. Well with my C200 went for Sunday drive to my daughters place to pickup the first 3D printed box for the pico3 and on the way home the ABS light came on speedo stopped working and crawled home in first gear. So with me learning to hack the merc code so i can read all the faults will save a heap of money as getting the auto electrician to do does cost. The best part I told claude to include every car so it has all be included and with that addition it blow the code over 700KB so by the time I do release this it will more than likely be well over 1MB and just work. Regards Bryan |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |