1/3/2024 0 Comments Python packet senderTo break out of the Python script loop, press Ctrl-C (Command-C on a Mac.) Method Open a Gecko OS Terminal to the Gecko OS device Display the JSON packet and the IP address.If the packet is parsed as valid JSON and the module IP address is received, return.When a packet is received, parse the packet for the module's IP address.Wait until the server receives a broadcast UDP packet from the module.While no IP address has been successfully parsed:.The python script runs on a test computer on the same Wi-Fi network as the Gecko OS device.Ĭopy the following python script to the test computer: broadcast_udp_packet.py To return it to the default state, perform a factory reset. The following assumes that the module starts in its default state. It then extracts the IP address from the JSON data. The Python script listens for UDP packets and validates any packet received as JSON data. The Gecko OS device is programmed with the factory default configuration. This application uses a Gecko OS device and a Python Script (Python v2.7). This application note demonstrates how to send and receive a broadcast UDP packet, and how to extract properties from the JSON format data. Properties include by default the IP address and the MAC address. The properties can be sent either as UDP packets to a UDP host or by a post request to an HTTP host. One of the nice things about the Python Scripts, and depending on your end goal, these can be scheduled to be executed using Task Scheduler, in Windows, or Automater, for Mac OS.Gecko OS devices broadcast module properties in JSON format.In one of the the attached Python Scripts as an example I will showcase how to send a STANDBY command to a camera at 192.168.100.88, via UDP, then wait five (5) minutes and finally issue a WAKEUP command.Once you've become somewhat familiar with working on the PTZOptics VISCA over IP commands using Packet Sender you could begin exploring simple Python Scripts that can execute these same HEX commands.At this point you should be able to send commands and inquiries to the camera using Packet Sender for testing of commands and simple operation.Note: The command library comes using the default camera IP of 192.168.100.88 for your purposes you may need to adjust this if your camera is at a different IP Once imported you can easily search the list of commands using the command titles as referenced in the PTZOptics VISCA over IP Commands document.Once installed you can connect PacketSender to the cloud to easily import our current PTZOptics VISCA over IP Command Library.Packet Sender Download: (Note: Donations are optional).Packet Sender is a free application that you can utilize to execute HEX commands via TCP or UDP to the cameras.For the purposes of this introduction I will focus on using Packet Sender and simple Python Scripts for getting started playing with these PTZOptics VISCA over IP commands.Please be aware of potential DEC to HEX and HEX to DEC translations that need to be made when building your commands.Note: The PTZOptics VISCA over IP commands can be issued as TCP (Port 5678) or UDP (Port 1259) to the camera and are always issued as HEX. The PTZOptics VISCA over IP Commands can be implemented into most modern coding from C, C#, C++, Python and more depending on the goal of your project.The PTZOptics VISCA over IP Commands offer substantially more capabilities than the more limited HTTP-CGI commands. ![]() PTZOptics VISCA over IP - Download Location: Note: The HTTP-CGI Command set is limited in comparison to the capabilities offered by PTZOptics VISCA / VISCA over IP Once you get more advanced these commands can easily be built into a customized web interface for operation.If executed in a web browser it would tell our camera at 192.168.100.88 to move to Preset 3.The final command would look as follows.So in this example we will use a camera with the IP address of 192.168.100.88 and we will recall preset 3.Here is the provided, with variables, preset recall command.that must be entered for proper execution of the command Please note that each of the commands features variables such as IP Address, Mode, Values, etc.In the beginning you can issue these commands by simply entering the strings into the URL bar on any modern web browser for execution.The HTTP-CGI Commands are likely the simplest form of control using simple POST & GET Commands.PTZOptics HTTP-CGI Commands - Download Page: ![]() Here is some insight on easy ways to test / implement control using these options. There are a few options for "remote" IP control of the cameras using either PTZOptics VISCA over IP or HTTP-CGI commands. ![]() Solution home PTZOptics Camera Control An Introduction to IP Control & Scripting for PTZOptics Cameras
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |