Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:44 15 Aug 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Bryans Car Club Record Project

Author Message
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 07:57am 01 Aug 2026
Copy link to clipboard 
Print this post

G'day Guy's,
           Well it is time to start my own thread and I'm using several pico 3 computers all working together so the first thing to do was setup the snd.py and recv.py files which handles the wifi between the boards so here is the code

For the PICO1 send.py

>>> cat("send.py")
import socket, os
p = '/sd/1.jpg'
n = os.stat(p)[6]
s = socket.socket()
s.connect(('192.168.4.16', 6001))
s.write('back.jpg,' + str(n) + '\n')
f = open(p, 'rb')
g = 0
while True:
   b = f.read(1024)
   if not b:
       break
   s.write(b)
   g = g + len(b)
f.close()
s.close()
print('sent', g)
>>>


Now the recv.py

>>> cat("recv.py")
import socket
s = socket.socket()
s.bind(('0.0.0.0', 6001))
s.listen(1)
c, a = s.accept()
h = c.readline().decode().strip().split(',')
n = int(h[1])
f = open('/sd/' + h[0], 'wb')
g = 0
while g < n:
   b = c.read(1024)
   if not b:
       break
   f.write(b)
   g = g + len(b)
f.close()
c.close()
s.close()
print('got', g, 'of', n)


Now for PICO2

the send.py

>>> cat("send.py")
import socket, os
p = '/sd/cars/1.jpg'
n = os.stat(p)[6]
s = socket.socket()
s.connect(('192.168.4.1', 6001))
s.write('1.jpg,' + str(n) + '\n')
f = open(p, 'rb')
g = 0
while True:
   b = f.read(1024)
   if not b:
       break
   s.write(b)
   g = g + len(b)
f.close()
s.close()
print('sent', g)


For the recv.py

>>> cat("recv.py")
import socket
s = socket.socket()
s.bind(('0.0.0.0', 6001))
s.listen(1)
c, a = s.accept()
h = c.readline().decode().strip().split(',')
n = int(h[1])
f = open('/sd/' + h[0], 'wb')
g = 0
while g < n:
   b = c.read(1024)
   if not b:
       break
   f.write(b)
   g = g + len(b)
f.close()
c.close()
s.close()
print('got', g, 'of', n)


Now in our main.py

>>> cat("main.py")
import network
ap = network.WLAN(network.AP_IF)
ap.config(essid='pico1', password='pico1234')
ap.active(True)
synctime()


for the pico2

>>> cat("main.py")
import time
time.sleep(6)
wifi('pico1', 'pico1234')
>>>


This what I used to transfer a 440Kb file first via teraterm which was corrupt so setup my SDCard reader and putting the .py files on was easy. Now I did setup to the hotspot on my phone and left it going when we did the file transfer and the phone showed 0 data so the wifi just worked.

Now the file was 1.jpg which is a jpg file I got off the club page which is a car photo, now got the error progressive jpg files not supported so although the picture didn't show transferring it did.

Now after a day with Claude this what it had to say....

Sounds good. If it's useful for the writeup, the summary of where things landed: two Pico Computer 3 boards, one as AP and one as client, both coming up connected at boot with no intervention; TCP file transfer working both ways with a 441 KB JPEG as the test; and a SQLite-backed club system with member, cars and events pages on the HDMI GUI.

The AP-mode finding might be the most useful thing for other people there — it fails consistently if you reconfigure the interfaces live, and works reliably when each board sets its role once at boot from main.py. That cost us most of a morning and isn't in the manual.


Now what we came up for Day 1


club.zip

Now doing a ls("/sd")

>>> ls("/sd")
    <dir>  2024-12-06 10:22  Camera
    <dir>  2026-08-01 16:21  events
    <dir>  2025-09-01 16:02  Games
    <dir>  2026-08-01 12:55  members
    <dir>  2024-10-09 16:43  Music
    <dir>  2025-09-02 11:13  Programs
    <dir>  2025-08-26 09:06  System Volume Information
   440973  2026-08-01 11:21  1.jpg
     1948  2026-07-22 15:34  car_meet.py
     2051  2026-07-22 10:07  car_meet.txt
    11283  2026-07-25 11:14  carclub.py
    45056  2026-08-01 16:50  club.db
    23625  2026-08-01 16:50  club.py
     5654  2026-08-01 17:20  club.zip
     1688  2026-07-25 23:43  import_members.py
     4748  2026-07-25 23:43  main.py
      189  2026-07-23 15:18  members.csv
      126  2026-07-23 15:18  members.csv.bak
     8192  2026-08-01 16:31  members.db
     7011  2026-08-01 14:39  members.py
     2915  2026-08-01 04:35  menu.py
       42  2026-08-01 13:26  roles.txt
       18  2026-08-01 13:26  status.txt


we can see the club.py file is at 23Kb and best of the club.db file is 45Kb and once I did that this what Claude said

It's there — 23,625 bytes, timestamped 16:50. The 3456 figure was from the earlier listing before the transfer.

Better still: club.db exists at 45,056 bytes, same timestamp. So you've already run it and SQLite created the database with all five tables. That's the whole thing working.

Slight size difference from my 22,960 — probably line-ending conversion during the transfer, which is harmless for Python


So now decision is do I work on this tomorrow or go on a car meet drive to Lamaroo to play golf and get closet to the hole. I haven't taken my 1996 C200 Mercedes out since I transferred it over to historic rego.

Regards Bryan
Edited 2026-08-01 18:01 by Bryan1
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 10:13pm 02 Aug 2026
Copy link to clipboard 
Print this post

Well progressing slowly and getting there  

Now I have a 3 files, menu.py club.py and members.py now when menu.py is loaded clicking on any link box the pico does a reset then loads the page so not sure why it's doing that also when clicking the link to get back to menu.py it does a reset. Hopefully Claude can sort that out today.

Trying to explain how I want the text box's changed to Claude was very frustrating so this morning I will go thru and have a read of the code and do it myself then I can have a look first hand and see how the program is structured.

I do need to edit the send/recv .py's as now it's setup to transfer any file both ways  

Also setup a wifi connection page and when a users eesid and password is entered the * is shown for security on the password, connecting to my mobile worked first time  

So this jpg image problem will be on the cards to fix today so I can load all the cars on the facebook club page then when a volunteer has a look they can sort the car images out to go in each members page.

Regards Bryan
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 04:49am 03 Aug 2026
Copy link to clipboard 
Print this post

ok leaps and bounds this morning fixed the issue of resets and the code has now gone upto 48Kb

Now with the wifi going if a member points their browser to 10.108.72.47:8080 they can see the photo upload page
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4366
Posted: 11:03am 03 Aug 2026
Copy link to clipboard 
Print this post

  Bryan1 said  Now with the wifi going if a member points their browser to 10.108.72.47:8080 they can see the photo upload page

That's a private IP address, isn't it?

John
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 12:29pm 03 Aug 2026
Copy link to clipboard 
Print this post

  JohnS said  
  Bryan1 said  Now with the wifi going if a member points their browser to 10.108.72.47:8080 they can see the photo upload page

That's a private IP address, isn't it?

John


thats the IP address of board 2 and I pointed to that IP on my phone today and uploaded 2 pictures I took of my car. Once the pic was taken a prompt came up to save then on the webpage got to remove the 20 numbers that the mobile gave the JPG file and saved it as Bryan7.jpg.

About a minute later that webpage said upload complete and the photo page showed the new entry. I clicked on the file then clicked the show pic button then got a full screen picture on the HDMI. Now the incoming file is 5-6MB and the code resizes the picture down to 400KB while retaining full picture quality.
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 08:23am 05 Aug 2026
Copy link to clipboard 
Print this post

Well another good day's work on this project   got it setup now when the pico 3 starts the wifi connects then boots straight into club.py and setup a Export/Import page where the SD card is shown so files can imported and exported.

Now clicking on ALL Members then Export takes 2 clicks and the ticker displays all the infomation then it makes a time stamped CSV file. There is a box where the IP of the other boards is put in then click send and it will show whether the file sent or failed.

On the second board opening Export/ Import then clicking refresh will show the file and a double click on Import then the file is inserted into the code.

Got Claude to make a 100 member list so we could test it all out and sure enough board 2 had that 100 member file where it showed on the member page. As we now have 100 with the listbox just poit the mouse click and move up and down the list.

Now where Claude is having fun NOT is with jpg images that are imported by a mobile phone. As the mobile will add a 20 digit number as the file name on the webpage is a box where the filename can be saved then click upload and a minute or 2 later the file comes up in the photo page.   He setup a full screen view where once the image is loaded it stays there for 5 seconds then reverts back to the photo page but the images are too grainy and it does need to be better.

After tomorrows effort I will zip up club.py as honestly currently at 90KB a bit too big to put between
 

Regards Bryan
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 08:22am 06 Aug 2026
Copy link to clipboard 
Print this post

Ok Guy's finally ready to release V.20 with a total new club.py so all my details are not made public.

The last thing I did today was put in a help file system so the whole program can be understood.

For testing out the building of this code I used 2 PICO 3 boards and now got when an entry is saved all other boards are updated.

This does require a wifi connection to work between boards where the wifi page does all the connections.

Also is a ticker tape which shows what is going on which I have found very handy debugging.

Anyway this is built on SQL lite so guy's have a look and most of all the feedback is important as were are getting close to my club demonstration on the 3rd Tuesday of this month.


club.zip



Regards Bryan
Edited 2026-08-06 18:23 by Bryan1
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 09:15am 06 Aug 2026
Copy link to clipboard 
Print this post

Edit: Now what I am finding with with Board 2 is my mouse wifi USB doesn't start and pulling it out does get it going now it is freezing at times but it may be its on the way out but using the same mouse on board 1 it does work fine.

Tomorrow I will load up V0.14 and see if this persists on another new board to see if the problem is still there.
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 07:22am 08 Aug 2026
Copy link to clipboard 
Print this post

Finally switched over to code with Claude so now got my own GitHub  


Now I had a read of the GPS manual so got 3 GPS modules coming from Core Electronics which should be here next week.

Now as it was only yesterday I read about astro stuff how good is it when it's going as I gotta find a few things for the volunteers to do on the quiet times.

Now got a standard and scientific calculator page and slowly working on a 3D Model Editor.

Tomorrow this code gets it first look from someone else as I'm taking one board over to Sam tomorrow as my first 3D printed box should be done.

Regards Bryan
Edited 2026-08-08 17:38 by Bryan1
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11744
Posted: 07:52am 08 Aug 2026
Copy link to clipboard 
Print this post

  Quote  Edit: Now what I am finding with with Board 2 is my mouse wifi USB doesn't start and pulling it out does get it going now it is freezing at times but it may be its on the way out but using the same mouse on board 1 it does work fine.


Bryan, check if the hub chip is getting hot. If it is make the mod I posted on the board thread
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 08:24am 08 Aug 2026
Copy link to clipboard 
Print this post

I will give it a quick test in the morning before I take the board over to see Sam and I did find just taking the dongle out of the usb and re-inserting it back in got the mouse working.

Now on bootup it does show the mouse is connected so not sure what is going on anyway got Claude on my desktop now so it can have a look and see what is going on.

I do have to say this car club project is moving along at a rapid pace and it's starting to become a solid OS   on every software update and there was few everytime each board connected to wifi on boot then opening the wifi page saw they were both connected on the network. Doing a 1 letter edit and pressing save then update saw the changes on the other board straight away.

Also I will test the other 3 boards and see if the USB problem is there or not, now I did get an email saying a couple of boards had some yellowing and I had to give the OK for them to ship so I will have a look with my microscope and see if anything is a miss.

Regards Bryan
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 04:33am 09 Aug 2026
Copy link to clipboard 
Print this post

Well gotta say Sam was impressed with what I have done and one thing he did see before we even put a eesid and password in a pico2 was showing up on his wifi list   setup the wifi and found it wouldn't work on 5G so the 2.4G was switched on and soon enough the board was on wifi  

So pointed Sam to the ip address shown and the webpage came up so now got a kitty pic and gotta say 10 seconds after the send button it was showing in the files list  

also for the first time tried a keyboard/mouse wireless keyboard and it worked with no problems and this was the same board I fun with the mouse with so I don't think it's hardware related.

Regards Bryan
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3349
Posted: 04:56am 09 Aug 2026
Copy link to clipboard 
Print this post

  Quote  ... so I don't think it's hardware related.
Before you dismiss a hardware issue check the temperature of U35 as per Peter's modification
 
Bryan1

Guru

Joined: 22/02/2006
Location: Australia
Posts: 2213
Posted: 11:56am 09 Aug 2026
Copy link to clipboard 
Print this post

  phil99 said  
  Quote  ... so I don't think it's hardware related.
Before you dismiss a hardware issue check the temperature of U35 as per Peter's modification


A keyboard/mouse just worked at Sams today for an IT guy he was impressed so now I have a kitty picture in photos this club.py is coming of age to be my new OS I go too

I am on making a a 3D Model Editor in club.py  as what I'm doing today can really update it noe when I get to a stage of release it will be on my github or


club.zip


Claude stripped out most of my creds and on the pico3 it is an OS so try it and give feedback as it is a rock solid SPI machine

Now today's Claude lets make a 3D Model Editor within club, got all 3 axis sorted but go and test it as I do think I have a dead mouse.

Got a laptop and PC today with fresh win 10 on both now with a clean install I'm sure the old history will die.

But with 5 off pico 3 boards and Claude can modern software become out dated as each can become and a new family member of this micro-pyhon crowd OS as we make like it should be.

Let Dad make the situation program in the kids but now us old beggers found AI now was this call late as I am an old school Fitter/Machinist that just found something back in '03 to saying rules my day.

Anyway todays work a 3D Model Editor it was emeebed on club.py but dug it out so have a look and ask Claude to improve it as this is open source where one can make a .model file that when we get data we know what what to do maks .sSTL file or a G-code file and work out the steps needed.

so here is the source  

Regards Bryan
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026