Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
Version 2.26 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYsLab authored and MrYsLab committed Oct 20, 2018
1 parent efc259a commit 5efe7bb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
24 changes: 16 additions & 8 deletions documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## Release 2.26
20 October 2018

* Incorporates changes for issues #82, 83, and 84
* Default arduino_wait time increased from 2 to 4 seconds
* Timeout in get_firmware_version increased to 4 seconds


## Release 2.25
23 August 2018

Expand Down Expand Up @@ -29,8 +37,8 @@
## Release 2.20
16 April 2018

Modified comments to generate pdoc API documentation.
No functional changes.
* Modified comments to generate pdoc API documentation.
* No functional changes.


8 April 2018
Expand Down Expand Up @@ -67,7 +75,7 @@ No functional changes.

* This release is now fully compatible with StandardFirmata 2.5.3
* On-Line API Documents Updated to reflect new command

* Update pymata_iot.py to use websockets instead of autobahn.

* setup.py added dependency of websockets and removed autobahn/txaio dependencies
Expand Down Expand Up @@ -132,7 +140,7 @@ No functional changes.
* [Pixy Cam](http://charmedlabs.com/default/pixy-cmucam5/) support courtesy of Dave Fisher and Leigh Andrew Mathews of the [Rose Hulman Institute of Technology](http://www.rose-hulman.edu/)
* pymata_core and pymata3 updated for Pixy Cam support
* A new firmata sketch, FirmataPlusRBPixy has been added to the Arduino libraries

### Updates
* All FirmataPlus sketches have been updated for the latest dependencies libraries
* The sleep_tune paramater default was modified to 0.0001 for pymata_core and added to pymata3
Expand Down Expand Up @@ -234,7 +242,7 @@ FirmataPlusRB updated to report encoder readings every 100 ms.

* Callbacks for both pymata_core and pymata3 can selected to be either asyncio coroutines or direct calls.
* Default is direct call.

* Option provided in encoder_config() for support of hall effect wheel encoders.

* Minor bug fixes.
Expand All @@ -261,7 +269,7 @@ FirmataPlusRB updated to report encoder readings every 100 ms.

19 July 2015

Data format returned from i2c_read_request was normalized from Firmata 2byte format to expected data
Data format returned from i2c_read_request was normalized from Firmata 2byte format to expected data
representation.


Expand All @@ -279,5 +287,5 @@ representation.
* FirmataPlus updated to be in sync with StandardFirmata 2.4.3

* Updated private_constants.py and constants.py to be consistent with StandardFirmata 2.4.3


2 changes: 1 addition & 1 deletion pymata_aio/private_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PrivateConstants:
SYSEX_REALTIME = 0x7F # MIDI Reserved for realtime messages

# reserved for PyMata
PYMATA_VERSION = "2.25"
PYMATA_VERSION = "2.26"

# each byte represents a digital port
# and its value contains the current port settings
Expand Down
28 changes: 16 additions & 12 deletions pymata_aio/pymata_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PymataCore:
perform Arduino pin auto-detection.
"""

def __init__(self, arduino_wait=2, sleep_tune=0.0001, log_output=False,
def __init__(self, arduino_wait=4, sleep_tune=0.0001, log_output=False,
com_port=None, ip_address=None, ip_port=2000,
ip_handshake='*HELLO*'):
"""
Expand Down Expand Up @@ -294,12 +294,16 @@ def start(self):
self.the_task = self.loop.create_task(self._command_dispatcher())

# get arduino firmware version and print it
firmware_version = self.loop.run_until_complete(self.get_firmware_version())
if self.log_output:
log_string = "\nArduino Firmware ID: " + firmware_version
logging.exception(log_string)
else:
print("\nArduino Firmware ID: " + firmware_version)
try:
firmware_version = self.loop.run_until_complete(self.get_firmware_version())
if self.log_output:
log_string = "\nArduino Firmware ID: " + firmware_version
logging.exception(log_string)
else:
print("\nArduino Firmware ID: " + firmware_version)
except TypeError:
print('Do you have the correct Firmata sketch loaded?')
sys.exit(0)

# try to get an analog pin map. if it comes back as none - shutdown
report = self.loop.run_until_complete(self.get_analog_map())
Expand Down Expand Up @@ -776,7 +780,7 @@ async def get_firmware_version(self):
while self.query_reply_data.get(
PrivateConstants.REPORT_FIRMWARE) == '':
elapsed_time = time.time()
if elapsed_time - current_time > 2:
if elapsed_time - current_time > 4:
return None
await asyncio.sleep(self.sleep_tune)
return self.query_reply_data.get(PrivateConstants.REPORT_FIRMWARE)
Expand Down Expand Up @@ -987,7 +991,7 @@ async def send_reset(self):
try:
await self._send_command([PrivateConstants.SYSTEM_RESET])
except RuntimeError:
exit(0)
sys.exit(0)

async def servo_config(self, pin, min_pulse=544, max_pulse=2400):
"""
Expand Down Expand Up @@ -1685,7 +1689,7 @@ async def _report_firmware(self, sysex_data):

name = sysex_data[3:-1]
firmware_name_iterator = iter(name)

# convert each element from two 7-bit bytes into characters, then add each
# character to the version string
for e in firmware_name_iterator:
Expand Down Expand Up @@ -1834,7 +1838,7 @@ def _discover_port(self):
locations.append('end')
# for everyone else, here is a list of possible ports
else:
locations = ['dev/ttyACM0', '/dev/ttyACM0', '/dev/ttyACM1',
locations = ['/dev/ttyACM0', '/dev/ttyACM1',
'/dev/ttyACM2', '/dev/ttyACM3', '/dev/ttyACM4',
'/dev/ttyACM5', '/dev/ttyUSB0', '/dev/ttyUSB1',
'/dev/ttyUSB2', '/dev/ttyUSB3', '/dev/ttyUSB4',
Expand Down Expand Up @@ -1866,7 +1870,7 @@ def _discover_port(self):
print('Unable to find Serial Port, Please plug in '
'cable or check cable connections.')
detected = None
exit()
sys.exit()
if self.log_output:
log_string = 'Using COM Port: ' + detected
logging.info(log_string)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='pymata-aio',
version='2.25',
version='2.26',
packages=['pymata_aio'],
install_requires=['pyserial', 'websockets'],
url='https://github.com/MrYsLab/pymata-aio/wiki',
Expand Down

0 comments on commit 5efe7bb

Please sign in to comment.