
Take care when turning DHCP ON. Before doing so, ensure a DHCP server on the network is available to provide the
sensor with an IP address. If you turn DHCP ON and lose contact with the sensor, follow the
Contact With Sensor on page 88
Command:
curl --data "dhcp=[on|off]" http://192.168.1.201/cgi/setting/net
10.2.4 curl Example using Python
The script below demonstrates how to do basic operations with a sensor using PycURL, a Python package built on libcurl.
It works in Python 2 and 3. For more information on PycURL go to:
The script expects the sensor to have its default IP address. If it’s different, change Base_URL accordingly.
The sensor object contains the interface to the actual sensor. A buffer is required because PycURL does not provide stor-
age for the network response. After each sensor request, the HTTP response code is checked for success.
The first operation is to reset the sensor. After a delay, the script changes a couple of sensor parameters. Waiting another
10 seconds (for the motor to spin up), sensor status is obtained and printed to standard out.
import pycurl
try:
from io import BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
import urllib2
import json
import time
def sensor_do(s, url, pf, buf):
s.setopt(s.URL, url)
s.setopt(s.POSTFIELDS, pf)
s.setopt(s.WRITEDATA, buf)
s.perform()
rcode = s.getinfo(s.RESPONSE_CODE)
success = rcode in range(200, 207)
print('%s %s: %d (%s)' % (url, pf, rcode, 'OK' if success else 'ERROR'))
return success
Base_URL = 'http://192.168.1.201/cgi/'
sensor = pycurl.Curl()
buffer = BytesIO()
rc = sensor_do(sensor, B'reset', urlencode({'data':'reset_system'}), buffer)
if rc:
time.sleep(10)
rc = sensor_do(sensor, B'setting', urlencode({'rpm':'300'}), buffer)
if rc:
time.sleep(1)
rc = sensor_do(sensor, B'setting', urlencode({'laser':'on'}), buffer)
if rc:
time.sleep(10)
84
VLS-128 User Manual
DRAFT
Содержание VLS-128
Страница 1: ...VLS 128 User Manual 63 9483 Rev A DRAFT ...
Страница 63: ...Figure 9 8 VLS 128 Azimuth Offsets by Elevation Chapter 9 Sensor Data 63 DRAFT ...
Страница 102: ...C 3 VLS 128 Optical Keep Out Zone Figure C 3 VLS 128 Optical Keep Out Zone 86 0137 REV A 102 VLS 128 User Manual DRAFT ...
Страница 104: ...D 1 Interface Box Wiring Diagram Figure D 1 Interface Box Wiring Diagram 86 0107A 104 VLS 128 User Manual DRAFT ...
Страница 105: ...D 2 Interface Box Schematic Figure D 2 Interface Box Schematic 69 8230A Appendix D Wiring Diagrams 105 DRAFT ...