I've got a problem! The sketch won't work on my ancient smart phone, which runs Android 2. I traced, and fixed, part of the problem, but I'm stuck with the rest of it.
1) The buttons didn't work due to onclick="fetch(document.location.origin+'/control?var=car&val=1'); in the button code. fetch() only works on browsers from around 2015-17, and my phone is older than that. I've managed to rewrite it using the older XMLHttpRequest, which works on my phone and the latest version of Firefox on Linux Mint.
2) I can't turn on the video stream, and trying to understand how this works is beyond me. I think I'd be happy with the video always on, but can't work that out either!
3) The sliders don't display at all. I've spent ages trying to find a way to create touch sliders, but the nearest I got was one that jumped to where I tapped the screen.
I'm happy using a mobile phone that just makes voice calls and sends texts, and bought this phone very cheaply on eBay to see what it can do. So I don't want to spend many times what I paid for it just to drive a model car!
Either I'm after some help, or just warning anyone else who might want to use it on a very old phone!
Can you control it from your computer? If it works from the browser on you computer then you may be SOL on the phone. I may have the same issue when I get to trying out my phone it is an iPhone 5 and can't be upgrade past IOS 10. I have found any recent apps aren't even loadable but I not sure what HTML version it might or might not support.
It looks like my computer is fine. The buttons get the right response on the Serial Monitor, and the video and LED turn on and off. The sliders control picture quality as they should. So I've no doubt that it will control the motor when the parts arrive.
I wish I could find some example code for sliders that would work on the phone. Building this car is supposed to be a quick project to help with more complex things I have planned, and I was hoping to be able to use the phone for testing these projects before building proper controllers for them. But I need a control on the phone that works like a potentiometer.
I'm hoping the programming board will work with other ESP32-CAMs as well, but so far it's failed to connect on the other two I have (all 3 are different makes). This needs further investigation, unless anyone knows the answer.
In my earlier post I couldn't get the programming board to work with my other ESP32-CAMs, but I've solved it now. The IO0 button on the programming board connects the pins marked PGM in Bill's diagram. So for many ESP32-CAMs, you need to press and hold that button before plugging in the USB cable, keep it held down while compiling and uploading takes place, and release it after the message "Hard resetting via RTS pin..." appears on the Arduino IDE. Then unplug the USB cable, and plug it in again. The sketch should then run.
The ESP32-CAM that came with the programming board works just like a normal Arduino. Plug in the USB cable, compile and upload the sketch, and it immediately starts to run. No buttons need to be pressed.
If you don't already have an FTDI adaptor, and will want to program more ESP32-CAMS in future, I think this board is worth buying, but I'm tempted to replace IO0 with an on-off switch to avoid a sore finger!!!
Well at least it isn't anything except your phone, and maybe mine when I get that far. Good luck with finding a work around. I may be looking for that as well, when I get time to jump into this video. Maybe someone else can jump into the fray and offer a solution.
Apparently software variants on old makes and versions of phones vary wildly, so it might not work for everyone, but it works on my HTC phone running Android 2.2.2 with Webkit 3.1. It will both slide, and jump to where the screen is tapped. It also works in Firefox 87.0 on Linux, with a mouse.
I thought I'd post this now, in case anyone else is following this. It looks like the web page will need a major rewrite, so it may take me some time, and the end result will be different to Bill's original to fit with my plans for the car. So it may be up to someone else to do an exact adaptation of the original.
Now I need to see if I can get the video to appear!
@regmason Reg, did you click on the "here" in the sentence, it is an embedded link to Amazon. I just checked it and it's working on my end so if isn't opening for you let me know. It is set to open in a new tab so that might be causing issues depending on your browser.
Either the contrast on my monitor is set wrong, or my 74 year old eyes could not see the highlighted 'here'. Thanks for your patience. Strange when I did a search on Amazon, these did not show up, just the old style skinny antennas.
@regmason That was my mistake , I should have underlined it so it was more pronounced. It is a subtle highlight on my monitor also, glad you found it though.
Trying to build this car, but I am having a problem with the code. Before even trying to upload it to the esp32, when I am just trying to verify it and/or save, I get the following error (on the 2nd code, the 'html' one):
on line 405 the code is: static esp_err_t index_handler(httpd_req_t *req){
and arduino ide returns the following error: 'httpd_req_t' was not declared in this scope
I am sure this is some rookie mistake on my part (I just copied and pasted the code to start with this project) but does anyone know what this is?
The rest of the parts arrived today, although thanks to a misleading eBay listing I've got a DRV8833 instead of the TB6612FNG. I've got too many of them already, but I'd already soldered the headers on before I noticed! I need to rewrite the motor driver code anyway, but didn't want the extra complication of using a different driver! Lets see what sort of damage I can do to this:
It's 1:24 scale, and has plenty of space inside. It's interesting to note that it's 2.4GHz, and the antenna is a very short piece of plain wire, so I'm wondering if the antenna I bought will be needed, as it's rather big for the car.
I think stage one, that I've started on, is to remove the circuit board, and connect the drive motor to one of the motor driver outputs. Then I'll see if the existing steering will work on the other one. It looks fairly straightforward to replace the steering motor with a servo to get proportional steering, but I'll take it one step at a time.
Once I'm sure it will work well enough, I'll have to cut a hole in the windscreen for the camera, and work out how I'm going to mount it. It takes three AA batteries, but could be rewired to take one or two of the same size, so I'm thinking that I may try using the same sized Li-ion batteries. I don't know how much the Wi-Fi will drain them.
It's got headlights that come on when the car is going forwards, but I think they need a proper switch. Rear lights, and reversing lights, will be quite challenging to add to the body, so maybe I won't!
I'm currently wiring up a breadboard, so this may actually happen!
Trying to build this car, but I am having a problem with the code. Before even trying to upload it to the esp32, when I am just trying to verify it and/or save, I get the following error (on the 2nd code, the 'html' one):
on line 405 the code is: static esp_err_t index_handler(httpd_req_t *req){
and arduino ide returns the following error: 'httpd_req_t' was not declared in this scope
I am sure this is some rookie mistake on my part (I just copied and pasted the code to start with this project) but does anyone know what this is?
I've just tried doing this and it worked first time. Try it again, or download the files from the link in the blue Resources box near the bottom of the page, which is what I originally did.
We use cookies on the DroneBot Workshop Forums to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.