|
Forum Index : Microcontroller and PC projects : AI Research Project Ongoing
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11882 |
Not yet but..... |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3881 |
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: 4380 |
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: 3881 |
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: 3881 |
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: 2267 |
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: 3881 |
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: 2267 |
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 |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3881 |
I haven't tried to transfer large files, but it seems fine for small ones. With MMBasic on the Pico Computer 3, you could give Claude access over telnet while keeping serial for TeraTerm so you can observer what is happening. I think you'd then have fast file transfer. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 2076 |
This is all cool stuff |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3881 |
Prompt to Chat's codex (connected via serial to a Seagate Dockstar running OpenWrt): Nothing further for me to do but look at the output. ![]() ![]() This shows me again how little electricity it takes to provide the house with water from the well--in two months a maximum of about .25kWh in a day and an average of about .1kWh. That's on average about $.02 Canadian a day. The hard part is providing what is needed for the inrush current--upwards of 7kw for a fraction of a second. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 2267 |
Thanks for that tip with kicad Lizby I got sick of claude doing error by error with 3D model editor this morning I said well kicad will run on micro-python so do a ground re-write based on it and this arvo got the first glimpse and it does look promising as the drawi canvas is 100% better and not far away from snap tp grid working like clockwork. Now the PCB design will come after all the basics are sorted out so basically design the circuit up on one pico 3 then transfer it over to my future CNC project where I can mill and drill the PCB. I do want to get the 3D editor going so I'm all ready for the black Friday sales where I will finally get a 3D printer, for now just getting the lcd base STL done so I can get my 10.1" LCD mounted so I can carry it around and then testing out the GPS against my dashcam for speed will be a fun exercise. I got sick of claude trying to do firmware upgrades so today put Peters V.17 on a boartd and hot swapping works nicely, now club.py is setup to import files with its own checksum so SD card swaps are a thing of the past. Now when club.py is updated the USB stick is updated with the latest doce then while club.py is running hotswap the USB and goto file transfer select USB then one click on the file and a second click to import where the file size is shown uploading. Do a reboot and checkout the new code is much easier than SD card swaps. When this 3d model editor gets nice and stable I will release it Regards Bryan |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3881 |
Per Gemini, Claude, and ChatGPT can design PCBs -- sort of, I found this morning that with a version update, my codex instance (running in Powershell) has Astra available. I picked it, set it to max (next highest except for "multiple agents") and asked it to design a pretty simple ESP32 S2Mini plus p-ch mosfet plus 2N7000 driver to turn on/off 12V or 24V. I gave it a netlist which Chat in the browser had provided, and a prompt also provided by Chat. It started right in, but now has run out of tokens and says it can be restarted in 3 hours. I've set an alert on my phone. If it is able to complete the task and produce gerber files for JLCPCB and a working PCB, I don't really care how many token/timeslots it takes within the bounds of my monthly subscription. We'll see what it looks like. Could be a dog's breakfast, could be suitable for hobby use. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 2267 |
Well got alot done with 3D Model Editor this morning so pretty happy with that also got ssh all sorted so claude can now get to that that samsung computer that has a fresh win 10 install also a HDMI input so I'm running the pico 3 on the HDMI input and claude can listen and get real time data which is great for debugging.Now all of that is setup I have never really got into games so for a bit of fun I'm making a car racing game using the F1 tracks so a multi player game can be setup for racing. The owner is given 20K as a starting budget and cars range in price, now before each race a qualifying lap must be done to get grid positions and all of this is random so which cars win is upto the game not the players. Got the basic engine running and as it was getting late in the day setup 3 users and did the first race of 5, now each player is saved so after a reset the data is still there and after each lap random damage can occur and even crash's will be become part of the race. So owner that but expensive cars and have a bad run will have to do shootouts to earn cash to enter a race if on a bad trot. Not bad for a few hours of thought so got a new thing for Claude to do, for now got it running in club.py and I will get it exported so it can run stand alone once we get further down the track. Regards Bryan Edited 2026-09-08 18:40 by Bryan1 |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1554 |
This is a bit off-topic, but I've just been convinced that AI can produce really good things when it's in the hands of the right people. Episode 1 | Doctor Who Reboot Unofficial fan work, made with AI. Not made or endorsed by the BBC. Not for profit. All Doctor Who characters and trademarks belong to the BBC. Created as parody and pastiche (s.30A, Copyright, Designs and Patents Act 1988). Edited 2026-09-09 04:52 by Martin H. 'no comment |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4380 |
Good grief. Very surprised at how good that is! Oh, hang on... it's got a good understandable story and a good script. Makes a change!! The AI's passable. John Edited 2026-09-09 08:41 by JohnS |
||||
| Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1554 |
The story was written in the old Doctor Who tradition. I liked it better than many of the stories from recent series. There isn’t enough background information, but the credits list Thomas Vittlowe as the writer. So I think the AI was only used to produce the visuals and sound. 'no comment |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 9136 |
That appears to be the case. He's done an excellent job and has made very good use of the AI. I didn't find it intrusive at all. As you say, it's very much along the lines of the older stories - and I like that. Mick Zilog Inside! nascom.info for Nascom & Gemini |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3881 |
I've been tracking 6 mini solar panels with 6 INA226 modules and an ESP32 C3Supermini to see what clouds and shading is like on the face of my barn. ![]() There's an offscreen panel to the right on the ESE-facing barn roof. I had Chat produce a daily chart served on a Seagate Dockstar running OpenWrt. Today I asked Chat codex to gang six of these charts per HTML page. It had forgotten how to talk to the Dockstar, so phaffed about for a while doing that, but then produced 22 pages since May 15. Here's one with a couple of the least cloudy days. ![]() After giving the prompt (which I had browser Chat prepare), I had only one interaction: telling it that I had installed base64, which it had noted that it had tried to use for sending a program but it was unavailable (it completed without using base64). This makes it easy to see the massive effect that clouds have on these little panels. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on FOTS |
||||
Bryan1![]() Guru Joined: 22/02/2006 Location: AustraliaPosts: 2267 |
Had a visitor yesterday morning and claude had put club.py in an unusable state so I blasted it saying all the hard work went down the drain when it mattered. I told claude got mate coming around in the afternoon for a BBQ so the flip 6 better be working or else so we had a go at connecting the BT speaker on the command line which did work on the first try, playing a tune worked nicely with no cutouts and when my mate rocked up I told claude to start making a play list So for the next 4 hours as each playlist was gone thru not one glitch and for the first time since I bought the Flip 6 it went thru a full charge playing so when the music did stop a usb cable for charging soon got the music playing again.I sent the STL off to Sam yesterday and got the message just now the lcdbase is getting 3D printed so this afternoon I will be picking it up Regards Bryan |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |