mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1460 from kwagyeman/kwabena/fix_network_usage_in_scripts
Kwabena/fix network usage in scripts
This commit is contained in:
commit
d322bcf0de
@ -20,7 +20,7 @@ sensor.skip_frames(time = 2000)
|
|||||||
omv.disable_fb(True)
|
omv.disable_fb(True)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over USB or WIFI.
|
# allowing your OpenMV Cam to be controlled over USB or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
@ -30,21 +30,21 @@ omv.disable_fb(True)
|
|||||||
#
|
#
|
||||||
interface = rpc.rpc_usb_vcp_slave()
|
interface = rpc.rpc_usb_vcp_slave()
|
||||||
|
|
||||||
# Uncomment the below line to setup your OpenMV Cam for control over WiFi.
|
# Uncomment the below line to setup your OpenMV Cam for control over the lan.
|
||||||
#
|
#
|
||||||
# * ssid - WiFi network to connect to.
|
# network_if = network.LAN()
|
||||||
# * ssid_key - WiFi network password.
|
# network_if.active(True)
|
||||||
# * ssid_security - WiFi security.
|
# network_if.ifconfig('dhcp')
|
||||||
# * port - Port to route traffic to.
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_slave(ssid="",
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
# ssid_key="",
|
|
||||||
# ssid_security=network.WINC.WPA_PSK,
|
# Uncomment the below line to setup your OpenMV Cam for control over the wlan.
|
||||||
# port=0x1DBA,
|
#
|
||||||
# mode=network.WINC.MODE_STA,
|
# network_if = network.WLAN(network.STA_IF)
|
||||||
# static_ip=None)
|
# network_if.active(True)
|
||||||
|
# network_if.connect('your-ssid', 'your-password')
|
||||||
|
#
|
||||||
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Call Backs
|
# Call Backs
|
||||||
|
|||||||
@ -20,7 +20,7 @@ sensor.skip_frames(time = 2000)
|
|||||||
omv.disable_fb(True)
|
omv.disable_fb(True)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over USB or WIFI.
|
# allowing your OpenMV Cam to be controlled over USB or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
@ -30,21 +30,21 @@ omv.disable_fb(True)
|
|||||||
#
|
#
|
||||||
interface = rpc.rpc_usb_vcp_slave()
|
interface = rpc.rpc_usb_vcp_slave()
|
||||||
|
|
||||||
# Uncomment the below line to setup your OpenMV Cam for control over WiFi.
|
# Uncomment the below line to setup your OpenMV Cam for control over the lan.
|
||||||
#
|
#
|
||||||
# * ssid - WiFi network to connect to.
|
# network_if = network.LAN()
|
||||||
# * ssid_key - WiFi network password.
|
# network_if.active(True)
|
||||||
# * ssid_security - WiFi security.
|
# network_if.ifconfig('dhcp')
|
||||||
# * port - Port to route traffic to.
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_slave(ssid="",
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
# ssid_key="",
|
|
||||||
# ssid_security=network.WINC.WPA_PSK,
|
# Uncomment the below line to setup your OpenMV Cam for control over the wlan.
|
||||||
# port=0x1DBA,
|
#
|
||||||
# mode=network.WINC.MODE_STA,
|
# network_if = network.WLAN(network.STA_IF)
|
||||||
# static_ip=None)
|
# network_if.active(True)
|
||||||
|
# network_if.connect('your-ssid', 'your-password')
|
||||||
|
#
|
||||||
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Call Backs
|
# Call Backs
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
import image, network, omv, rpc, sensor, struct, time
|
import image, network, omv, rpc, sensor, struct, time
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to control over CAN, I2C, SPI, UART, or WIFI.
|
# allowing your OpenMV Cam to control over CAN, I2C, SPI, UART, or LAN/WLAN.
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
# Choose the interface you wish to control an OpenMV Cam over.
|
# Choose the interface you wish to control an OpenMV Cam over.
|
||||||
|
|||||||
@ -12,7 +12,7 @@ sensor.set_framesize(sensor.QVGA)
|
|||||||
sensor.skip_frames(time = 2000)
|
sensor.skip_frames(time = 2000)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, or WIFI.
|
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
|
|||||||
@ -14,7 +14,7 @@ sensor.set_framesize(sensor.QVGA)
|
|||||||
sensor.skip_frames(time = 2000)
|
sensor.skip_frames(time = 2000)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, USB VCP, or WiFi.
|
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, USB VCP, or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
@ -64,21 +64,21 @@ interface = rpc.rpc_uart_slave(baudrate=115200)
|
|||||||
#
|
#
|
||||||
# interface = rpc.rpc_usb_vcp_slave()
|
# interface = rpc.rpc_usb_vcp_slave()
|
||||||
|
|
||||||
# Uncomment the below line to setup your OpenMV Cam for control over WiFi.
|
# Uncomment the below line to setup your OpenMV Cam for control over the lan.
|
||||||
#
|
#
|
||||||
# * ssid - WiFi network to connect to.
|
# network_if = network.LAN()
|
||||||
# * ssid_key - WiFi network password.
|
# network_if.active(True)
|
||||||
# * ssid_security - WiFi security.
|
# network_if.ifconfig('dhcp')
|
||||||
# * port - Port to route traffic to.
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_slave(ssid="",
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
# ssid_key="",
|
|
||||||
# ssid_security=network.WINC.WPA_PSK,
|
# Uncomment the below line to setup your OpenMV Cam for control over the wlan.
|
||||||
# port=0x1DBA,
|
#
|
||||||
# mode=network.WINC.MODE_STA,
|
# network_if = network.WLAN(network.STA_IF)
|
||||||
# static_ip=None)
|
# network_if.active(True)
|
||||||
|
# network_if.connect('your-ssid', 'your-password')
|
||||||
|
#
|
||||||
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Call Backs
|
# Call Backs
|
||||||
@ -127,7 +127,7 @@ def person_detection(data):
|
|||||||
# data is unused
|
# data is unused
|
||||||
def qrcode_detection(data):
|
def qrcode_detection(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.VGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
sensor.set_windowing((320, 240))
|
sensor.set_windowing((320, 240))
|
||||||
codes = sensor.snapshot().find_qrcodes()
|
codes = sensor.snapshot().find_qrcodes()
|
||||||
if not codes: return bytes() # No detections.
|
if not codes: return bytes() # No detections.
|
||||||
@ -139,7 +139,7 @@ def qrcode_detection(data):
|
|||||||
# data is unused
|
# data is unused
|
||||||
def all_qrcode_detection(data):
|
def all_qrcode_detection(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.VGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
sensor.set_windowing((320, 240))
|
sensor.set_windowing((320, 240))
|
||||||
codes = sensor.snapshot().find_qrcodes()
|
codes = sensor.snapshot().find_qrcodes()
|
||||||
if not codes: return bytes() # No detections.
|
if not codes: return bytes() # No detections.
|
||||||
@ -177,7 +177,7 @@ def all_apriltag_detection(data):
|
|||||||
# data is unused
|
# data is unused
|
||||||
def datamatrix_detection(data):
|
def datamatrix_detection(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.VGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
sensor.set_windowing((320, 240))
|
sensor.set_windowing((320, 240))
|
||||||
codes = sensor.snapshot().find_datamatrices()
|
codes = sensor.snapshot().find_datamatrices()
|
||||||
if not codes: return bytes() # No detections.
|
if not codes: return bytes() # No detections.
|
||||||
@ -189,7 +189,7 @@ def datamatrix_detection(data):
|
|||||||
# data is unused
|
# data is unused
|
||||||
def all_datamatrix_detection(data):
|
def all_datamatrix_detection(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.VGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
sensor.set_windowing((320, 240))
|
sensor.set_windowing((320, 240))
|
||||||
codes = sensor.snapshot().find_datamatrices()
|
codes = sensor.snapshot().find_datamatrices()
|
||||||
if not codes: return bytes() # No detections.
|
if not codes: return bytes() # No detections.
|
||||||
@ -202,7 +202,7 @@ def all_datamatrix_detection(data):
|
|||||||
# data is unused
|
# data is unused
|
||||||
def barcode_detection(data):
|
def barcode_detection(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.VGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
sensor.set_windowing((sensor.width(), sensor.height()//8))
|
sensor.set_windowing((sensor.width(), sensor.height()//8))
|
||||||
codes = sensor.snapshot().find_barcodes()
|
codes = sensor.snapshot().find_barcodes()
|
||||||
if not codes: return bytes() # No detections.
|
if not codes: return bytes() # No detections.
|
||||||
@ -213,7 +213,7 @@ def barcode_detection(data):
|
|||||||
# data is unused
|
# data is unused
|
||||||
def all_barcode_detection(data):
|
def all_barcode_detection(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.VGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
sensor.set_windowing((sensor.width(), sensor.height()//8))
|
sensor.set_windowing((sensor.width(), sensor.height()//8))
|
||||||
codes = sensor.snapshot().find_barcodes()
|
codes = sensor.snapshot().find_barcodes()
|
||||||
if not codes: return bytes() # No detections.
|
if not codes: return bytes() # No detections.
|
||||||
@ -244,7 +244,7 @@ def color_detection(data):
|
|||||||
#
|
#
|
||||||
# data is unused
|
# data is unused
|
||||||
def jpeg_snapshot(data):
|
def jpeg_snapshot(data):
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE)
|
sensor.set_pixformat(sensor.RGB565)
|
||||||
sensor.set_framesize(sensor.QVGA)
|
sensor.set_framesize(sensor.QVGA)
|
||||||
return sensor.snapshot().compress(quality=90).bytearray()
|
return sensor.snapshot().compress(quality=90).bytearray()
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,79 @@
|
|||||||
|
# RTSP Video Server
|
||||||
|
#
|
||||||
|
# This example shows off how to stream video over RTSP with your OpenMV Cam.
|
||||||
|
#
|
||||||
|
# You can use a program like VLC to view the video stream by connecting to the
|
||||||
|
# OpenMV Cam's IP address.
|
||||||
|
|
||||||
|
import network, omv, rtsp, sensor, time
|
||||||
|
|
||||||
|
# RTP MJPEG streaming works using JPEG images produced by the OV2640/OV5640 camera modules.
|
||||||
|
# Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image
|
||||||
|
# in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display.
|
||||||
|
|
||||||
|
# FFPLAY will correctly handle JPEGs produced by OpenMV software.
|
||||||
|
|
||||||
|
sensor.reset()
|
||||||
|
|
||||||
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
|
sensor.set_framesize(sensor.QVGA)
|
||||||
|
|
||||||
|
# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
|
||||||
|
#
|
||||||
|
# This needs to be done when manually compressing jpeg images at higher quality
|
||||||
|
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
|
||||||
|
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
|
||||||
|
|
||||||
|
omv.disable_fb(True)
|
||||||
|
|
||||||
|
# Setup Network Interface
|
||||||
|
|
||||||
|
network_if = network.LAN()
|
||||||
|
network_if.active(True)
|
||||||
|
network_if.ifconfig('dhcp')
|
||||||
|
|
||||||
|
# Setup RTSP Server
|
||||||
|
|
||||||
|
server = rtsp.rtsp_server(network_if)
|
||||||
|
|
||||||
|
# For the call back functions below:
|
||||||
|
#
|
||||||
|
# `pathname` is the name of the stream resource the client wants. You can ignore this if it's not
|
||||||
|
# needed. Otherwise, you can use it to determine what image object to return. By default the path
|
||||||
|
# name will be "/".
|
||||||
|
#
|
||||||
|
# `session` is random number that will change when a new connection is established. You can use
|
||||||
|
# session with a dictionary to differentiate different accesses to the same file name.
|
||||||
|
|
||||||
|
def setup_callback(pathname, session):
|
||||||
|
print("Opening \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
def play_callback(pathname, session):
|
||||||
|
print("Playing \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
def pause_callback(pathname, session): # VLC only pauses locally. This is never called.
|
||||||
|
print("Pausing \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
def teardown_callback(pathname, session):
|
||||||
|
print("Closing \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
server.register_setup_cb(setup_callback)
|
||||||
|
server.register_play_cb(play_callback)
|
||||||
|
server.register_pause_cb(pause_callback)
|
||||||
|
server.register_teardown_cb(teardown_callback)
|
||||||
|
|
||||||
|
# Track the current FPS.
|
||||||
|
clock = time.clock()
|
||||||
|
|
||||||
|
# Called each time a new frame is needed.
|
||||||
|
def image_callback(pathname, session):
|
||||||
|
clock.tick()
|
||||||
|
img = sensor.snapshot()
|
||||||
|
# Markup image and/or do various things.
|
||||||
|
print(clock.fps())
|
||||||
|
return img
|
||||||
|
|
||||||
|
# Stream does not return. It will call `image_callback` when it needs to get an image object to send
|
||||||
|
# to the remote rtsp client connecting to the server.
|
||||||
|
|
||||||
|
server.stream(image_callback)
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
# RTSP Video Server
|
||||||
|
#
|
||||||
|
# This example shows off how to stream video over RTSP with your OpenMV Cam.
|
||||||
|
#
|
||||||
|
# You can use a program like VLC to view the video stream by connecting to the
|
||||||
|
# OpenMV Cam's IP address.
|
||||||
|
|
||||||
|
import network, omv, rtsp, sensor, time
|
||||||
|
|
||||||
|
# RTP MJPEG streaming works using JPEG images produced by the OV2640/OV5640 camera modules.
|
||||||
|
# Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image
|
||||||
|
# in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display.
|
||||||
|
|
||||||
|
# FFPLAY will correctly handle JPEGs produced by OpenMV software.
|
||||||
|
|
||||||
|
sensor.reset()
|
||||||
|
|
||||||
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
||||||
|
sensor.set_framesize(sensor.QVGA)
|
||||||
|
|
||||||
|
# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
|
||||||
|
#
|
||||||
|
# This needs to be done when manually compressing jpeg images at higher quality
|
||||||
|
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
|
||||||
|
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.
|
||||||
|
|
||||||
|
omv.disable_fb(True)
|
||||||
|
|
||||||
|
# Setup Network Interface
|
||||||
|
|
||||||
|
network_if = network.WLAN(network.STA_IF)
|
||||||
|
network_if.active(True)
|
||||||
|
network_if.connect('your-ssid', 'your-password')
|
||||||
|
|
||||||
|
# Setup RTSP Server
|
||||||
|
|
||||||
|
server = rtsp.rtsp_server(network_if)
|
||||||
|
|
||||||
|
# For the call back functions below:
|
||||||
|
#
|
||||||
|
# `pathname` is the name of the stream resource the client wants. You can ignore this if it's not
|
||||||
|
# needed. Otherwise, you can use it to determine what image object to return. By default the path
|
||||||
|
# name will be "/".
|
||||||
|
#
|
||||||
|
# `session` is random number that will change when a new connection is established. You can use
|
||||||
|
# session with a dictionary to differentiate different accesses to the same file name.
|
||||||
|
|
||||||
|
def setup_callback(pathname, session):
|
||||||
|
print("Opening \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
def play_callback(pathname, session):
|
||||||
|
print("Playing \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
def pause_callback(pathname, session): # VLC only pauses locally. This is never called.
|
||||||
|
print("Pausing \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
def teardown_callback(pathname, session):
|
||||||
|
print("Closing \"%s\" in session %d" % (pathname, session))
|
||||||
|
|
||||||
|
server.register_setup_cb(setup_callback)
|
||||||
|
server.register_play_cb(play_callback)
|
||||||
|
server.register_pause_cb(pause_callback)
|
||||||
|
server.register_teardown_cb(teardown_callback)
|
||||||
|
|
||||||
|
# Track the current FPS.
|
||||||
|
clock = time.clock()
|
||||||
|
|
||||||
|
# Called each time a new frame is needed.
|
||||||
|
def image_callback(pathname, session):
|
||||||
|
clock.tick()
|
||||||
|
img = sensor.snapshot()
|
||||||
|
# Markup image and/or do various things.
|
||||||
|
print(clock.fps())
|
||||||
|
return img
|
||||||
|
|
||||||
|
# Stream does not return. It will call `image_callback` when it needs to get an image object to send
|
||||||
|
# to the remote rtsp client connecting to the server.
|
||||||
|
|
||||||
|
server.stream(image_callback)
|
||||||
@ -20,7 +20,7 @@ sensor.skip_frames(time = 2000)
|
|||||||
omv.disable_fb(True)
|
omv.disable_fb(True)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over USB or WIFI.
|
# allowing your OpenMV Cam to be controlled over USB or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
@ -30,21 +30,21 @@ omv.disable_fb(True)
|
|||||||
#
|
#
|
||||||
interface = rpc.rpc_usb_vcp_slave()
|
interface = rpc.rpc_usb_vcp_slave()
|
||||||
|
|
||||||
# Uncomment the below line to setup your OpenMV Cam for control over WiFi.
|
# Uncomment the below line to setup your OpenMV Cam for control over the lan.
|
||||||
#
|
#
|
||||||
# * ssid - WiFi network to connect to.
|
# network_if = network.LAN()
|
||||||
# * ssid_key - WiFi network password.
|
# network_if.active(True)
|
||||||
# * ssid_security - WiFi security.
|
# network_if.ifconfig('dhcp')
|
||||||
# * port - Port to route traffic to.
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_slave(ssid="",
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
# ssid_key="",
|
|
||||||
# ssid_security=network.WINC.WPA_PSK,
|
# Uncomment the below line to setup your OpenMV Cam for control over the wlan.
|
||||||
# port=0x1DBA,
|
#
|
||||||
# mode=network.WINC.MODE_STA,
|
# network_if = network.WLAN(network.STA_IF)
|
||||||
# static_ip=None)
|
# network_if.active(True)
|
||||||
|
# network_if.connect('your-ssid', 'your-password')
|
||||||
|
#
|
||||||
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Call Backs
|
# Call Backs
|
||||||
|
|||||||
@ -20,7 +20,7 @@ sensor.skip_frames(time = 2000)
|
|||||||
omv.disable_fb(True)
|
omv.disable_fb(True)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over USB or WIFI.
|
# allowing your OpenMV Cam to be controlled over USB or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
@ -30,21 +30,21 @@ omv.disable_fb(True)
|
|||||||
#
|
#
|
||||||
interface = rpc.rpc_usb_vcp_slave()
|
interface = rpc.rpc_usb_vcp_slave()
|
||||||
|
|
||||||
# Uncomment the below line to setup your OpenMV Cam for control over WiFi.
|
# Uncomment the below line to setup your OpenMV Cam for control over the lan.
|
||||||
#
|
#
|
||||||
# * ssid - WiFi network to connect to.
|
# network_if = network.LAN()
|
||||||
# * ssid_key - WiFi network password.
|
# network_if.active(True)
|
||||||
# * ssid_security - WiFi security.
|
# network_if.ifconfig('dhcp')
|
||||||
# * port - Port to route traffic to.
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_slave(ssid="",
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
# ssid_key="",
|
|
||||||
# ssid_security=network.WINC.WPA_PSK,
|
# Uncomment the below line to setup your OpenMV Cam for control over the wlan.
|
||||||
# port=0x1DBA,
|
#
|
||||||
# mode=network.WINC.MODE_STA,
|
# network_if = network.WLAN(network.STA_IF)
|
||||||
# static_ip=None)
|
# network_if.active(True)
|
||||||
|
# network_if.connect('your-ssid', 'your-password')
|
||||||
|
#
|
||||||
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Call Backs
|
# Call Backs
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
import image, network, omv, rpc, sensor, struct, time
|
import image, network, omv, rpc, sensor, struct, time
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to control over CAN, I2C, SPI, UART, or WIFI.
|
# allowing your OpenMV Cam to control over CAN, I2C, SPI, UART, or LAN/WLAN.
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
# Choose the interface you wish to control an OpenMV Cam over.
|
# Choose the interface you wish to control an OpenMV Cam over.
|
||||||
|
|||||||
@ -12,7 +12,7 @@ sensor.set_framesize(sensor.QVGA)
|
|||||||
sensor.skip_frames(time = 2000)
|
sensor.skip_frames(time = 2000)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, or WIFI.
|
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
|
|||||||
@ -14,7 +14,7 @@ sensor.set_framesize(sensor.QVGA)
|
|||||||
sensor.skip_frames(time = 2000)
|
sensor.skip_frames(time = 2000)
|
||||||
|
|
||||||
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
# The RPC library above is installed on your OpenMV Cam and provides mutliple classes for
|
||||||
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, USB VCP, or WiFi.
|
# allowing your OpenMV Cam to be controlled over CAN, I2C, SPI, UART, USB VCP, or LAN/WLAN.
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Choose the interface you wish to control your OpenMV Cam over.
|
# Choose the interface you wish to control your OpenMV Cam over.
|
||||||
@ -64,21 +64,21 @@ interface = rpc.rpc_uart_slave(baudrate=115200)
|
|||||||
#
|
#
|
||||||
# interface = rpc.rpc_usb_vcp_slave()
|
# interface = rpc.rpc_usb_vcp_slave()
|
||||||
|
|
||||||
# Uncomment the below line to setup your OpenMV Cam for control over WiFi.
|
# Uncomment the below line to setup your OpenMV Cam for control over the lan.
|
||||||
#
|
#
|
||||||
# * ssid - WiFi network to connect to.
|
# network_if = network.LAN()
|
||||||
# * ssid_key - WiFi network password.
|
# network_if.active(True)
|
||||||
# * ssid_security - WiFi security.
|
# network_if.ifconfig('dhcp')
|
||||||
# * port - Port to route traffic to.
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_slave(ssid="",
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
# ssid_key="",
|
|
||||||
# ssid_security=network.WINC.WPA_PSK,
|
# Uncomment the below line to setup your OpenMV Cam for control over the wlan.
|
||||||
# port=0x1DBA,
|
#
|
||||||
# mode=network.WINC.MODE_STA,
|
# network_if = network.WLAN(network.STA_IF)
|
||||||
# static_ip=None)
|
# network_if.active(True)
|
||||||
|
# network_if.connect('your-ssid', 'your-password')
|
||||||
|
#
|
||||||
|
# interface = rpc.rpc_network_slave(network_if)
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Call Backs
|
# Call Backs
|
||||||
|
|||||||
@ -26,19 +26,15 @@ sensor.set_framesize(sensor.UXGA)
|
|||||||
|
|
||||||
omv.disable_fb(True)
|
omv.disable_fb(True)
|
||||||
|
|
||||||
# * ssid - WiFi network to connect to.
|
# Setup Network Interface
|
||||||
# * ssid_key - WiFi network password.
|
|
||||||
# * ssid_security - WiFi security.
|
|
||||||
# * port - Port to listen to (554).
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
|
|
||||||
server = rtsp.rtsp_server(ssid="",
|
network_if = network.LAN()
|
||||||
ssid_key="",
|
network_if.active(True)
|
||||||
ssid_security=network.WINC.WPA_PSK,
|
network_if.ifconfig('dhcp')
|
||||||
port=554,
|
|
||||||
mode=network.WINC.MODE_STA,
|
# Setup RTSP Server
|
||||||
static_ip=None)
|
|
||||||
|
server = rtsp.rtsp_server(network_if)
|
||||||
|
|
||||||
# For the call back functions below:
|
# For the call back functions below:
|
||||||
#
|
#
|
||||||
@ -11,6 +11,8 @@ import network, omv, rtsp, sensor, time
|
|||||||
# Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image
|
# Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image
|
||||||
# in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display.
|
# in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display.
|
||||||
|
|
||||||
|
# FFPLAY will correctly handle JPEGs produced by OpenMV software.
|
||||||
|
|
||||||
sensor.reset()
|
sensor.reset()
|
||||||
|
|
||||||
sensor.set_pixformat(sensor.JPEG) # Only supported by the OV2640/OV5640.
|
sensor.set_pixformat(sensor.JPEG) # Only supported by the OV2640/OV5640.
|
||||||
@ -24,19 +26,15 @@ sensor.set_framesize(sensor.UXGA)
|
|||||||
|
|
||||||
omv.disable_fb(True)
|
omv.disable_fb(True)
|
||||||
|
|
||||||
# * ssid - WiFi network to connect to.
|
# Setup Network Interface
|
||||||
# * ssid_key - WiFi network password.
|
|
||||||
# * ssid_security - WiFi security.
|
|
||||||
# * port - Port to listen to (554).
|
|
||||||
# * mode - Regular or access-point mode.
|
|
||||||
# * static_ip - If not None then a tuple of the (IP Address, Subnet Mask, Gateway, DNS Address)
|
|
||||||
|
|
||||||
server = rtsp.rtsp_server(ssid="",
|
network_if = network.WLAN(network.STA_IF)
|
||||||
ssid_key="",
|
network_if.active(True)
|
||||||
ssid_security=network.WINC.WPA_PSK,
|
network_if.connect('your-ssid', 'your-password')
|
||||||
port=554,
|
|
||||||
mode=network.WINC.MODE_STA,
|
# Setup RTSP Server
|
||||||
static_ip=None)
|
|
||||||
|
server = rtsp.rtsp_server(network_if)
|
||||||
|
|
||||||
# For the call back functions below:
|
# For the call back functions below:
|
||||||
#
|
#
|
||||||
@ -557,7 +557,7 @@ class rpc_usb_vcp_slave(rpc_slave):
|
|||||||
def put_bytes(self, data, timeout_ms): # protected
|
def put_bytes(self, data, timeout_ms): # protected
|
||||||
self.__usb_vcp.send(data, timeout=timeout_ms)
|
self.__usb_vcp.send(data, timeout=timeout_ms)
|
||||||
|
|
||||||
class rpc_wifi_master(rpc_master):
|
class rpc_network_master(rpc_master):
|
||||||
|
|
||||||
def __valid_tcp_socket(self): # private
|
def __valid_tcp_socket(self): # private
|
||||||
if self.__tcp__socket is None:
|
if self.__tcp__socket is None:
|
||||||
@ -587,17 +587,11 @@ class rpc_wifi_master(rpc_master):
|
|||||||
self.__udp__socket.close()
|
self.__udp__socket.close()
|
||||||
self.__udp__socket = None
|
self.__udp__socket = None
|
||||||
|
|
||||||
def __init__(self, ssid, ssid_key, ssid_security, ip, port=0x1DBA, mode=network.WINC.MODE_STA, static_ip=None): # private
|
def __init__(self, network_if, port=0x1DBA): # private
|
||||||
self._udp_limit = 1400
|
self._udp_limit = 1400
|
||||||
self._timeout_scale = 10
|
self._timeout_scale = 10
|
||||||
self.__winc = network.WINC(mode=mode)
|
self.__network = network_if
|
||||||
if mode == network.WINC.MODE_STA:
|
self.__myip = self.__network.ifconfig()[0]
|
||||||
if static_ip is not None: self.__winc.ifconfig(static_ip)
|
|
||||||
self.__winc.connect(ssid, key=ssid_key, security=ssid_security)
|
|
||||||
if not self.__winc.isconnected(): raise OSError("Failed to connect to network!")
|
|
||||||
elif mode == network.WINC.MODE_AP: self.__winc.start_ap(ssid, key=ssid_key, security=ssid_security)
|
|
||||||
else: raise ValueError("Invalid mode")
|
|
||||||
self.__myip = self.__winc.ifconfig()[0]
|
|
||||||
self.__myaddr = (self.__myip, port)
|
self.__myaddr = (self.__myip, port)
|
||||||
self.__slave_addr = (ip, port)
|
self.__slave_addr = (ip, port)
|
||||||
self.__tcp__socket = None
|
self.__tcp__socket = None
|
||||||
@ -708,7 +702,7 @@ class rpc_wifi_master(rpc_master):
|
|||||||
except OSError: self.__close_tcp_socket()
|
except OSError: self.__close_tcp_socket()
|
||||||
if l: raise OSError # Stop Stream.
|
if l: raise OSError # Stop Stream.
|
||||||
|
|
||||||
class rpc_wifi_slave(rpc_slave):
|
class rpc_network_slave(rpc_slave):
|
||||||
|
|
||||||
def __valid_tcp_socket(self): # private
|
def __valid_tcp_socket(self): # private
|
||||||
if self.__tcp__socket is None:
|
if self.__tcp__socket is None:
|
||||||
@ -734,17 +728,11 @@ class rpc_wifi_slave(rpc_slave):
|
|||||||
self.__udp__socket.close()
|
self.__udp__socket.close()
|
||||||
self.__udp__socket = None
|
self.__udp__socket = None
|
||||||
|
|
||||||
def __init__(self, ssid, ssid_key, ssid_security, port=0x1DBA, mode=network.WINC.MODE_STA, static_ip=None): # private
|
def __init__(self, network_if, port=0x1DBA): # private
|
||||||
self._udp_limit = 1400
|
self._udp_limit = 1400
|
||||||
self._timeout_scale = 10
|
self._timeout_scale = 10
|
||||||
self.__winc = network.WINC(mode=mode)
|
self.__network = network_if
|
||||||
if mode == network.WINC.MODE_STA:
|
self.__myip = self.__network.ifconfig()[0]
|
||||||
if static_ip is not None: self.__winc.ifconfig(static_ip)
|
|
||||||
self.__winc.connect(ssid, key=ssid_key, security=ssid_security)
|
|
||||||
if not self.__winc.isconnected(): raise OSError("Failed to connect to network!")
|
|
||||||
elif mode == network.WINC.MODE_AP: self.__winc.start_ap(ssid, key=ssid_key, security=ssid_security)
|
|
||||||
else: raise ValueError("Invalid mode")
|
|
||||||
self.__myip = self.__winc.ifconfig()[0]
|
|
||||||
self.__myaddr = (self.__myip, port)
|
self.__myaddr = (self.__myip, port)
|
||||||
self.__master_addr = None
|
self.__master_addr = None
|
||||||
self.__tcp__socket = None
|
self.__tcp__socket = None
|
||||||
|
|||||||
@ -37,15 +37,9 @@ class rtsp_server:
|
|||||||
self.__udp__socket.close()
|
self.__udp__socket.close()
|
||||||
self.__udp__socket = None
|
self.__udp__socket = None
|
||||||
|
|
||||||
def __init__(self, ssid, ssid_key, ssid_security, port=554, mode=network.WINC.MODE_STA, static_ip=None): # private
|
def __init__(self, network_if, port=554): # private
|
||||||
self.__winc = network.WINC(mode=mode)
|
self.__network = network_if
|
||||||
if mode == network.WINC.MODE_STA:
|
self.__myip = self.__network.ifconfig()[0]
|
||||||
if static_ip is not None: self.__winc.ifconfig(static_ip)
|
|
||||||
self.__winc.connect(ssid, key=ssid_key, security=ssid_security)
|
|
||||||
if not self.__winc.isconnected(): raise OSError("Failed to connect to network!")
|
|
||||||
elif mode == network.WINC.MODE_AP: self.__winc.start_ap(ssid, key=ssid_key, security=ssid_security)
|
|
||||||
else: raise ValueError("Invalid mode")
|
|
||||||
self.__myip = self.__winc.ifconfig()[0]
|
|
||||||
self.__myaddr = (self.__myip, port)
|
self.__myaddr = (self.__myip, port)
|
||||||
self.__tcp__socket = None
|
self.__tcp__socket = None
|
||||||
self.__udp__socket = None
|
self.__udp__socket = None
|
||||||
|
|||||||
@ -712,7 +712,7 @@ extern const int kernel_high_pass_3[9];
|
|||||||
#define IM_IS_GS(img) ((img)->pixfmt == PIXFORMAT_GRAYSCALE)
|
#define IM_IS_GS(img) ((img)->pixfmt == PIXFORMAT_GRAYSCALE)
|
||||||
#define IM_IS_RGB565(img) ((img)->pixfmt == PIXFORMAT_RGB565)
|
#define IM_IS_RGB565(img) ((img)->pixfmt == PIXFORMAT_RGB565)
|
||||||
#define IM_IS_BAYER(img) ((img)->is_bayer)
|
#define IM_IS_BAYER(img) ((img)->is_bayer)
|
||||||
#define IM_IS_JPEG(img) ((img)->pixfmt == PIXFORMAT_ID_JPEG)
|
#define IM_IS_JPEG(img) ((img)->pixfmt == PIXFORMAT_JPEG)
|
||||||
|
|
||||||
#define IM_X_INSIDE(img, x) \
|
#define IM_X_INSIDE(img, x) \
|
||||||
({ __typeof__ (img) _img = (img); \
|
({ __typeof__ (img) _img = (img); \
|
||||||
|
|||||||
@ -195,11 +195,11 @@ Creates a slave implementation of the `rpc` library to communicate over a USB VC
|
|||||||
|
|
||||||
Communication over USB is the most reliable and high speed way to connect an OpenMV Cam to a computer. However, as the OpenMV Cam has only one VCP port we recommend that you fully debug your script using the `rpc_usb_vcp_master` on your OpenMV using another `rpc` interface if possible as you will not be able to get error messages off the OpenMV Cam easily. For example, connecting the `rpc_usb_vcp_slave` to the `rpc_uart_master` on your OpenMV Cam at 115200 BPS over a USB-to-Serial adapter when debugging will make your life far easier. Alternatively, use the Ethernet or WiFi interface when debugging.
|
Communication over USB is the most reliable and high speed way to connect an OpenMV Cam to a computer. However, as the OpenMV Cam has only one VCP port we recommend that you fully debug your script using the `rpc_usb_vcp_master` on your OpenMV using another `rpc` interface if possible as you will not be able to get error messages off the OpenMV Cam easily. For example, connecting the `rpc_usb_vcp_slave` to the `rpc_uart_master` on your OpenMV Cam at 115200 BPS over a USB-to-Serial adapter when debugging will make your life far easier. Alternatively, use the Ethernet or WiFi interface when debugging.
|
||||||
|
|
||||||
## rpc_wifi_or_ethernet_master(slave_ip, my_ip="", port=0x1DBA):
|
## rpc_network_master(slave_ip, my_ip="", port=0x1DBA):
|
||||||
|
|
||||||
Creates a master implementation of the `rpc` library to communicate over WiFi or Ethernet. `slave_ip` is the IPV4 address of the `rpc` slave device. `my_ip` can be `""` which binds the master to any interface adapter to communicate to the slave. If `my_ip` is not `""` then it should be an IP address on the same subnet as `slave_ip`. `port` is a free port to use for UDP and TCP traffic.
|
Creates a master implementation of the `rpc` library to communicate over WiFi or Ethernet. `slave_ip` is the IPV4 address of the `rpc` slave device. `my_ip` can be `""` which binds the master to any interface adapter to communicate to the slave. If `my_ip` is not `""` then it should be an IP address on the same subnet as `slave_ip`. `port` is a free port to use for UDP and TCP traffic.
|
||||||
|
|
||||||
## rpc_wifi_or_ethernet_slave(my_ip="", port=0x1DBA):
|
## rpc_network_slave(my_ip="", port=0x1DBA):
|
||||||
|
|
||||||
Creates a slave implementation of the `rpc` library to communicate over WiFi or Ethernet. `my_ip` can be `""` which binds the slave to any interface adapter to communicate to the master. If `my_ip` is not `""` then it should be an IP address on the same subnet as the master. `port` is a free port to use for UDP and TCP traffic.
|
Creates a slave implementation of the `rpc` library to communicate over WiFi or Ethernet. `my_ip` can be `""` which binds the slave to any interface adapter to communicate to the master. If `my_ip` is not `""` then it should be an IP address on the same subnet as the master. `port` is a free port to use for UDP and TCP traffic.
|
||||||
|
|
||||||
|
|||||||
@ -437,7 +437,7 @@ class rpc_usb_vcp_slave(rpc_slave):
|
|||||||
if int(self.__ser.timeout) != 1: self.__ser.timeout = 1 # Changing this causes control transfers.
|
if int(self.__ser.timeout) != 1: self.__ser.timeout = 1 # Changing this causes control transfers.
|
||||||
return self.__get_bytes(buff)
|
return self.__get_bytes(buff)
|
||||||
|
|
||||||
class rpc_wifi_or_ethernet_master(rpc_master):
|
class rpc_network_master(rpc_master):
|
||||||
|
|
||||||
def __valid_tcp_socket(self): # private
|
def __valid_tcp_socket(self): # private
|
||||||
if self.__tcp__socket is None:
|
if self.__tcp__socket is None:
|
||||||
@ -584,7 +584,7 @@ class rpc_wifi_or_ethernet_master(rpc_master):
|
|||||||
except (socket.timeout, socket.error): self.__close_tcp_socket()
|
except (socket.timeout, socket.error): self.__close_tcp_socket()
|
||||||
if l: raise OSError # Stop Stream.
|
if l: raise OSError # Stop Stream.
|
||||||
|
|
||||||
class rpc_wifi_or_ethernet_slave(rpc_slave):
|
class rpc_network_slave(rpc_slave):
|
||||||
|
|
||||||
def __valid_tcp_socket(self): # private
|
def __valid_tcp_socket(self): # private
|
||||||
if self.__tcp__socket is None:
|
if self.__tcp__socket is None:
|
||||||
|
|||||||
@ -36,7 +36,7 @@ sys.stdout.flush()
|
|||||||
# * my_ip - IP address to bind to ("" to bind to all interfaces...)
|
# * my_ip - IP address to bind to ("" to bind to all interfaces...)
|
||||||
# * port - Port to route traffic to.
|
# * port - Port to route traffic to.
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_or_ethernet_master(slave_ip="xxx.xxx.xxx.xxx", my_ip="", port=0x1DBA)
|
# interface = rpc.rpc_network_master(slave_ip="xxx.xxx.xxx.xxx", my_ip="", port=0x1DBA)
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
# Call Back Handlers
|
# Call Back Handlers
|
||||||
|
|||||||
@ -36,7 +36,7 @@ sys.stdout.flush()
|
|||||||
# * my_ip - IP address to bind to ("" to bind to all interfaces...)
|
# * my_ip - IP address to bind to ("" to bind to all interfaces...)
|
||||||
# * port - Port to route traffic to.
|
# * port - Port to route traffic to.
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_or_ethernet_master(slave_ip="xxx.xxx.xxx.xxx", my_ip="", port=0x1DBA)
|
# interface = rpc.rpc_network_master(slave_ip="xxx.xxx.xxx.xxx", my_ip="", port=0x1DBA)
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
# Call Back Handlers
|
# Call Back Handlers
|
||||||
|
|||||||
@ -34,7 +34,7 @@ sys.stdout.flush()
|
|||||||
# * my_ip - IP address to bind to ("" to bind to all interfaces...)
|
# * my_ip - IP address to bind to ("" to bind to all interfaces...)
|
||||||
# * port - Port to route traffic to.
|
# * port - Port to route traffic to.
|
||||||
#
|
#
|
||||||
# interface = rpc.rpc_wifi_or_ethernet_master(slave_ip="xxx.xxx.xxx.xxx", my_ip="", port=0x1DBA)
|
# interface = rpc.rpc_network_master(slave_ip="xxx.xxx.xxx.xxx", my_ip="", port=0x1DBA)
|
||||||
|
|
||||||
# Uncomment the below lines to setup your OpenMV Cam for controlling over a UART (Serial / COM Port).
|
# Uncomment the below lines to setup your OpenMV Cam for controlling over a UART (Serial / COM Port).
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user