Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:46 27 Nov 2024 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 : WebMite + Arducam

Author Message
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 09:05am 16 Aug 2023
Copy link to clipboard 
Print this post

WebCam.bas V1.0 (a misnomer as it most certainly cannot do video!)
A single shot camera function tethered to a WEB server.

Included in zip file index.html, some pictures and a ReadMe text file.
The pictures are a little grainy due to camera too close to subject matter.
Default image size 320x240, however several image sizes are possible.
The image(s) is/are saved to flash file system so should be minimized!
May be of interest to someone



led
Edit; just noticed an error in the html file, final line should be:
</html>
Hope that's all

WebCam.zip
Edited 2023-08-16 19:20 by led-bloon
Miss you George
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 07:50pm 24 Aug 2023
Copy link to clipboard 
Print this post

thank you for all the work on this great program.  I got my Arducam and hooked it up successfully.   I can capture a jpg, so I know the camera is functioning.  It does
not transfer to index.html though.

this is what I see as an error.  Line 73 says Invalid  in a program.
I'm don't know what that means.  I did send the jpg via telnet to my pc. I know the arducam works.
> option list
WebMite MMBasic Version 5.07.08b11
OPTION WIFI NETGEAR57, **************, PICOE6614C311B5
OPTION TCP SERVER PORT 80
OPTION TELNET CONSOLE ON
> OPTION COLOURCODE ON
> run
Camera I2C channel pass!
Camera SPI channel pass!
Camera sensor configured
Starting WEB server
Press any key to exit!
[73] If cnt% = 0 Then Continue
Error : Invalid in a program
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 09:39pm 24 Aug 2023
Copy link to clipboard 
Print this post

My apologies.
I didn't test the thing after doing some "tidy ups". Big mistake.
Here is v1.1 (tested!)
led

WebCam11.zip
Miss you George
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 08:39pm 25 Aug 2023
Copy link to clipboard 
Print this post

It worked like a charm the first time!!!!!
awesome program.  I'm really going to learn a lot study it.  I ordered more cameras
and 4 new PICO W boards.  I have a young technician where I work who is interested
in all things raspberry pi.  I going to give the camera and pico with your program.
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 09:29pm 05 Sep 2023
Copy link to clipboard 
Print this post

I'm baffled.  LOL

I built 4 duplicates of the webcam circuit.  None of them work. I swapped cameras
with my original circuit and the "new cameras" work.  I get a time out error

aved 18016 bytes
> run
Camera I2C channel pass!
Camera SPI channel pass!
Camera sensor configured
WEB server started at 00:09:15
Press any key to exit!
Timeout Bytes rxed: 65536
Timeout Bytes rxed: 65536
I'm done!

I'm not sure what it means

I edited the line

SPI READ 4096, buf%()  ' Read the data
     For i%=0 To 4095: Print #1 ,Chr$(buf%(i%));: Next i%
     j%=j%+4096: siz%=siz%-4096

Instead of Print #1 I printed to the screen.  there was no data.  I did this on the good working circuit and there was plenty of data.

I got my picos from Amazon and the cameras from Amazon too.  I don't think the hardware is the problem.  I copied out the basic program form the known good circuit
and put it into the 4 bad ones, just too be sure I didn't have an editing problem.

do you know what Timeout Bytes received is telling me?
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 02:42am 06 Sep 2023
Copy link to clipboard 
Print this post

This was a known problem (by me and the site I translated from).
Try the latest v1.2 with a bug fix, if not...

There is a Const "SHUTTER" set at 10000 (10 seconds) as an overall
timeout waiting for the camera to complete transfer of the jpg image.
You can either increase that timeout (add 1000 or 2000), and see if
things improve, or add an "ON ERROR IGNORE" to the code.
What size jpg are you expecting to get? (640x480? bigger?)

The fact that you get 65536 rings an alarm bell (flash writes are in blocks
of 256) - will have to do some (non-camera) tests with this.
Hope this is helpful
led

WebCam12.zip
Edited 2023-09-06 13:02 by led-bloon
Miss you George
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 08:25pm 06 Sep 2023
Copy link to clipboard 
Print this post

I would hold off on this for now, I think I understand a logic problem
when I clear the interrupt flag. Browsers use multiple threads to request
information (files/images) to speed up the presentation of the WEB page.
Because index.html is a small file, and only requests ONE jpg image, the
current code is probably border-line working (my guess).
I will try changing the logic to account for multiple interrupts.
led
Miss you George
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 08:33pm 06 Sep 2023
Copy link to clipboard 
Print this post

This sounds encouraging, thank you.  I did just finish trying webcam12.  I got the same results. I previously tried different jpg sizes, and shutter times. I'll await the next revision.
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 07:34am 07 Sep 2023
Copy link to clipboard 
Print this post

Decided to drop using interrupts and just do simple polling.
Easier and seems to work quite well, so please try v1.3.
There's a readme file with extra info.
led
WebCam13.zip
Miss you George
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 10:41pm 07 Sep 2023
Copy link to clipboard 
Print this post

I tried version 1.3  Still no pictures.  I swapped cameras. No result
I transferred Test.jpg to my pc.  When I looked at it with a hex editor, its all 00
even though in the directory its 160 kbytes. Very confusing.  Thanks for still trying
this weekend I will hook up an oscilloscope to the camera.
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 05:08am 10 Sep 2023
Copy link to clipboard 
Print this post

My error discovered.  Please accept my apology. All versions of your program work fine. My error was swapping GP3 and GP4 in all the subsequent circuits I made.
I now have 6 copies of the camera that work just fine.  Next up is powering the board and camera with a lithium ion cell.  I will try to run it remotely.
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 06:09am 10 Sep 2023
Copy link to clipboard 
Print this post

I have made the WebService() sub a little more "bullet proof"
in V1.4, and it is recommended to upgrade.
If you are looking at remote installation, the WEB NTP call
is not 100% guaranteed, use an ON ERROR or Watchdog to get
around any failures, with AUTORUN enabled or add RTC module.
led

WebCam14.zip
Miss you George
 
crazycloud
Newbie

Joined: 20/08/2023
Location: United States
Posts: 37
Posted: 05:04pm 10 Sep 2023
Copy link to clipboard 
Print this post

here is a jpg from the yard via telnet. version 14 seems to run faster.

 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 08:44pm 10 Sep 2023
Copy link to clipboard 
Print this post

Nice   Puts my yard to shame!
led
Miss you George
 
Print this page


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

© JAQ Software 2024