File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ On your other device run VLC and connect to `rtsp:://IP.OF.RAS.PI::8554`
52
52
53
53
### Ultrasonics
54
54
55
+ ### Network
56
+ https://www.youtube.com/watch?v=bWwZF_zVf00
57
+
55
58
# Helpful links
56
59
* https://www.hackster.io/bestd25/pi-car-016e66
57
60
* https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/
Original file line number Diff line number Diff line change 8
8
client_socket = socket .socket ()
9
9
10
10
client_socket .connect (ip_address , port )
11
-
11
+ # Write bytes
12
12
connection = client_socket .makefile ('wb' )
13
13
try :
14
14
camera = picamera .Picamera ()
15
15
camera .vflip = True
16
- camera .resolution = (640 , 480 )
16
+ camera .resolution = (320 , 240 )
17
17
camera .start_preview ()
18
18
time .sleep (2 )
19
19
27
27
stream .seek (0 )
28
28
connection .write (stream .read ())
29
29
30
+ # Run the stream for 30 seconds
30
31
if time .time () - start > 30 :
31
32
break
33
+ stream .seek (0 )
34
+ stream .truncate ()
35
+
36
+ connection .write (struct .pack ('<L' , 0 ))
32
37
finally :
33
- break
38
+ connection .close ()
39
+ client_socket .close ()
Original file line number Diff line number Diff line change 9
9
server_socket .bind ((ip_address , port ))
10
10
server_socket .listen (0 )
11
11
12
+ # Read bytes
12
13
connection = server_socket .accept ()[0 ].makefile ('rb' )
13
14
14
15
try :
37
38
38
39
39
40
finally :
40
- pass
41
+ connection .close ()
42
+ server_socket .close ()
You can’t perform that action at this time.
0 commit comments