View Single Post
  #7   Spotlight this post!  
Unread 31-01-2017, 19:27
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 269
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: Clarity on Smart Dashboard Camera Mechanism

Quote:
Originally Posted by sgk525 View Post
I think I understand now. So I will replace line 34 of my server code with:

self.wfile.write('<img src="http://10.x.y.z:9090/stream.mjpg" height="240px" width="320px"/>')

and thread the server_serve_forever() statement, so that the pi can simultaneously process and set the images in a global variable, perhaps a queue.

So just for clarification, there isn't much I will have to do on my end other than set up a mjpeg stream with an appropriate send port and ip address. The smart dashboard will do the rest by finding the url and grabbing the images.
To be clear, while the format of the URL is what's in the src= portion above, SmartDashboard doesn't use or hit that line of code at all. SmartDashboard will try to connect to whatever URL you configure in its settings. The important line in your code is line 49, which sets up the HTTP server on a particular port.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote