Home | Trees | Indices | Help |
---|
|
autobahn.asyncio.websocket.WebSocketServerProtocol --+ | PymataIOT
This class implements the PyMata Websocket interface. JSON command messages are received via Websocket connection, decoded and mapped to an associated PyMata method to be executed operation. The methods below are not intended to be called directly. The JSON message format is documented as part of the method description. All JSON reply messages (to be handled by the client) will also be documented for within the description. usage: pymata_iot.py [-h] [-host HOSTNAME] [-port PORT] [-wait WAIT] [-comport COM] [-sleep SLEEP] optional arguments: -h, --help show this help message and exit -host HOSTNAME Server name or IP address -port PORT Server port number -wait WAIT Arduino wait time -comport COM Arduino COM port -sleep SLEEP sleep tune in ms.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
This is the "constructor" for PymataIOT. It sets up a translation dictionary using incoming JSON commands and maps them to command methods.
|
This method reads and returns the last reported value for an analog pin. Normally not used since analog pin updates will be provided automatically as they occur with the analog_message_reply being sent to the client after set_pin_mode is called. (see enable_analog_reporting for message format).
|
This method writes a value to an analog pin. It is used to set the output of a PWM pin or the angle of a Servo.
|
This method reads and returns the last reported value for a digital pin. Normally not used since digital pin updates will be provided automatically as they occur with the digital_message_reply being sent to the client after set_pin_mode is called.. (see enable_digital_reporting for message format)
|
This method writes a zero or one to a digital pin.
|
Disable Firmata reporting for an analog pin.
|
Disable Firmata reporting for a digital pin.
|
Enable Firmata reporting for an analog pin.
|
Enable Firmata reporting for a digital pin.
|
Configure 2 pins for FirmataPlus encoder operation.
|
This is a polling method to read the last cached FirmataPlus encoder value. Normally not used. See encoder config for the asynchronous report message format.
|
This method retrieves a latch table entry for an analog pin. See constants.py for definition of reply message parameters.
|
This method retrieves the Firmata analog map. Refer to: http://firmata.org/wiki/Protocol#Analog_Mapping_Query to interpret the reply The command JSON format is: {"method":"get_analog_map","params":["null"]}
|
This method retrieves the Firmata capability report. Refer to http://firmata.org/wiki/Protocol#Capability_Query The command format is: {"method":"get_capability_report","params":["null"]}
|
This method retrieves a latch table entry for a digital pin. See constants.py for definition of reply message parameters.
|
This method retrieves the Firmata firmware version. See: http://firmata.org/wiki/Protocol#Query_Firmware_Name_and_Version JSON command: {"method": "get_firmware_version", "params": ["null"]}
|
This method retrieves a Firmata pin_state report for a pin.. See: http://firmata.org/wiki/Protocol#Pin_State_Query
|
This method retrieves the Firmata protocol version. JSON command: {"method": "get_protocol_version", "params": ["null"]}
|
This method retrieves the PyMata release version number. JSON command: {"method": "get_pymata_version", "params": ["null"]}
|
This method initializes the I2c and sets the optional read delay (in microseconds). It must be called before doing any other i2c operations for a given device.
|
This method retrieves the last value read for an i2c device identified by address. This is a polling implementation and i2c_read_request and i2c_read_request_reply may be a better alternative.
|
This method sends an I2C read request to Firmata. It is qualified by a single shot, continuous read, or stop reading command. Special Note: for the read type supply one of the following strings: "I2C_READ" "I2C_READ | I2C_END_TX_MASK" "I2C_READ_CONTINUOUSLY" "I2C_READ_CONTINUOUSLY | I2C_END_TX_MASK"
|
This method performs an I2C write at a given I2C address,
|
This method controls a piezo device to play a tone. It is a FirmataPlus feature. Tone command is TONE_TONE to play, TONE_NO_TONE to stop playing.
|
This method sets the an analog latch for a given analog pin, providing the threshold type, and latching threshold.
|
This method sets the a digital latch for a given digital pin, the threshold type, and latching threshold.
|
This method sets the pin mode for the selected pin. It handles: Input, Analog(Input) PWM, and OUTPUT. Servo is handled by servo_config().
|
This method sets the Firmata sampling interval in ms.
|
This method configures 2 pins to support HC-SR04 Ping devices. This is a FirmataPlus feature.
|
This method retrieves the last sonar data value that was cached. This is a polling method. After sonar config, sonar_data_reply messages will be sent automatically.
|
This method configures a pin for servo operation. The servo angle is set by using analog_write().
|
This method configures 4 pins for stepper motor operation. This is a FirmataPlus feature.
|
This method activates a stepper motor motion. This is a FirmataPlus feature.
|
Websocket management message. This message is received when the client closes the connection. A console status message is printed and and the interface is shutdown before exiting.
|
WebSocket management method. This method issues a console status message for Websocket connection establishment.
|
Websocket management method. This method receives JSON messages from the Websocket client. All messages are assumed to be text. If a binary message is sent, a console status message is generated. The JSON command is interpreted and translated to a method call to handle the command request.
|
WebSocket management method. This method issues a console status message for the opening of a Websocket connection. It sends a Firmata reset command to the Arduino.
|
This method handles the analog message received from pymata_core
|
This method handles analog_latch data received from pymata_core
|
This method handles the digital message received from pymata_core
|
This method handles the digital latch data message received from pymata_core
|
This method handles the encoder data message received from pymata_core
|
This method handles the i2c read data message received from pymata_core.
|
This method handles the i2c cached read data received from pymata_core.
|
This method handles sonar data received from pymata_core.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Jul 18 11:34:08 2015 | http://epydoc.sourceforge.net |