Notifications
Clear all

ESP32cam Robot Car

18 Posts
3 Users
0 Likes
301 Views
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  

Hi

I am new to the forum and wondered if someone might be able to help with my understanding of html.

I have compiled and uploaded the code for the robot car and it works a treat. ย 

I am now modifying the code for an underwater ROV that I an putting together.

ย 

I have successfully added some additional buttons in the table that will be used to control the ballast tank motor.

Iโ€™d like to modify the code so that the video stream defaults to on rather than off but just canโ€™t work out how to do this. I know its related to the button but need a bit of help to work out how that button works as it if different to how the other buttons work.

I have also coded a safety timeout so that if no commands are received by the web server for two minutes (i.e. due to wifi signal loss or out of range) it will automatically surface.

Love the Dronebot website , full of useful and interesting stuff

Many thanks

Paul


   
Quote
Topic Tags
Will
 Will
(@will)
Famed Member
Joined: 2 years ago
Posts: 2286
 

@pkdj

Maybe I'm misinterpreting your question, but I don't think this is an html problem.

Just work this button the opposite way from the other buttons. Start with the camera wired on and label the button "Camera off". When the button is pressed, turn the camera off and change the button label to "Camera on" and when it's pressed turn the camera on and change the button label as above. Rinse and repeat ๐Ÿ™‚

Experience is what you get when you don't get what you want.


   
ReplyQuote
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  

Hi Will

ย 

Thanks for your response. You are spot on with your understanding of my request and thatโ€™s exactly how I would like it to work but unfortunately I canโ€™t fathom out how that particular button works and how to โ€˜reverseโ€™ its operation.


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 2 years ago
Posts: 2286
 

@pkdjย 

OK, let's try it from a different direction, have you created any other buttons that work to turn something to "on" which started in the off position ?

Experience is what you get when you don't get what you want.


   
ReplyQuote
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  

Hi Will,

Yes, I have created an additional 6 buttons which activate various actions when pressed. ย All of these buttons return a variable when pressed and it just a matter of checking the variable and coding according with โ€˜ifโ€™ statements. I created the additional buttons by copying/pasting/ modifying the html and associated code once J worked out how those buttons worked.

The HTML for the video stream button is more complicated and I canโ€™t work out where the stream is turned on/off and how the button does it.ย 


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 2 years ago
Posts: 2286
 

@pkdjย 

I'm confused, you already have a working button to start and stop the camera ?

Experience is what you get when you don't get what you want.


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 2 years ago
Posts: 4440
 

@pkdj How far does WiFi penetrate water?

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  

Hi Ron

ย 

WiFi does not penetrate water ( as far as I am aware) because frequency is too high, but with the ESP32CAM board you can attach an external antenna. ย So I have tested adding an antenna with a 5 metre extension cable and range is not affected by the extension cable. So my plan is that the ROV will be underwater but the antenna will be mounted on a float above the water connected to the ROV by the extension cable

ย 


   
Ron and THRandell reacted
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 2 years ago
Posts: 4440
 

@will I took a quick peek at the project, it looks to me like the buttons are a part of the HTML. I have zero training or experience with HTML so can't help too much.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  

Hi Will

ย 

Yes there is already a button but on power up the default status of the stream is off and I have to press the button to turn it on. ย Iโ€™d like to change it so that on power up the stream is on without having to press the button. Just canโ€™t work out how to make that change. I can see that it is something to do with the line of HTML that starts with โ€˜document.addEventListenerโ€™ and have tried a few changes without success.


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 2 years ago
Posts: 4440
 

@pkdj I take it you have no training in antenna theory and design.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  

Hi Ron

ย 

you are correct, no training in antenna design. Purely working on the โ€˜suck it and seeโ€™ method and practical results.


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 2 years ago
Posts: 4440
 

@pkdj Since you have no profile info re training, experience and I don't see an entry in the introduction forum for you telling us that plus a BRIEF first project description, it's very difficult to use the appropriate language to your training/experience. From what little I have seen you will need to be relatively experienced in HTML otherwise it will be a MAJOR challenge. Good luck.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 2 years ago
Posts: 4440
 

@pkdj VERY roughly, antennas must be the correct length for the frequency. You can't just add a random length cable, and these frequencies (2.5/5GHz) require very small antennas. I am planning on building a ROV too, I will use ethernet, not WiFi.

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
 PKDJ
(@pkdj)
Active Member
Joined: 3 months ago
Posts: 8
Topic starter  
Thanks Ron, new to the forum, will update my profile.
ย 
Project is an underwater ROV that is based on the ESP32CAM robot car. ย Iโ€™m modifying the code/html to control thrusters and ballast tank motors instead of wheels.ย 

Will post some updates as I progress.
ย 
Thanks

   
ReplyQuote
Page 1 / 2