Repository: kramble/FPGA-Litecoin-Miner Branch: master Commit: 5cbab90ba17a Files: 256 Total size: 2.3 MB Directory structure: gitextract_t5t89av7/ ├── .gitattributes ├── .gitignore ├── BeMicro/ │ ├── README.txt │ ├── ltcminer.qpf │ ├── ltcminer.qsf │ └── ltcminer.sdc ├── DE0-Nano/ │ ├── ltcminer.qpf │ ├── ltcminer.qsf │ └── ltcminer.sdc ├── DE2-115-Single/ │ ├── README.txt │ ├── ltcminer.qpf │ ├── ltcminer.qsf │ └── ltcminer.sdc ├── ICARUS-LX150/ │ ├── MiningSoftware/ │ │ ├── README.txt │ │ ├── ltcminer-testmode.py │ │ ├── ltcminer.py │ │ ├── pyserial-2.6/ │ │ │ ├── CHANGES.txt │ │ │ ├── LICENSE.txt │ │ │ ├── MANIFEST.in │ │ │ ├── PKG-INFO │ │ │ ├── README.txt │ │ │ ├── documentation/ │ │ │ │ ├── Makefile │ │ │ │ ├── appendix.rst │ │ │ │ ├── conf.py │ │ │ │ ├── examples.rst │ │ │ │ ├── index.rst │ │ │ │ ├── pyparallel.rst │ │ │ │ ├── pyserial.rst │ │ │ │ ├── pyserial_api.rst │ │ │ │ └── shortintro.rst │ │ │ ├── examples/ │ │ │ │ ├── enhancedserial.py │ │ │ │ ├── port_publisher.py │ │ │ │ ├── port_publisher.sh │ │ │ │ ├── rfc2217_server.py │ │ │ │ ├── scan.py │ │ │ │ ├── scanlinux.py │ │ │ │ ├── scanwin32.py │ │ │ │ ├── setup-miniterm-py2exe.py │ │ │ │ ├── setup-rfc2217_server-py2exe.py │ │ │ │ ├── setup-wxTerminal-py2exe.py │ │ │ │ ├── tcp_serial_redirect.py │ │ │ │ ├── wxSerialConfigDialog.py │ │ │ │ ├── wxSerialConfigDialog.wxg │ │ │ │ ├── wxTerminal.py │ │ │ │ └── wxTerminal.wxg │ │ │ ├── serial/ │ │ │ │ ├── __init__.py │ │ │ │ ├── rfc2217.py │ │ │ │ ├── serialcli.py │ │ │ │ ├── serialjava.py │ │ │ │ ├── serialposix.py │ │ │ │ ├── serialutil.py │ │ │ │ ├── serialwin32.py │ │ │ │ ├── sermsdos.py │ │ │ │ ├── tools/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── list_ports.py │ │ │ │ │ ├── list_ports_posix.py │ │ │ │ │ ├── list_ports_windows.py │ │ │ │ │ └── miniterm.py │ │ │ │ ├── urlhandler/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── protocol_hwgrep.py │ │ │ │ │ ├── protocol_loop.py │ │ │ │ │ ├── protocol_rfc2217.py │ │ │ │ │ └── protocol_socket.py │ │ │ │ └── win32.py │ │ │ ├── setup.py │ │ │ └── test/ │ │ │ ├── run_all_tests.py │ │ │ ├── test.py │ │ │ ├── test_advanced.py │ │ │ ├── test_high_load.py │ │ │ ├── test_iolib.py │ │ │ ├── test_readline.py │ │ │ └── test_url.py │ │ └── python-jsonrpc/ │ │ ├── jsonrpc/ │ │ │ ├── __init__.py │ │ │ ├── _tests/ │ │ │ │ ├── __init__.py │ │ │ │ ├── test_cgiwrapper.py │ │ │ │ ├── test_json.py │ │ │ │ ├── test_modpywrapper.py │ │ │ │ ├── test_proxy.py │ │ │ │ └── test_serviceHandler.py │ │ │ ├── cgiwrapper.py │ │ │ ├── json.py │ │ │ ├── modpywrapper.py │ │ │ ├── proxy.py │ │ │ └── serviceHandler.py │ │ ├── run-tests.py │ │ └── setup.py │ ├── README.txt │ ├── dyn_pll_ctrl.v │ ├── hub_core.v │ ├── ltcminer_icarus.ucf │ ├── ltcminer_icarus.v │ ├── pbkdfengine.v │ ├── pwm_fade.v │ ├── salsa_slowsixteen.v │ ├── salsaengine.v │ ├── serial.v │ ├── serial_hub.v │ ├── test_icarus.v │ ├── uart_receiver.v │ ├── uart_transmitter.v │ ├── xilinx_dyn_pll.v │ ├── xilinx_pll.v │ └── xilinx_ram.v ├── LICENSE.txt ├── README.txt ├── bitstreams.txt ├── experimental/ │ ├── CM1/ │ │ ├── README.txt │ │ ├── dcm_controller.v │ │ ├── flasher.v │ │ ├── hashvoodoo.ucf │ │ ├── hashvoodoo.v │ │ ├── hashvoodoo_test.v │ │ ├── hub_core.v │ │ ├── main_dcm.v │ │ ├── pbkdfengine.v │ │ ├── pwm_fade.v │ │ ├── salsa_slowsixteen.v │ │ ├── salsaengine.v │ │ ├── serial_core.v │ │ ├── sha-256-functions.v │ │ ├── sha256_transform.v │ │ ├── uart.v │ │ ├── uart_baudgenerator.v │ │ ├── uart_rx.v │ │ ├── uart_tx.v │ │ └── xilinx_ram.v │ ├── DE2-115-SLOWSIXTEEN/ │ │ ├── README.txt │ │ ├── altera_pll.v │ │ ├── altera_virtual_wire.v │ │ ├── ltcminer.qpf │ │ ├── ltcminer.qsf │ │ ├── ltcminer.sdc │ │ ├── ltcminer.v │ │ ├── pbkdfengine.v │ │ ├── salsa_slowsixteen.v │ │ ├── salsaengine.v │ │ ├── sha-256-functions.v │ │ ├── sha256_transform.v │ │ ├── sim_ram.v │ │ └── test_ltcminer.v │ ├── LX150-EIGHT-A/ │ │ ├── README.txt │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ ├── salsa_piped.v │ │ ├── salsaengine.v │ │ ├── sgen.c │ │ ├── sgen.inc │ │ ├── test_icarus.v │ │ └── xilinx_dpram.v │ ├── LX150-EIGHT-B/ │ │ ├── README.txt │ │ ├── dyn_pll_ctrl.v │ │ ├── ltcminer-dynclock.py │ │ ├── ltcminer-test-dynclock.py │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ ├── salsa_piped.v │ │ ├── salsaengine.v │ │ ├── sgen.c │ │ ├── sgen.inc │ │ ├── test_icarus.v │ │ ├── xilinx_dpram.v │ │ └── xilinx_dyn_pll.v │ ├── LX150-EIGHT-C/ │ │ ├── README.txt │ │ ├── dyn_pll_ctrl.v │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ ├── salsa_piped.v │ │ ├── salsaengine.v │ │ ├── sgen.c │ │ ├── sgen.inc │ │ ├── test_icarus.v │ │ ├── xilinx_dpram.v │ │ └── xilinx_dyn_pll.v │ ├── LX150-SIXTYFOUR-A/ │ │ ├── dyn_pll_ctrl.v │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ ├── salsa_piped.v │ │ ├── salsaengine.v │ │ ├── sgen.c │ │ ├── sgen.inc │ │ ├── test_icarus.v │ │ ├── xilinx_dpram.v │ │ └── xilinx_dyn_pll.v │ ├── LX150-SLOWEIGHT-A/ │ │ ├── dyn_pll_ctrl.v │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ ├── salsa_sloweight.v │ │ ├── salsaengine.v │ │ ├── test_icarus.v │ │ ├── xilinx_dpram.v │ │ └── xilinx_dyn_pll.v │ ├── LX150-SLOWSIXTEEN-A/ │ │ ├── dyn_pll_ctrl.v │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ ├── salsa_slowsixteen.v │ │ ├── salsaengine.v │ │ ├── test_icarus.v │ │ ├── xilinx_dpram.v │ │ └── xilinx_dyn_pll.v │ ├── LX150-SPLIT/ │ │ ├── README.txt │ │ ├── ltcminer_icarus.ucf │ │ ├── ltcminer_icarus.v │ │ ├── pbkdfengine.v │ │ └── salsaengine.v │ ├── README.txt │ ├── ZTEX/ │ │ ├── README.txt │ │ ├── ztex_ufm1_15.ucf │ │ └── ztex_ufm1_15b1_litecoin.v │ ├── Ztex-1-15y/ │ │ ├── README.txt │ │ ├── cgminer-3.1.1/ │ │ │ ├── README.txt │ │ │ ├── cgminer.c │ │ │ ├── driver-icarus.c │ │ │ ├── driver-ztex.c │ │ │ ├── libztex.c │ │ │ ├── libztex.h │ │ │ └── miner.h │ │ ├── pbkdfengine.v │ │ ├── salsa_slowsixteen.v │ │ ├── salsaengine.v │ │ ├── sha-256-functions.v │ │ ├── sha256_transform.v │ │ ├── test_miner.v │ │ ├── xilinx_ram.v │ │ ├── ztex_ufm1_15y.ucf │ │ └── ztex_ufm1_15y1.v │ ├── hashvariant-A.v │ ├── hashvariant-B.v │ ├── hashvariant-C.v │ └── salsa-B.v ├── scripts/ │ ├── config.example.tcl │ ├── json_rpc.tcl │ ├── jtag_comm.tcl │ ├── mine.bat │ ├── mine.sh │ ├── mine.tcl │ ├── program-fpga-board.bat │ ├── program-fpga-board.tcl │ ├── test_data.txt │ ├── test_data_cut.txt │ ├── test_data_full.txt │ └── utils.tcl └── source/ ├── altera_pll.v ├── altera_ram.v ├── altera_virtual_wire.v ├── hashcore.v ├── ltcminer.v ├── salsa.v ├── sha-256-functions.v ├── sha256_transform.v └── test_ltcminer.v ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ # Auto detect text files and perform LF normalization * text=auto # Custom for Visual Studio *.cs diff=csharp *.sln merge=union *.csproj merge=union *.vbproj merge=union *.fsproj merge=union *.dbproj merge=union # Standard to msysgit *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain ================================================ FILE: .gitignore ================================================ ################# ## Eclipse ################# *.pydevproject .project .metadata bin/ tmp/ *.tmp *.bak *.swp *~.nib local.properties .classpath .settings/ .loadpath # External tool builders .externalToolBuilders/ # Locally stored "Eclipse launch configurations" *.launch # CDT-specific .cproject # PDT-specific .buildpath ################# ## Visual Studio ################# ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user *.sln.docstates # Build results [Dd]ebug/ [Rr]elease/ x64/ build/ [Bb]in/ [Oo]bj/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* *_i.c *_p.c *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.log *.scc # Visual C++ cache files ipch/ *.aps *.ncb *.opensdf *.sdf *.cachefile # Visual Studio profiler *.psess *.vsp *.vspx # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # NCrunch *.ncrunch* .*crunch*.local.xml # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.Publish.xml *.pubxml # NuGet Packages Directory ## TODO: If you have NuGet Package Restore enabled, uncomment the next line #packages/ # Windows Azure Build Output csx *.build.csdef # Windows Store app package directory AppPackages/ # Others sql/ *.Cache ClientBin/ [Ss]tyle[Cc]op.* ~$* *~ *.dbmdl *.[Pp]ublish.xml *.pfx *.publishsettings # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file to a newer # Visual Studio version. Backup files are not needed, because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files App_Data/*.mdf App_Data/*.ldf ############# ## Windows detritus ############# # Windows image file caches Thumbs.db ehthumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Mac crap .DS_Store ############# ## Python ############# *.py[co] # Packages *.egg *.egg-info dist/ build/ eggs/ parts/ var/ sdist/ develop-eggs/ .installed.cfg # Installer logs pip-log.txt # Unit test / coverage reports .coverage .tox #Translations *.mo #Mr Developer .mr.developer.cfg ================================================ FILE: BeMicro/README.txt ================================================ BeMicro port by litecoin forum member "Minor" https://forum.litecoin.net/index.php?action=profile;u=15431 +-------------------------------------------------------------------------------+ ; Flow Summary ; +------------------------------------+------------------------------------------+ ; Flow Status ; Successful - Wed Sep 18 13:46:51 2013 ; ; Quartus II Version ; 10.1 Build 153 11/29/2010 SJ Web Edition ; ; Revision Name ; ltcminer ; ; Top-level Entity Name ; ltcminer ; ; Family ; Cyclone IV E ; ; Device ; EP4CE22F17C7 ; ; Timing Models ; Final ; ; Total logic elements ; 18,713 / 22,320 ( 84 % ) ; ; Total combinational functions ; 16,012 / 22,320 ( 72 % ) ; ; Dedicated logic registers ; 10,483 / 22,320 ( 47 % ) ; ; Total registers ; 10483 ; ; Total pins ; 9 / 154 ( 6 % ) ; ; Total virtual pins ; 0 ; ; Total memory bits ; 524,288 / 608,256 ( 86 % ) ; ; Embedded Multiplier 9-bit elements ; 0 / 132 ( 0 % ) ; ; Total PLLs ; 1 / 4 ( 25 % ) ; +------------------------------------+------------------------------------------+ ================================================ FILE: BeMicro/ltcminer.qpf ================================================ # -------------------------------------------------------------------------- # # # Copyright (C) 1991-2010 Altera Corporation # Your use of Altera Corporation's design tools, logic functions # and other software and tools, and its AMPP partner logic # functions, and any output files from any of the foregoing # (including device programming or simulation files), and any # associated documentation or information are expressly subject # to the terms and conditions of the Altera Program License # Subscription Agreement, Altera MegaCore Function License # Agreement, or other applicable license agreement, including, # without limitation, that your use is for the sole purpose of # programming logic devices manufactured by Altera and sold by # Altera or its authorized distributors. Please refer to the # applicable agreement for further details. # # -------------------------------------------------------------------------- # # # Quartus II # Version 10.0 Build 262 08/18/2010 Service Pack 1 SJ Web Edition # Date created = 19:43:05 May 18, 2011 # # -------------------------------------------------------------------------- # QUARTUS_VERSION = "10.0" DATE = "19:43:05 May 18, 2011" # Revisions PROJECT_REVISION = "ltcminer" ================================================ FILE: BeMicro/ltcminer.qsf ================================================ # -------------------------------------------------------------------------- # # # Copyright (C) 1991-2010 Altera Corporation # Your use of Altera Corporation's design tools, logic functions # and other software and tools, and its AMPP partner logic # functions, and any output files from any of the foregoing # (including device programming or simulation files), and any # associated documentation or information are expressly subject # to the terms and conditions of the Altera Program License # Subscription Agreement, Altera MegaCore Function License # Agreement, or other applicable license agreement, including, # without limitation, that your use is for the sole purpose of # programming logic devices manufactured by Altera and sold by # Altera or its authorized distributors. Please refer to the # applicable agreement for further details. # # -------------------------------------------------------------------------- # # # Quartus II # Version 10.0 Build 262 08/18/2010 Service Pack 1 SJ Web Edition # Date created = 05:05:52 March 02, 2011 # # -------------------------------------------------------------------------- # # # Notes: # # 1) The default values for assignments are stored in the file: # If this file doesn't exist, see file: # assignment_defaults.qdf # # 2) Altera recommends that you do not modify this file. This # file is updated automatically by the Quartus II software # and any changes you make may be lost or overwritten. # # -------------------------------------------------------------------------- # set_global_assignment -name FAMILY "Cyclone IV E" set_global_assignment -name DEVICE EP4CE22F17C7 set_global_assignment -name TOP_LEVEL_ENTITY ltcminer set_global_assignment -name LAST_QUARTUS_VERSION 10.1 set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1 set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "2.5 V" set_global_assignment -name PROJECT_OUTPUT_DIRECTORY quartus_output set_global_assignment -name EDA_SIMULATION_TOOL "" set_global_assignment -name EDA_MAP_ILLEGAL_CHARACTERS OFF -section_id eda_simulation set_global_assignment -name EDA_TIME_SCALE "1 ps" -section_id eda_simulation set_global_assignment -name EDA_OUTPUT_DATA_FORMAT NONE -section_id eda_simulation set_global_assignment -name EDA_ENABLE_GLITCH_FILTERING OFF -section_id eda_simulation set_global_assignment -name EDA_WRITE_NODES_FOR_POWER_ESTIMATION OFF -section_id eda_simulation set_global_assignment -name EDA_TEST_BENCH_DESIGN_INSTANCE_NAME moogerfoogin -section_id eda_simulation set_global_assignment -name POWER_USE_PVA OFF set_global_assignment -name POWER_DEFAULT_TOGGLE_RATE 65% set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "NO HEAT SINK WITH STILL AIR" set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" set_global_assignment -name SYNTH_TIMING_DRIVEN_SYNTHESIS ON set_global_assignment -name ALLOW_ANY_RAM_SIZE_FOR_RECOGNITION ON set_global_assignment -name ALLOW_ANY_ROM_SIZE_FOR_RECOGNITION ON set_global_assignment -name ALLOW_ANY_SHIFT_REGISTER_SIZE_FOR_RECOGNITION ON set_global_assignment -name ADD_PASS_THROUGH_LOGIC_TO_INFERRED_RAMS ON set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON set_global_assignment -name REMOVE_DUPLICATE_REGISTERS ON set_location_assignment PIN_E1 -to osc_clk set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to osc_clk set_location_assignment PIN_N15 -to LEDS_out[0] set_location_assignment PIN_K5 -to LEDS_out[1] set_location_assignment PIN_P9 -to LEDS_out[2] set_location_assignment PIN_P15 -to LEDS_out[3] set_location_assignment PIN_R10 -to LEDS_out[4] set_location_assignment PIN_L13 -to LEDS_out[5] set_location_assignment PIN_D1 -to LEDS_out[6] set_location_assignment PIN_B1 -to LEDS_out[7] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[7] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[6] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[5] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[4] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[3] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[2] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[1] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[0] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[7] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[6] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[5] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[3] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[4] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[2] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[1] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[0] set_global_assignment -name VERILOG_MACRO "HALFRAM=1" #set_global_assignment -name QIP_FILE halfram.qip set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top set_global_assignment -name SMART_RECOMPILE ON set_global_assignment -name CYCLONEII_OPTIMIZATION_TECHNIQUE SPEED set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC ON set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION ON set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING ON set_global_assignment -name ROUTER_LCELL_INSERTION_AND_LOGIC_DUPLICATION ON set_global_assignment -name ROUTER_TIMING_OPTIMIZATION_LEVEL MAXIMUM set_global_assignment -name AUTO_PACKED_REGISTERS_STRATIXII NORMAL set_global_assignment -name FITTER_EFFORT "STANDARD FIT" set_global_assignment -name ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP ON set_global_assignment -name ROUTER_CLOCKING_TOPOLOGY_ANALYSIS ON set_global_assignment -name VERILOG_FILE ../source/ltcminer.v set_global_assignment -name VERILOG_FILE ../source/hashcore.v set_global_assignment -name VERILOG_FILE ../source/altera_ram.v set_global_assignment -name VERILOG_FILE ../source/salsa.v set_global_assignment -name VERILOG_FILE ../source/sha256_transform.v set_global_assignment -name VERILOG_FILE "../source/sha-256-functions.v" set_global_assignment -name VERILOG_FILE ../source/altera_pll.v set_global_assignment -name VERILOG_FILE ../source/altera_virtual_wire.v set_global_assignment -name SDC_FILE ltcminer.sdc set_global_assignment -name VERILOG_MACRO "SPEED_MHZ=25" set_global_assignment -name VERILOG_MACRO "INVERTLEDS=1" set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top ================================================ FILE: BeMicro/ltcminer.sdc ================================================ ## # # Copyright (c) 2011 fpgaminer@bitcoin-mining.com # # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ## create_clock -period 20.000 -name osc_clk osc_clk derive_pll_clocks derive_clock_uncertainty ================================================ FILE: DE0-Nano/ltcminer.qpf ================================================ # -------------------------------------------------------------------------- # # # Copyright (C) 1991-2010 Altera Corporation # Your use of Altera Corporation's design tools, logic functions # and other software and tools, and its AMPP partner logic # functions, and any output files from any of the foregoing # (including device programming or simulation files), and any # associated documentation or information are expressly subject # to the terms and conditions of the Altera Program License # Subscription Agreement, Altera MegaCore Function License # Agreement, or other applicable license agreement, including, # without limitation, that your use is for the sole purpose of # programming logic devices manufactured by Altera and sold by # Altera or its authorized distributors. Please refer to the # applicable agreement for further details. # # -------------------------------------------------------------------------- # # # Quartus II # Version 10.0 Build 262 08/18/2010 Service Pack 1 SJ Web Edition # Date created = 19:43:05 May 18, 2011 # # -------------------------------------------------------------------------- # QUARTUS_VERSION = "10.0" DATE = "19:43:05 May 18, 2011" # Revisions PROJECT_REVISION = "ltcminer" ================================================ FILE: DE0-Nano/ltcminer.qsf ================================================ # -------------------------------------------------------------------------- # # # Copyright (C) 1991-2010 Altera Corporation # Your use of Altera Corporation's design tools, logic functions # and other software and tools, and its AMPP partner logic # functions, and any output files from any of the foregoing # (including device programming or simulation files), and any # associated documentation or information are expressly subject # to the terms and conditions of the Altera Program License # Subscription Agreement, Altera MegaCore Function License # Agreement, or other applicable license agreement, including, # without limitation, that your use is for the sole purpose of # programming logic devices manufactured by Altera and sold by # Altera or its authorized distributors. Please refer to the # applicable agreement for further details. # # -------------------------------------------------------------------------- # # # Quartus II # Version 10.0 Build 262 08/18/2010 Service Pack 1 SJ Web Edition # Date created = 05:05:52 March 02, 2011 # # -------------------------------------------------------------------------- # # # Notes: # # 1) The default values for assignments are stored in the file: # If this file doesn't exist, see file: # assignment_defaults.qdf # # 2) Altera recommends that you do not modify this file. This # file is updated automatically by the Quartus II software # and any changes you make may be lost or overwritten. # # -------------------------------------------------------------------------- # set_global_assignment -name FAMILY "Cyclone IV E" set_global_assignment -name DEVICE EP4CE22F17C6 set_global_assignment -name TOP_LEVEL_ENTITY ltcminer set_global_assignment -name ORIGINAL_QUARTUS_VERSION "10.0 SP1" set_global_assignment -name PROJECT_CREATION_TIME_DATE "17:52:09 MAY 05, 2011" set_global_assignment -name LAST_QUARTUS_VERSION 10.1 set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1 set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "2.5 V" set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top set_global_assignment -name LL_ROOT_REGION ON -section_id "Root Region" set_global_assignment -name LL_MEMBER_STATE LOCKED -section_id "Root Region" set_global_assignment -name PROJECT_OUTPUT_DIRECTORY quartus_output set_global_assignment -name EDA_SIMULATION_TOOL "" set_global_assignment -name EDA_MAP_ILLEGAL_CHARACTERS OFF -section_id eda_simulation set_global_assignment -name EDA_TIME_SCALE "1 ps" -section_id eda_simulation set_global_assignment -name EDA_OUTPUT_DATA_FORMAT NONE -section_id eda_simulation set_global_assignment -name EDA_ENABLE_GLITCH_FILTERING OFF -section_id eda_simulation set_global_assignment -name EDA_WRITE_NODES_FOR_POWER_ESTIMATION OFF -section_id eda_simulation set_global_assignment -name EDA_TEST_BENCH_DESIGN_INSTANCE_NAME moogerfoogin -section_id eda_simulation set_global_assignment -name POWER_USE_PVA OFF set_global_assignment -name POWER_DEFAULT_TOGGLE_RATE 65% set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "NO HEAT SINK WITH STILL AIR" set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" set_global_assignment -name SYNTH_TIMING_DRIVEN_SYNTHESIS ON set_global_assignment -name ALLOW_ANY_RAM_SIZE_FOR_RECOGNITION ON set_global_assignment -name ALLOW_ANY_ROM_SIZE_FOR_RECOGNITION ON set_global_assignment -name ALLOW_ANY_SHIFT_REGISTER_SIZE_FOR_RECOGNITION ON set_global_assignment -name ADD_PASS_THROUGH_LOGIC_TO_INFERRED_RAMS ON set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON set_global_assignment -name REMOVE_DUPLICATE_REGISTERS ON set_location_assignment PIN_R8 -to osc_clk set_location_assignment PIN_A15 -to LEDS_out[0] set_location_assignment PIN_A11 -to LEDS_out[3] set_location_assignment PIN_A13 -to LEDS_out[1] set_location_assignment PIN_B13 -to LEDS_out[2] set_location_assignment PIN_D1 -to LEDS_out[4] set_location_assignment PIN_F3 -to LEDS_out[5] set_location_assignment PIN_B1 -to LEDS_out[6] set_location_assignment PIN_L3 -to LEDS_out[7] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[7] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[6] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[5] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[4] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[3] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[2] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[1] set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to LEDS_out[0] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[7] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[6] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[5] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[3] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[4] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[2] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[0] set_instance_assignment -name SLEW_RATE 0 -to LEDS_out[1] set_global_assignment -name VERILOG_FILE "../source/ltcminer.v" set_global_assignment -name VERILOG_FILE "../source/hashcore.v" set_global_assignment -name VERILOG_FILE "../source/altera_ram.v" set_global_assignment -name VERILOG_FILE "../source/salsa.v" set_global_assignment -name VERILOG_FILE "../source/sha256_transform.v" set_global_assignment -name VERILOG_FILE "../source/sha-256-functions.v" set_global_assignment -name VERILOG_FILE "../source/altera_pll.v" set_global_assignment -name VERILOG_FILE "../source/altera_virtual_wire.v" set_global_assignment -name VERILOG_MACRO "HALFRAM=1" #set_global_assignment -name QIP_FILE halfram.qip set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top ================================================ FILE: DE0-Nano/ltcminer.sdc ================================================ ## # # Copyright (c) 2011 fpgaminer@bitcoin-mining.com # # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ## create_clock -period 20.000 -name osc_clk osc_clk derive_pll_clocks derive_clock_uncertainty ================================================ FILE: DE2-115-Single/README.txt ================================================ Single core version for DE2-115 using full sized scratchpad (UNTESTED) For multipe cores simply replicate hashcore with different nonce_msb values and implement a golden_nonce queue for results (a simple multiplexer latching on golden_nonce_match will suffice). An dual core example is provided as a comment in ltcminer.v Its a little inefficient as the sha256 engine is replicated, but this will be rather complicated to fix. It probably best to use half-sized scratchpads for the multicore version as this doubles the number of cores that can be fitted for a 60% improvement in throughput (the half cores being 80% as fast as a full scratchpad) set_global_assignment -name VERILOG_MACRO "HALFRAM=1" This note from the previous version of the README is obsolete as multicore is now enabled by default ... For multicore, set the following in ltcminer.qsf ... set_global_assignment -name VERILOG_MACRO "MULTICORE=1" (Or use the assignments/settings menu in quartus to set it) Use the NOMULTICORE macro to revert to previous behaviour. ================================================ FILE: DE2-115-Single/ltcminer.qpf ================================================ # -------------------------------------------------------------------------- # # # Copyright (C) 1991-2010 Altera Corporation # Your use of Altera Corporation's design tools, logic functions # and other software and tools, and its AMPP partner logic # functions, and any output files from any of the foregoing # (including device programming or simulation files), and any # associated documentation or information are expressly subject # to the terms and conditions of the Altera Program License # Subscription Agreement, Altera MegaCore Function License # Agreement, or other applicable license agreement, including, # without limitation, that your use is for the sole purpose of # programming logic devices manufactured by Altera and sold by # Altera or its authorized distributors. Please refer to the # applicable agreement for further details. # # -------------------------------------------------------------------------- # # # Quartus II # Version 10.1 Build 153 11/29/2010 SJ Web Edition # Date created = 19:35:13 July 19, 2013 # # -------------------------------------------------------------------------- # QUARTUS_VERSION = "10.1" DATE = "19:35:13 July 19, 2013" # Revisions PROJECT_REVISION = "ltcminer" PROJECT_REVISION = "ltcaminer" ================================================ FILE: DE2-115-Single/ltcminer.qsf ================================================ # -------------------------------------------------------------------------- # # # Copyright (C) 1991-2010 Altera Corporation # Your use of Altera Corporation's design tools, logic functions # and other software and tools, and its AMPP partner logic # functions, and any output files from any of the foregoing # (including device programming or simulation files), and any # associated documentation or information are expressly subject # to the terms and conditions of the Altera Program License # Subscription Agreement, Altera MegaCore Function License # Agreement, or other applicable license agreement, including, # without limitation, that your use is for the sole purpose of # programming logic devices manufactured by Altera and sold by # Altera or its authorized distributors. Please refer to the # applicable agreement for further details. # # -------------------------------------------------------------------------- # # # Quartus II # Version 10.0 Build 262 08/18/2010 Service Pack 1 SJ Web Edition # Date created = 05:05:52 March 02, 2011 # # -------------------------------------------------------------------------- # # # Notes: # # 1) The default values for assignments are stored in the file: # If this file doesn't exist, see file: # assignment_defaults.qdf # # 2) Altera recommends that you do not modify this file. This # file is updated automatically by the Quartus II software # and any changes you make may be lost or overwritten. # # -------------------------------------------------------------------------- # set_global_assignment -name FAMILY "Cyclone IV E" set_global_assignment -name DEVICE EP4CE115F29C7 set_global_assignment -name TOP_LEVEL_ENTITY ltcminer set_global_assignment -name ORIGINAL_QUARTUS_VERSION "10.0 SP1" set_global_assignment -name PROJECT_CREATION_TIME_DATE "17:52:09 MAY 05, 2011" set_global_assignment -name LAST_QUARTUS_VERSION 10.1 set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 7 set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1 set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "2.5 V" set_location_assignment PIN_Y2 -to osc_clk set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to osc_clk set_global_assignment -name ENABLE_SIGNALTAP OFF set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW" set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" set_global_assignment -name ALLOW_ANY_RAM_SIZE_FOR_RECOGNITION ON set_global_assignment -name ALLOW_ANY_SHIFT_REGISTER_SIZE_FOR_RECOGNITION ON set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top set_global_assignment -name LL_ROOT_REGION ON -section_id "Root Region" set_global_assignment -name LL_MEMBER_STATE LOCKED -section_id "Root Region" set_global_assignment -name PROJECT_OUTPUT_DIRECTORY quartus_output set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON set_global_assignment -name ALLOW_ANY_ROM_SIZE_FOR_RECOGNITION ON set_global_assignment -name EDA_SIMULATION_TOOL "" set_global_assignment -name EDA_MAP_ILLEGAL_CHARACTERS OFF -section_id eda_simulation set_global_assignment -name EDA_TIME_SCALE "1 ps" -section_id eda_simulation set_global_assignment -name EDA_OUTPUT_DATA_FORMAT NONE -section_id eda_simulation set_global_assignment -name EDA_ENABLE_GLITCH_FILTERING OFF -section_id eda_simulation set_global_assignment -name EDA_WRITE_NODES_FOR_POWER_ESTIMATION OFF -section_id eda_simulation set_global_assignment -name EDA_TEST_BENCH_DESIGN_INSTANCE_NAME moogerfoogin -section_id eda_simulation set_global_assignment -name POWER_USE_PVA OFF set_global_assignment -name POWER_DEFAULT_TOGGLE_RATE 65% set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF set_global_assignment -name VERILOG_FILE "../source/ltcminer.v" set_global_assignment -name VERILOG_FILE "../source/hashcore.v" set_global_assignment -name VERILOG_FILE "../source/altera_ram.v" set_global_assignment -name VERILOG_FILE "../source/salsa.v" set_global_assignment -name VERILOG_FILE "../source/sha256_transform.v" set_global_assignment -name VERILOG_FILE "../source/sha-256-functions.v" set_global_assignment -name VERILOG_FILE "../source/altera_pll.v" set_global_assignment -name VERILOG_FILE "../source/altera_virtual_wire.v" set_global_assignment -name VERILOG_MACRO "NOLEDS=1" set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top ================================================ FILE: DE2-115-Single/ltcminer.sdc ================================================ ## # # Copyright (c) 2011 fpgaminer@bitcoin-mining.com # # # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ## create_clock -period 20.000 -name osc_clk osc_clk derive_pll_clocks derive_clock_uncertainty ================================================ FILE: ICARUS-LX150/MiningSoftware/README.txt ================================================ Mining software for ltcminer. You will need to install python 2.7, then ... From the fpgaminer/project/Verilog_Xilinx_Port/README.txt I quote ... It requires a few non-standard libraries, pyserial and json-rpc. http://pyserial.sourceforge.net/ (also generally available in Linux distributions) http://json-rpc.org/wiki/python-json-rpc Since these are open source, I have included them in the MiningSoftware folder, vis pyserial-2.6 from http://pyserial.sourceforge.net python-json-rpc from http://json-rpc.org/browser/trunk/python-jsonrpc/jsonrpc To install them run "python setup.py install" in each folder (sudo if on linux) Edit ltcminer.py and set the serial port to match your system (eg COM2) plus your pool url, worker name and worker password. You can also change the baudrate but this must match the value hard-coded into ltcminer_icarus.v There is a test getwork that you can enable, just uncomment the two lines for test_payload. This still requires a working pool, which will REJECT the share, but its a useful quick test that everything is working. This is now obsolete as I have provided ltcminer-testmode.py which runs 10 test hashes (a full 910 test hash set is also available in ../../scripts/test_data_cut.txt). The scripts take a single (optional) parameter, the clock speed (in MHz) for use with the dynamic clock PLL. The value is checked for validity in the FPGA, so not all values will work (see SPEED_LIMIT and SPEED_MIN parameters in ltcminer_icarus.v). Use the FLASHCLOCK feature (blinks the TxD led in time to the clock) to verify the clock speed has been accepted. Be careful of spaces/tabs in python as these are part of the syntax! If you run into problems making changes, just copy a previous line EXACTLY, then modify the part after the initial spaces/tabs. ADDENDUM. I have now tabbified the script with tabstop=4 (using Notepad++) which should make it much easier to edit. When using a stratum proxy server, follow the instructions at ... https://www.litecoinpool.org/help Specifically you must use the version from ... https://github.com/CryptoManiac/stratum-mining-proxy Start it as follows (on linux) ... ./mining_proxy.py -nm -pa scrypt -o litecoinpool.org -p 3333 Or in background with ... nohup ./mining_proxy.py -nm -pa scrypt -o litecoinpool.org -p 3333 >/tmp/stratum_ltc.log 2>&1& ================================================ FILE: ICARUS-LX150/MiningSoftware/ltcminer-testmode.py ================================================ #!/usr/bin/env python # by teknohog # Python wrapper for Xilinx Serial Miner # Host/user configuration is NOT USED in ltcminer-testmode.py # CONFIGURATION - CHANGE THIS (eg try COM1, COM2, COM3, COM4 etc) serial_port = "COM4" # serial_port = "/dev/ttyUSB0" # raspberry pi # CONFIGURATION - how often to refresh work - reduced for testing askrate = 2 ############################################################################### from jsonrpc import ServiceProxy from time import ctime, sleep, time from serial import Serial from threading import Thread, Event from Queue import Queue import sys dynclock = 0 dynclock_hex = "0000" def stats(count, starttime): khshare = 65.536 * writer.diff s = sum(count) tdelta = time() - starttime rate = s * khshare / tdelta # This is only a rough estimate of the true hash rate, # particularly when the number of events is low. However, since # the events follow a Poisson distribution, we can estimate the # standard deviation (sqrt(n) for n events). Thus we get some idea # on how rough an estimate this is. # s should always be positive when this function is called, but # checking for robustness anyway if s > 0: stddev = rate / s**0.5 else: stddev = 0 return "[%i accepted, %i failed, %.2f +/- %.2f khash/s]" % (count[0], count[1], rate, stddev) class Reader(Thread): def __init__(self): Thread.__init__(self) self.daemon = True # flush the input buffer ser.read(1000) def run(self): while True: nonce = ser.read(4) if len(nonce) == 4: # Keep this order, because writer.block will be # updated due to the golden event. submitter = Submitter(writer.block, nonce) submitter.start() golden.set() class Writer(Thread): def __init__(self,dynclock_hex): Thread.__init__(self) # Keep something sensible available while waiting for the # first getwork self.block = "0" * 256 self.target = "f" * 56 + "ff070000" # diff=32 for testmode self.diff = 32 # testmode self.dynclock_hex = dynclock_hex self.daemon = True self.go = True # Alternatively use test_data_cut.txt for full 910 hash test suite self.infile = open("../../scripts/test_data.txt","r") self.nonce = 0 self.nonce_tested = 0 self.nonce_ok = 0 self.nonce_fail = 0 def run(self): while self.go: try: # work = bitcoin.getwork() # self.block = work['data'] # self.target = work['target'] print "Tested", self.nonce_tested, " passed", self.nonce_ok, " fail", self.nonce_fail, " unmatched", self.nonce_tested - self.nonce_ok - self.nonce_fail self.line = self.infile.readline() if (len(self.line) != 257): print "EOF on test data" # Or its an error, but let's not be worrysome # quit() # Except it doesn't ... self.go = False # Terminating threads is a bit tricksy break self.nonce_tested = self.nonce_tested + 1 self.block = self.line.rstrip() # Hard-code a diff=32 target for test work # Replace MSB 16 bits of target with clock (NB its reversed) self.target = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff07" + self.dynclock_hex self.dynclock_hex = "0000" # Once only # print("block old " + self.block) # We need to subtract a few from the nonces in order to match (why?) nonce_bin = self.block.decode('hex')[79:75:-1] self.nonce = int(nonce_bin.encode('hex'), 16) # print "nonce old =", self.nonce nonce_new = self.nonce - 50 if (nonce_new < 0): nonce_new = 0 # print "nonce new =", nonce_new nonce_hex = "{0:08x}".format(nonce_new) # print "encoded = ", nonce_hex nonce_hex_rev = nonce_hex[6:8]+nonce_hex[4:6]+nonce_hex[2:4]+nonce_hex[0:2] # print "reversed = ", nonce_hex_rev self.block = self.block[0:152]+nonce_hex_rev+self.block[160:] # print("block new " + self.block) except: print("RPC getwork error") # In this case, keep crunching with the old data. It will get # stale at some point, but it's better than doing nothing. # print("block " + self.block + " target " + self.target) # DEBUG sdiff = self.target.decode('hex')[31:27:-1] intTarget = int(sdiff.encode('hex'), 16) if (intTarget < 1): print "WARNING zero target", intTarget print "target", self.target print("sdiff", sdiff) # NB Need brackets here else prints binary self.target = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f0000" else: newdiff = 65536.0 / (intTarget+1) if (self.diff != newdiff): print "New target diff =", newdiff self.diff = newdiff # print("Sending data to FPGA") # DEBUG # for litecoin send 80 bytes of the 128 byte data plus 4 bytes of 32 byte target payload = self.target.decode('hex')[31:27:-1] + self.block.decode('hex')[79::-1] # TEST HASH, this should match on nonce 0000318f # NB The pool will REJECT this share as it did not send the data... # UNCOMMENT the following two lines for testing... # test_payload ="000000014eb4577c82473a069ca0e95703254da62e94d1902ab6f0eae8b1e718565775af20c9ba6ced48fc9915ef01c54da2200090801b2d2afc406264d491c7dfc7b0b251e91f141b44717e00310000ff070000" # payload = test_payload.decode('hex')[::-1] # This is probably best commented out unless debugging ... print("Test " + payload.encode('hex_codec')) # DEBUG ser.write(payload) result = golden.wait(askrate) if result: golden.clear() class Submitter(Thread): def __init__(self, block, nonce): Thread.__init__(self) self.block = block self.nonce = nonce def run(self): # This thread will be created upon every submit, as they may # come in sooner than the submits finish. # print("Block found on " + ctime()) print("Share found on " + ctime() + " nonce " + self.nonce.encode('hex_codec')) if (int(self.nonce.encode('hex_codec'),16) != writer.nonce): print "... ERROR expected nonce", hex(writer.nonce) writer.nonce_fail = writer.nonce_fail + 1 else: print "... CORRECT" writer.nonce_ok = writer.nonce_ok + 1 hrnonce = self.nonce[::-1].encode('hex') data = self.block[:152] + hrnonce + self.block[160:] try: # result = bitcoin.getwork(data) result = False # print("Upstream result: " + str(result)) # Pointless in test mode except: print("RPC send error") # a sensible boolean for stats result = False results_queue.put(result) class Display_stats(Thread): def __init__(self): Thread.__init__(self) self.count = [0, 0] self.starttime = time() self.daemon = True print("Miner started on " + ctime()) def run(self): while True: result = results_queue.get() if result: self.count[0] += 1 else: self.count[1] += 1 # print(stats(self.count, self.starttime)) # Pointless in test mode results_queue.task_done() # ======= main ======= # Process command line if (len(sys.argv) > 2): print "ERROR too many command line arguments" print "usage:", sys.argv[0], "clockfreq" quit() if (len(sys.argv) == 1): print "WARNING no clockfreq supplied, not setting freq" else: # TODO ought to check the value is a valid integer try: dynclock = int(sys.argv[1]) except: print "ERROR parsing clock frequency on command line, needs to be an integer" print "usage:", sys.argv[0], "clockfreq" quit() if (dynclock==0): print "ERROR parsing clock frequency on command line, cannot be zero" print "usage:", sys.argv[0], "clockfreq" quit() if (dynclock>254): # Its 254 since onescomplement(255) is zero, which is not allowed print "ERROR parsing clock frequency on command line, max 254" print "usage:", sys.argv[0], "clockfreq" quit() if (dynclock<25): print "ERROR use at least 25 for clock (the DCM can lock up for low values)" print "usage:", sys.argv[0], "clockfreq" quit() dynclock_hex = "{0:04x}".format((255-dynclock)*256+dynclock) # both value and ones-complement print "INFO will set clock to", dynclock, "MHz hex", dynclock_hex golden = Event() # url = 'http://' + user + ':' + password + '@' + host + ':' + http_port # bitcoin = ServiceProxy(url) results_queue = Queue() # default is 8 bit no parity which is fine ... # http://pyserial.sourceforge.net/shortintro.html#opening-serial-ports ser = Serial(serial_port, 115200, timeout=askrate) reader = Reader() writer = Writer(dynclock_hex) disp = Display_stats() reader.start() writer.start() disp.start() try: while writer.go: # Threads are generally hard to interrupt. So they are left # running as daemons, and we do something simple here that can # be easily terminated to bring down the entire script. sleep(1) except KeyboardInterrupt: print("Terminated") ================================================ FILE: ICARUS-LX150/MiningSoftware/ltcminer.py ================================================ #!/usr/bin/env python # by teknohog # Python wrapper for Xilinx Serial Miner # CONFIGURATION - CHANGE THIS TO YOUR ACCOUNT DETAILS ... # Optionally install a Stratum Proxy Server host = "mining-foreman.org" # Getwork pools # host = "http://litecoinpool.org" # host = "localhost" # Stratum Proxy on localhost # host = "tvpi.lan" # Stratum Proxy (raspberry pi) http_port = "10341" # Getwork port (mining-foreman) # http_port = "9332" # Getwork port (litcoinpool) # http_port = "8332" # Getwork port (stratum) user = "username.1" # Your worker goes here password = "password" # Worker password, NOT your account password # CONFIGURATION - CHANGE THIS (eg try COM1, COM2, COM3, COM4 etc) serial_port = "COM4" # serial_port = "/dev/ttyUSB0" # raspberry pi # CONFIGURATION - how often to refresh work. 20 seconds is fine, but work is # not initially fetched until this timeout expires. Reduce it for debugging # and for stratum (2 works fine). askrate = 20 # Getwork # askrate = 2 # Stratum ############################################################################### from jsonrpc import ServiceProxy from time import ctime, sleep, time from serial import Serial from threading import Thread, Event from Queue import Queue import sys dynclock = 0 dynclock_hex = "0000" def stats(count, starttime): khshare = 65.536 * writer.diff s = sum(count) tdelta = time() - starttime rate = s * khshare / tdelta # This is only a rough estimate of the true hash rate, # particularly when the number of events is low. However, since # the events follow a Poisson distribution, we can estimate the # standard deviation (sqrt(n) for n events). Thus we get some idea # on how rough an estimate this is. # s should always be positive when this function is called, but # checking for robustness anyway if s > 0: stddev = rate / s**0.5 else: stddev = 0 return "[%i accepted, %i failed, %.2f +/- %.2f khash/s]" % (count[0], count[1], rate, stddev) class Reader(Thread): def __init__(self): Thread.__init__(self) self.daemon = True # flush the input buffer ser.read(1000) def run(self): while True: nonce = ser.read(4) if len(nonce) == 4: # Keep this order, because writer.block will be # updated due to the golden event. submitter = Submitter(writer.block, nonce) submitter.start() golden.set() class Writer(Thread): def __init__(self,dynclock_hex): Thread.__init__(self) # Keep something sensible available while waiting for the # first getwork self.block = "0" * 256 # self.target = "f" * 56 + "ff070000" # diff=32 self.target = "f" * 56 + "ff7f0000" # diff=2 self.diff = 2.0 # NB This is updated from target (default 2 is safer than 32 to avoid losing shares) self.dynclock_hex = dynclock_hex self.daemon = True def run(self): while True: try: work = bitcoin.getwork() self.block = work['data'] self.target = work['target'] except: print("RPC getwork error") # In this case, keep crunching with the old data. It will get # stale at some point, but it's better than doing nothing. # print("block " + self.block + " target " + self.target) # DEBUG sdiff = self.target.decode('hex')[31:27:-1] intTarget = int(sdiff.encode('hex'), 16) if (intTarget < 1): print "WARNING zero target, defaulting to diff=2", intTarget print "target", self.target print("sdiff", sdiff) # NB Need brackets here else prints binary self.target = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f0000" else: newdiff = 65536.0 / (intTarget+1) if (self.diff != newdiff): print "New target diff =", newdiff self.diff = newdiff # Replace MSB 16 bits of target with clock (NB its reversed) self.target = self.target[0:60] + self.dynclock_hex self.dynclock_hex = "0000" # Once only print("Sending data to FPGA") # DEBUG # for litecoin send 80 bytes of the 128 byte data plus 4 bytes of 32 byte target payload = self.target.decode('hex')[31:27:-1] + self.block.decode('hex')[79::-1] # TEST HASH, this should match on nonce 0000318f # NB The pool will REJECT this share as it did not send the data... # UNCOMMENT the following two lines for testing... # test_payload ="000000014eb4577c82473a069ca0e95703254da62e94d1902ab6f0eae8b1e718565775af20c9ba6ced48fc9915ef01c54da2200090801b2d2afc406264d491c7dfc7b0b251e91f141b44717e00310000ff070000" # payload = test_payload.decode('hex')[::-1] print("Payload " + payload.encode('hex_codec')) # DEBUG ser.write(payload) result = golden.wait(askrate) if result: golden.clear() class Submitter(Thread): def __init__(self, block, nonce): Thread.__init__(self) self.block = block self.nonce = nonce def run(self): # This thread will be created upon every submit, as they may # come in sooner than the submits finish. # print("Block found on " + ctime()) print("Share found on " + ctime() + " nonce " + self.nonce.encode('hex_codec')) hrnonce = self.nonce[::-1].encode('hex') data = self.block[:152] + hrnonce + self.block[160:] try: result = bitcoin.getwork(data) print("Upstream result: " + str(result)) except: print("RPC send error") # a sensible boolean for stats result = False results_queue.put(result) class Display_stats(Thread): def __init__(self): Thread.__init__(self) self.count = [0, 0] self.starttime = time() self.daemon = True print("Miner started on " + ctime()) def run(self): while True: result = results_queue.get() if result: self.count[0] += 1 else: self.count[1] += 1 print(stats(self.count, self.starttime)) results_queue.task_done() # ======= main ======= # Process command line if (len(sys.argv) > 2): print "ERROR too many command line arguments" print "usage:", sys.argv[0], "clockfreq" quit() if (len(sys.argv) == 1): print "WARNING no clockfreq supplied, not setting freq" else: # TODO ought to check the value is a valid integer try: dynclock = int(sys.argv[1]) except: print "ERROR parsing clock frequency on command line, needs to be an integer" print "usage:", sys.argv[0], "clockfreq" quit() if (dynclock==0): print "ERROR parsing clock frequency on command line, cannot be zero" print "usage:", sys.argv[0], "clockfreq" quit() if (dynclock>254): # Its 254 since onescomplement(255) is zero, which is not allowed print "ERROR parsing clock frequency on command line, max 254" print "usage:", sys.argv[0], "clockfreq" quit() if (dynclock<25): print "ERROR use at least 25 for clock (the DCM can lock up for low values)" print "usage:", sys.argv[0], "clockfreq" quit() dynclock_hex = "{0:04x}".format((255-dynclock)*256+dynclock) # both value and ones-complement print "INFO will set clock to", dynclock, "MHz hex", dynclock_hex golden = Event() url = 'http://' + user + ':' + password + '@' + host + ':' + http_port bitcoin = ServiceProxy(url) results_queue = Queue() # default is 8 bit no parity which is fine ... # http://pyserial.sourceforge.net/shortintro.html#opening-serial-ports ser = Serial(serial_port, 115200, timeout=askrate) reader = Reader() writer = Writer(dynclock_hex) disp = Display_stats() reader.start() writer.start() disp.start() try: while True: # Threads are generally hard to interrupt. So they are left # running as daemons, and we do something simple here that can # be easily terminated to bring down the entire script. sleep(10000) except KeyboardInterrupt: print("Terminated") ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/CHANGES.txt ================================================ ======================== pySerial Release Notes ======================== Version 1.0 13 Feb 2002 --------------------------- - First public release. - Split from the pybsl application (see http://mspgcc.sourceforge.net) New Features: - Added Jython support Version 1.1 14 Feb 2002 --------------------------- Bugfixes: - Win32, when not specifying a timeout - Typos in the Docs New Features: - added ``serialutil`` which provides a base class for the ``Serial`` objects. - ``readline``, ``readlines``, ``writelines`` and ``flush`` are now supported see README.txt for deatils. Version 1.11 14 Feb 2002 --------------------------- Same as 1.1 but added missing files. Version 1.12 18 Feb 2002 --------------------------- Removed unneded constants to fix RH7.x problems. Version 1.13 09 Apr 2002 --------------------------- Added alternate way for enabling rtscts (CNEW_RTSCTS is tried too) If port opening fails, a ``SerialException`` is raised on all platforms Version 1.14 29 May 2002 --------------------------- Added examples to archive Added non-blocking mode for ``timeout=0`` (tnx Mat Martineau) Bugfixes: - win32 does now return the remaining characters on timeout Version 1.15 04 Jun 2002 --------------------------- Bugfixes (win32): - removed debug messages - compatibility to win9x improved Version 1.16 02 Jul 2002 --------------------------- Added implementation of RI and corrected RTS/CTS on Win32 Version 1.17 03 Jul 2002 --------------------------- Silly mix of two versions in win32 code corrected Version 1.18 06 Dec 2002 --------------------------- Bugfixes (general): - remove the mapping of flush to the destructive flushOutput as this is not the expected behaviour. - readline: EOL character for lines can be chosen idea by John Florian. Bugfixes (posix): - cygwin port numbering fixed - test each and every constant for it's existence in termios module, use default if not existent (fix for Bug item #640214) - wrong exception on nonexistent ports with /dev file. bug report by Louis Cordier Bugfixes (win32): - RTS/CTS handling as suggested in Bug #635072 - bugfix of timeouts brought up by Markus Hoffrogge Version 1.19 19 Mar 2003 --------------------------- Bugfixes (posix): - removed ``dgux`` entry which actually had a wrong comment and is probably not in use anywhere. Bugfixes (win32): - added ``int()`` conversion, [Bug 702120] - remove code to set control lines in close method of win32 version. [Bug 669625] Version 1.20 28 Aug 2003 --------------------------- - Added ``serial.device()`` for all platforms Bugfixes (win32): - don't recreate overlapped structures and events on each read/write. - don't set unneeded event masks. - dont use DOS device names for ports > 9. - remove send timeout (its not used in the linux impl. anyway). Version 1.21 30 Sep 2003 --------------------------- Bugfixes (win32): - name for COM10 was not built correctly, found by Norm Davis. Bugfixes (examples): - small change in ``miniterm.py`` that should mage it run on cygwin, [Bug 809904] submitted by Rolf Campbell. Version 2.0b1 1 Oct 2003 --------------------------- Transition to the Python 2.0 series: - New implementation only supports Python 2.2+, backwards compatibility should be maintained almost everywhere. The OS handles (like the ``hComPort`` or ``fd`` attribute) were prefixed with an underscore. The different names stay, as anyone that uses one of these has to write platform specific code anyway. - Common base class ``serialutil.SerialBase`` for all implementations. - ``PARITY_NONE``, ``PARITY_EVEN``, ``PARITY_ODD`` constants changed and all these constants moved to ``serialutil.py`` (still available as ``serial.PARITY_NONE`` etc. and they should be used that way) - Added ``serial.PARITY_NAMES`` (implemented in ``serialutil.PARITY_NAMES``). This dictionary can be used to convert parity constants to meaningful strings. - Each Serial class and instance has a list of supported values: ``BAUDRATES``, ``BYTESIZES``, ``PARITIES``, ``STOPBITS``Ggg (i.e. ``serial.Serial.BAUDRATES or s = serial.Serial; s.BAUDRATES``) these values can be used to fill in value sin GUI dialogs etc. - Creating a ``Serial()`` object without port spec returns an unconfigured, closed port. Useful if a GUI dialog should take a port and configure it. - New methods for ``serial.Serial`` instances: ``open()``, ``isOpen()`` - A port can be opened and closed as many times as desired. - Instances of ``serial.Serial`` have ``baudrate``, ``bytesize``, ``timeout`` etc. attributes implemented as properties, all can be set while the port is opened. It will then be reconfigured. - Improved ``__doc__``'s. - New ``test_advanced.py`` for the property setting/getting testing. - Small bugfix on posix with get* methods (return value should be true a boolean). - added a ``__repr__`` that returns a meaningful string will all the serial setting, easy for debugging. - The serialposix module does not throw an exception on unsupported platforms, the message is still printed. The idea that it may still work even if the platform itself s not known, it simply tries to do the posix stuff anyway (It's likely that opening ports by number fails, but by name it should work). Version 2.0b2 4 Oct 2003 --------------------------- - Added serial port configuration dialog for wxPython to the examples. - Added terminal application for wxPython with wxGlade design file to the examples. - Jython support is currently broken as Jython does not have a Python 2.2 compatible release out yet Version 2.0 6 Nov 2003 --------------------------- - Fixes ``setup.py`` for older distutils Version 2.1 28 Jul 2004 --------------------------- Bugfixes: - Fix XON/XOFF values [Bug 975250] Bugfixes (posix): - ``fd == 0`` fix from Vsevolod Lobko - netbsd fixes from Erik Lindgren - Dynamicaly lookup baudrates and some cleanups Bugfixes (examples): - CRLF handling of ``miniterm.py`` should be more consistent on Win32 and others. Added LF only command line option - Multithreading fixes to ``wxTerminal.py`` (helps with wxGTK) - Small change for wxPython 2.5 in ``wxSerialConfigDialog.py`` [Bug 994856] New Features: - Implement write timeouts (``writeTimeout`` parameter) Version 2.2 31 Jul 2005 --------------------------- Bugfixes: - [Bug 1014227]: property broken - [Bug 1105687]: ``serial_tcp_example.py``: ``--localport`` option - [Bug 1106313]: device (port) strings cannot be unicode Bugfixes (posix): - [Patch 1043436] Fix for [Bug 1043420] (OSError: EAGAIN) - [Patch 1102700] ``fileno()`` added - ensure disabled PARMRK Bugfixes (win32): - [Patch 983106]: keep RTS/CTS state on port setting changes New Features: - ``dsrdtr`` setting to enable/disable DSR/DTR flow control independently from the ``rtscts`` setting. (Currenly Win32 only, ignored on other platforms) Version 2.3 19 Jun 2008 --------------------------- New Features: - iterator interface. ``for line in Serial(...): ...`` is now possible Suggested by Bernhard Bender - ``sendBreak()`` accepts a ``duration`` argument. Default duration increased. - win32 handles \\.\COMx format automatically for com ports of higher number (COM10 is internally translated to \\.\COM10 etc.) - miniterm.py has a new feature to send a file (upload) and configurable special characters for exit and upload. Refactored internals to class based structure (upload and class refactoring by Colin D Bennett) Bugfixes: - [Bug 1451535] TCP/serial redirect example "--help" - update VERSION variable - update wxSerialConfigDialog.py and wxTerminal.py compatibility with wxPython 2.8 (Peleg) - Check for string in write function. Using unicode causes errors, this helps catching errors early (Tom Lynn) Bugfixes (posix): - [Bug 1554183] setRTS/setDTR reference to non existing local "on" - [Bug 1513653] file descriptor not closed when exception is thrown - FreeBSD now uses cuadX instead of cuaaX (Patrick Phalen) Bugfixes (win32): - [Bug 1520357] Handle leak - [Bug 1679013] Ignore exception raised by SetCommTimeout() in close(). - [Bug 1938118] process hang forever under XP Version 2.4 6 Jul 2008 --------------------------- New Features: - [Patch 1616790] pyserial: Add inter-character timeout feature - [Patch 1924805] add a setBreak function - Add mark/space parity - Add .NET/Mono backend (IronPython) Bugfixes (posix): - [Bug 1783159] Arbitrary baud rates (Linux/Posix) Bugfixes (win32): - [Patch 1561423] Add mark/space parity, Win32 - [Bug 2000771] serial port CANNOT be specified by number on windows - examples/scanwin32.py does no longer return \\.\ names - fix \\.\ handling for some cases Bugfixes (jython): - The Jython backend tries javax.comm and gnu.io (Seo Sanghyeon) Version 2.5-rc1 2009-07-30 --------------------------- New Features: - Python 3.x support (through 2to3) - compatible with Python io library (Python 2.6+) - Support for Win32 is now written on the top of ctypes (bundled with Python 2.5+) instead of pywin32 (patch by Giovanni Bajo). - 1.5 stop bits (STOPBITS_ONE_POINT_FIVE, implemented on all platforms) - miniterm application extended (CTRL+T -> menu) - miniterm.py is now installed as "script" - add scanlinux.py example - add port_publisher example - experimental RFC-2217 server support (examples/rfc2217_server.py) - add ``getSettingsDict`` and ``applySettingsDict`` serial object methods - use a ``poll`` based implementation on Posix, instead of a ``select`` based, provides better error handling [removed again in later releases]. Bugfixes: - Improve and fix tcp_serial_redirector example. - [Bug 2603052] 5-bit mode (needs 1.5 stop bits in some cases) Bugfixes (posix): - [Bug 2810169] Propagate exceptions raised in serialposix _reconfigure - [Bug 2562610] setting non standard baud rates on Darwin (Emmanuel Blot) Bugfixes (win32): - [Bug 2469098] parity PARITY_MARK, PARITY_SPACE isn't supported on win32 - [SF 2446218] outWaiting implemented - [Bug 2392892] scanwin32.py better exception handling - [Bug 2505422] scanwin32.py Vista 64bit compatibility Version 2.5-rc2 2010-01-02 --------------------------- New Features: - Documentation update, now written with Sphinx/ReST - Updated miniterm.py example - experimental RFC-2217 client support (serial.rfc2217.Serial, see docs) - add ``loop://`` device for testing. - add ``serial.serial_for_url`` factory function (support for native ports and ``rfc2217``, ``socket`` and ``loop`` URLs) - add new example: ``rfc2217_server.py`` - tests live in their own directory now (no longer in examples) Bugfixes: - [Bug 2915810] Fix for suboption parsing in rfc2217 - Packaging bug (missed some files) Bugfixes (posix): - improve write timeout behavior - [Bug 2836297] move Linux specific constants to not break other platforms - ``poll`` based implementation for ``read`` is in a separate class ``PosixPollSerial``, as it is not supported well on all platforms (the default ``Serial`` class uses select). - changed error handling in ``read`` so that disconnected devices are detected. Bugfixes (win32): - [Bug 2886763] hComPort doesn't get initialized for Serial(port=None) Version 2.5 2010-07-22 --------------------------- New Features: - [Bug 2976262] dsrdtr should default to False ``dsrdtr`` parameter default value changed from ``None`` (follow ``rtscts`` setting) to ``False``. This means ``rtscts=True`` enables hardware flow control on RTS/CTS but no longer also on DTR/DSR. This change mostly affects Win32 as on other platforms, that setting was ignored anyway. - Improved xreadlines, it is now a generator function that yields lines as they are received (previously it called readlines which would only return all lines read after a read-timeout). However xreadlines is deprecated an not available when the io module is used. Use ``for line in Serial(...):`` instead. Bugfixes: - [Bug 2925854] test.py produces exception with python 3.1 - [Bug 3029812] 2.5rc2 readline(s) doesn't work Bugfixes (posix): - [BUG 3006606] Nonblocking error - Unix platform Bugfixes (win32): - [Bug 2998169] Memory corruption at faster transmission speeds. (bug introduced in 2.5-rc1) Version 2.6 2011-11-02 --------------------------- New Features: - Moved some of the examples to serial.tools so that they can be used with ``python -m`` - serial port enumeration now included as ``serial.tools.list_ports`` - URL handers for ``serial_for_url`` are now imported dynamically. This allows to add protocols w/o editing files. The list ``serial.protocol_handler_packages`` can be used to add or remove user packages with protocol handlers (see docs for details). - new URL type: hwgrep:// uses list_ports module to search for ports by their description - serveral internal changes to improve Python 3.x compatibility (setup.py, use of absolute imports and more) Bugfixes: - [Bug 3093882] calling open() on an already open port now raises an exception - [Bug 3245627] connection-lost let rfc2217 hangs in closed loop - [Patch 3147043] readlines() to support multi-character eol Bugfixes (posix): - [Patch 3316943] Avoid unneeded termios.tcsetattr calls in serialposix.py - [Patch 2912349] Serial Scan as a Module with Mac Support Bugfixes (win32): - [Bug 3057499] writeTimeoutError when write Timeout is 0 - [Bug 3414327] Character out of range in list_ports_windows - [Patch 3036175] Windows 98 Support fix - [Patch 3054352] RTS automatic toggle, for RS485 functionality. - Fix type definitions for 64 bit Windows compatibility ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/LICENSE.txt ================================================ Copyright (c) 2001-2011 Chris Liechti ; All Rights Reserved. This is the Python license. In short, you can use this product in commercial and non-commercial applications, modify it, redistribute it. A notification to the author when you use and/or modify it is welcome. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE =================================================================== LICENSE AGREEMENT ----------------- 1. This LICENSE AGREEMENT is between the copyright holder of this product, and the Individual or Organization ("Licensee") accessing and otherwise using this product in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, the copyright holder hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use this product alone or in any derivative version, provided, however, that copyright holders License Agreement and copyright holders notice of copyright are retained in this product alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates this product or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to this product. 4. The copyright holder is making this product available to Licensee on an "AS IS" basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS PRODUCT WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THIS PRODUCT FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING THIS PRODUCT, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between the copyright holder and Licensee. This License Agreement does not grant permission to use trademarks or trade names from the copyright holder in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using this product, Licensee agrees to be bound by the terms and conditions of this License Agreement. ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/MANIFEST.in ================================================ include README.txt include LICENSE.txt include CHANGES.txt include MANIFEST.in include setup.py include examples/enhancedserial.py include examples/miniterm.py include examples/port_publisher.py include examples/port_publisher.sh include examples/rfc2217_server.py include examples/scan.py include examples/scanlinux.py include examples/scanwin32.py include examples/setup-miniterm-py2exe.py include examples/setup-rfc2217_server-py2exe.py include examples/setup-wxTerminal-py2exe.py include examples/tcp_serial_redirect.py include examples/wxSerialConfigDialog.py include examples/wxSerialConfigDialog.wxg include examples/wxTerminal.py include examples/wxTerminal.wxg include test/run_all_tests.py include test/test.py include test/test_advanced.py include test/test_high_load.py include test/test_io_lib.py include test/test_readline.py include documentation/*.rst include documentation/pyserial.png include documentation/conf.py include documentation/Makefile ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/PKG-INFO ================================================ Metadata-Version: 1.0 Name: pyserial Version: 2.6 Summary: Python Serial Port Extension Home-page: http://pyserial.sourceforge.net/ Author: Chris Liechti Author-email: cliechti@gmx.net License: Python Description: Python Serial Port Extension for Win32, Linux, BSD, Jython, IronPython Platform: any Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: End Users/Desktop Classifier: License :: OSI Approved :: Python Software Foundation License Classifier: Natural Language :: English Classifier: Operating System :: POSIX Classifier: Operating System :: Microsoft :: Windows Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.3 Classifier: Programming Language :: Python :: 2.4 Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.0 Classifier: Programming Language :: Python :: 3.1 Classifier: Programming Language :: Python :: 3.2 Classifier: Topic :: Communications Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Terminals :: Serial ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/README.txt ================================================ ========== pySerial ========== Overview ======== This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named "serial" automatically selects the appropriate backend. - Project Homepage: http://pyserial.sourceforge.net - Project page on SourceForge: http://sourceforge.net/projects/pyserial/ - SVN repository: http://sourceforge.net/svn/?group_id=46487 - Download Page: http://sourceforge.net/project/showfiles.php?group_id=46487 BSD license, (C) 2001-2011 Chris Liechti Documentation ============= For API documentation, usage and examples see files in the "documentation" directory. The ".rst" files can be read in any text editor or being converted to HTML or PDF using Sphinx. An online HTML version is at http://pyserial.sourceforge.net. Examples ======== Examples and unit tests are in the directory "examples". Installation ============ Detailed information can be found in "documentation/pyserial.rst". The usual setup.py for Python libraries is used for the source distribution. Windows installers are also available (see download link above). ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/Makefile ================================================ # Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf _build/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html @echo @echo "Build finished. The HTML pages are in _build/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml @echo @echo "Build finished. The HTML pages are in _build/dirhtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in _build/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in _build/qthelp, like this:" @echo "# qcollectiongenerator _build/qthelp/pySerial.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile _build/qthelp/pySerial.qhc" latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex @echo @echo "Build finished; the LaTeX files are in _build/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes @echo @echo "The overview file is in _build/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in _build/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in _build/doctest/output.txt." ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/appendix.rst ================================================ ========== Appendix ========== How To ====== Enable :rfc:`2217` in programs using pySerial. Patch the code where the :class:`serial.Serial` is instantiated. Replace it with:: try: s = serial.serial_for_url(...) except AttributeError: s = serial.Serial(...) Assuming the application already stores port names as strings that's all that is required. The user just needs a way to change the port setting of your application to an ``rfc2217://`` :ref:`URL ` (e.g. by editing a configuration file, GUI dialog etc.). Please note that this enables all :ref:`URL ` types supported by pySerial and that those involving the network are unencrypted and not protected against eavesdropping. Test your setup. Is the device not working as expected? Maybe it's time to check the connection before proceeding. :ref:`miniterm` from the :ref:`examples` can be used to open the serial port and do some basic tests. To test cables, connecting RX to TX (loop back) and typing some characters in :ref:`miniterm` is a simple test. When the characters are displayed on the screen, then at least RX and TX work (they still could be swapped though). FAQ === Example works in :ref:`miniterm` but not in script. The RTS and DTR lines are switched when the port is opened. This may cause some processing or reset on the connected device. In such a cases an immediately following call to :meth:`write` may not be received by the device. A delay after opening the port, before the first :meth:`write`, is recommended in this situation. E.g. a ``time.sleep(1)`` Application works when .py file is run, but fails when packaged (py2exe etc.) py2exe and similar packaging programs scan the sources for import statements and create a list of modules that they package. pySerial may create two issues with that: - implementations for other modules are found. On Windows, it's safe to exclude 'serialposix', 'serialjava' and 'serialcli' as these are not used. - :func:`serial.serial_for_url` does a dynamic lookup of protocol handlers at runtime. If this function is used, the desired handlers have to be included manually (e.g. 'serial.urlhandler.protocol_socket', 'serial.urlhandler.protocol_rfc2217', etc.). This can be done either with the "includes" option in ``setup.py`` or by a dummy import in one of the packaged modules. User supplied URL handlers :func:`serial.serial_for_url` can be used to access "virtual" serial ports identified by an :ref:`URL ` scheme. E.g. for the :rfc:`2217`: ``rfc2217:://``. Custom :ref:`URL ` handlers can be added by extending the module search path in :data:`serial.protocol_handler_packages`. This is possible starting from pySerial V2.6. Related software ================ com0com - http://com0com.sourceforge.net/ Provides virtual serial ports for Windows. License ======= Copyright (C) 2001-2011 Chris Liechti ; All Rights Reserved. This is the Python license. In short, you can use this product in commercial and non-commercial applications, modify it, redistribute it. A notification to the author when you use and/or modify it is welcome. **TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE** *LICENSE AGREEMENT* 1. This LICENSE AGREEMENT is between the copyright holder of this product, and the Individual or Organization ("Licensee") accessing and otherwise using this product in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, the copyright holder hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use this product alone or in any derivative version, provided, however, that copyright holders License Agreement and copyright holders notice of copyright are retained in this product alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates this product or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to this product. 4. The copyright holder is making this product available to Licensee on an "AS IS" basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS PRODUCT WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THIS PRODUCT FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING THIS PRODUCT, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between the copyright holder and Licensee. This License Agreement does not grant permission to use trademarks or trade names from the copyright holder in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using this product, Licensee agrees to be bound by the terms and conditions of this License Agreement. ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/conf.py ================================================ # -*- coding: utf-8 -*- # # pySerial documentation build configuration file, created by # sphinx-quickstart on Tue Jul 21 00:27:45 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.intersphinx'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information about the project. project = u'pySerial' copyright = u'2001-2010, Chris Liechti' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '2.6' # The full version, including alpha/beta/rc tags. release = '2.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. #unused_docs = [] # List of directories, relative to source directory, that shouldn't be searched # for source files. exclude_trees = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. html_logo = 'pyserial.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_use_modindex = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'pySerialdoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'pySerial.tex', u'pySerial Documentation', u'Chris Liechti', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. latex_logo = 'pyserial.png' # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_use_modindex = True # for external links to standard library intersphinx_mapping = { #~ 'python': ('http://docs.python.org', None), 'py': ('http://docs.python.org', None), } ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/examples.rst ================================================ .. _examples: ========== Examples ========== .. _miniterm: Miniterm ======== This is a console application that provides a small terminal application. Miniterm itself does not implement any terminal features such as VT102 compatibility. However it inherits these features from the terminal it is run. For example on GNU/Linux running from an xterm it will support the escape sequences of the xterm. On Windows the typical console window is dumb and does not support any escapes. When ANSI.sys is loaded it supports some escapes. Miniterm:: --- Miniterm on /dev/ttyS0: 9600,8,N,1 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- Command line options can be given so that binary data including escapes for terminals are escaped or output as hex. Miniterm supports :rfc:`2217` remote serial ports and raw sockets using :ref:`URLs` such as ``rfc2217:://:`` respectively ``socket://:`` as *port* argument when invoking. Command line options ``python -m serial.tools.miniterm -h``:: Usage: miniterm.py [options] [port [baudrate]] Miniterm - A simple terminal program for the serial port. Options: -h, --help show this help message and exit -p PORT, --port=PORT port, a number (default 0) or a device name (deprecated option) -b BAUDRATE, --baud=BAUDRATE set baud rate, default 9600 --parity=PARITY set parity, one of [N, E, O, S, M], default=N -e, --echo enable local echo (default off) --rtscts enable RTS/CTS flow control (default off) --xonxoff enable software flow control (default off) --cr do not send CR+LF, send CR only --lf do not send CR+LF, send LF only -D, --debug debug received data (escape non-printable chars) --debug can be given multiple times: 0: just print what is received 1: escape non-printable characters, do newlines as unusual 2: escape non-printable characters, newlines too 3: hex dump everything --rts=RTS_STATE set initial RTS line state (possible values: 0, 1) --dtr=DTR_STATE set initial DTR line state (possible values: 0, 1) -q, --quiet suppress non error messages --exit-char=EXIT_CHAR ASCII code of special character that is used to exit the application --menu-char=MENU_CHAR ASCII code of special character that is used to control miniterm (menu) Miniterm supports some control functions. Typing :kbd:`Ctrl+T Ctrl+H` when it is running shows the help text:: --- pySerial - miniterm - help --- --- Ctrl+] Exit program --- Ctrl+T Menu escape key, followed by: --- Menu keys: --- Ctrl+T Send the menu character itself to remote --- Ctrl+] Send the exit character to remote --- Ctrl+I Show info --- Ctrl+U Upload file (prompt will be shown) --- Toggles: --- Ctrl+R RTS Ctrl+E local echo --- Ctrl+D DTR Ctrl+B BREAK --- Ctrl+L line feed Ctrl+A Cycle repr mode --- --- Port settings (Ctrl+T followed by the following): --- p change port --- 7 8 set data bits --- n e o s m change parity (None, Even, Odd, Space, Mark) --- 1 2 3 set stop bits (1, 2, 1.5) --- b change baud rate --- x X disable/enable software flow control --- r R disable/enable hardware flow control .. versionchanged:: 2.5 Added :kbd:`Ctrl+T` menu and added support for opening URLs. .. versionchanged:: 2.6 File moved from the examples to :mod:`serial.tools.miniterm`. miniterm.py_ The miniterm program. setup-miniterm-py2exe.py_ This is a py2exe setup script for Windows. It can be used to create a standalone ``miniterm.exe``. .. _miniterm.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/serial/tools/miniterm.py .. _setup-miniterm-py2exe.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/setup-miniterm-py2exe.py TCP/IP - serial bridge ====================== This program opens a TCP/IP port. When a connection is made to that port (e.g. with telnet) it forwards all data to the serial port and vice versa. This example only exports a raw socket connection. The next example below gives the client much more control over the remote serial port. - The serial port settings are set on the command line when starting the program. - There is no possibility to change settings from remote. - All data is passed through as-is. :: Usage: tcp_serial_redirect.py [options] [port [baudrate]] Simple Serial to Network (TCP/IP) redirector. Options: -h, --help show this help message and exit -q, --quiet suppress non error messages --spy peek at the communication and print all data to the console Serial Port: Serial port settings -p PORT, --port=PORT port, a number (default 0) or a device name -b BAUDRATE, --baud=BAUDRATE set baud rate, default: 9600 --parity=PARITY set parity, one of [N, E, O], default=N --rtscts enable RTS/CTS flow control (default off) --xonxoff enable software flow control (default off) --rts=RTS_STATE set initial RTS line state (possible values: 0, 1) --dtr=DTR_STATE set initial DTR line state (possible values: 0, 1) Network settings: Network configuration. -P LOCAL_PORT, --localport=LOCAL_PORT local TCP port --rfc2217 allow control commands with Telnet extension RFC-2217 Newline Settings: Convert newlines between network and serial port. Conversion is normally disabled and can be enabled by --convert. -c, --convert enable newline conversion (default off) --net-nl=NET_NEWLINE type of newlines that are expected on the network (default: LF) --ser-nl=SER_NEWLINE type of newlines that are expected on the serial port (default: CR+LF) NOTE: no security measures are implemented. Anyone can remotely connect to this service over the network. Only one connection at once is supported. When the connection is terminated it waits for the next connect. tcp_serial_redirect.py_ Main program. .. _tcp_serial_redirect.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/tcp_serial_redirect.py Single-port TCP/IP - serial bridge (RFC 2217) ============================================= Simple cross platform :rfc:`2217` serial port server. It uses threads and is portable (runs on POSIX, Windows, etc). - The port settings and control lines (RTS/DTR) can be changed at any time using :rfc:`2217` requests. The status lines (DSR/CTS/RI/CD) are polled every second and notifications are sent to the client. - Telnet character IAC (0xff) needs to be doubled in data stream. IAC followed by an other value is interpreted as Telnet command sequence. - Telnet negotiation commands are sent when connecting to the server. - RTS/DTR are activated on client connect and deactivated on disconnect. - Default port settings are set again when client disconnects. :: Usage: rfc2217_server.py [options] port RFC 2217 Serial to Network (TCP/IP) redirector. Options: -h, --help show this help message and exit -p LOCAL_PORT, --localport=LOCAL_PORT local TCP port NOTE: no security measures are implemented. Anyone can remotely connect to this service over the network. Only one connection at once is supported. When the connection is terminated it waits for the next connect. .. versionadded:: 2.5 rfc2217_server.py_ Main program. setup-rfc2217_server-py2exe.py_ This is a py2exe setup script for Windows. It can be used to create a standalone ``rfc2217_server.exe``. .. _rfc2217_server.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/rfc2217_server.py .. _setup-rfc2217_server-py2exe.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/setup-rfc2217_server-py2exe.py Multi-port TCP/IP - serial bridge (RFC 2217) ============================================ This example implements a TCP/IP to serial port service that works with multiple ports at once. It uses select, no threads, for the serial ports and the network sockets and therefore runs on POSIX systems only. - Full control over the serial port with :rfc:`2217`. - Check existence of ``/tty/USB0...8``. This is done every 5 seconds using ``os.path.exists``. - Send zeroconf announcements when port appears or disappears (uses python-avahi and dbus). Service name: ``_serial_port._tcp``. - Each serial port becomes available as one TCP/IP server. e.g. ``/dev/ttyUSB0`` is reachable at ``:7000``. - Single process for all ports and sockets (not per port). - The script can be started as daemon. - Logging to stdout or when run as daemon to syslog. - Default port settings are set again when client disconnects. - modem status lines (CTS/DSR/RI/CD) are not polled periodically and the server therefore does not send NOTIFY_MODEMSTATE on its own. However it responds to request from the client (i.e. use the ``poll_modem`` option in the URL when using a pySerial client.) Requirements: - Python (>= 2.4) - python-avahi - python-dbus - python-serial (>= 2.5) Installation as daemon: - Copy the script ``port_publisher.py`` to ``/usr/local/bin``. - Copy the script ``port_publisher.sh`` to ``/etc/init.d``. - Add links to the runlevels using ``update-rc.d port_publisher.sh defaults 99`` - Thats it :-) the service will be started on next reboot. Alternatively run ``invoke-rc.d port_publisher.sh start`` as root. .. versionadded:: 2.5 new example port_publisher.py_ Multi-port TCP/IP-serial converter (RFC 2217) for POSIX environments. port_publisher.sh_ Example init.d script. .. _port_publisher.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/port_publisher.py .. _port_publisher.sh: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/port_publisher.sh wxPython examples ================= A simple terminal application for wxPython and a flexible serial port configuration dialog are shown here. wxTerminal.py_ A simple terminal application. Note that the length of the buffer is limited by wx and it may suddenly stop displaying new input. wxTerminal.wxg_ A wxGlade design file for the terminal application. wxSerialConfigDialog.py_ A flexible serial port configuration dialog. wxSerialConfigDialog.wxg_ The wxGlade design file for the configuration dialog. setup-wxTerminal-py2exe.py_ A py2exe setup script to package the terminal application. .. _wxTerminal.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxTerminal.py .. _wxTerminal.wxg: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxTerminal.wxg .. _wxSerialConfigDialog.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxSerialConfigDialog.py .. _wxSerialConfigDialog.wxg: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxSerialConfigDialog.wxg .. _setup-wxTerminal-py2exe.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/setup-wxTerminal-py2exe.py Wrapper class ============= This example provides a subclass based on ``Serial`` that has an alternative implementation of ``readline()`` enhancedserial.py_ A class with alternative ``readline()`` implementation. .. _enhancedserial.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/enhancedserial.py Unit tests ========== The project uses a number of unit test to verify the functionality. They all need a loop back connector. The scripts itself contain more information. All test scripts are contained in the directory ``test``. The unit tests are performed on port ``0`` unless a different device name or ``rfc2217://`` URL is given on the command line (argv[1]). run_all_tests.py_ Collect all tests from all ``test*`` files and run them. By default, the ``loop://`` device is used. test.py_ Basic tests (binary capabilities, timeout, control lines). test_advanced.py_ Test more advanced features (properties). test_high_load.py_ Tests involving sending a lot of data. test_readline.py_ Tests involving readline. test_iolib.py_ Tests involving the :mod:`io` library. Only available for Python 2.6 and newer. test_url.py_ Tests involving the :ref:`URL ` feature. .. _run_all_tests.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/run_all_tests.py .. _test.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/test.py .. _test_advanced.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/test_advanced.py .. _test_high_load.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/test_high_load.py .. _test_readline.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/test_readline.py .. _test_iolib.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/test_iolib.py .. _test_url.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/test/test_url.py ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/index.rst ================================================ .. pySerial documentation master file Welcome to pySerial's documentation =================================== This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named "serial" automatically selects the appropriate backend. Other pages (online) - `project page on SourceForge`_ - `SVN repository`_ - `Download Page`_ with releases - This page, when viewed online, is at http://pyserial.sf.net. .. _`project page on SourceForge`: http://sourceforge.net/projects/pyserial/ .. _`SVN repository`: http://sourceforge.net/svn/?group_id=46487 .. _`Download Page`: http://pypi.python.org/pypi/pyserial Contents: .. toctree:: :maxdepth: 2 pyserial shortintro examples pyserial_api pyparallel appendix Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/pyparallel.rst ================================================ ============ pyParallel ============ .. note:: This module is in development (since years ;-) Overview ======== This module encapsulates the access for the parallel port. It provides backends for Python running on Windows and Linux. Other platforms are possible too but not yet integrated. This module is still under development. But it may be useful for developers. Copyright (C) 2001-2003 Chris Liechti Here is the `project page on SourceForge`_ and here is the `SVN repository`_. .. _`project page on SourceForge`: http://sourceforge.net/projects/pyserial/ .. _`SVN repository`: http://sourceforge.net/svn/?group_id=46487 Features -------- * same class based interface on all supported platforms * port numbering starts at zero, no need to know the port name in the user program * port string (device name) can be specified if access through numbering is inappropriate Requirements ------------ * Python 2.2 or newer * "Java Communications" (JavaComm) extension for Java/Jython Installation ------------ Extract files from the archive, open a shell/console in that directory and let Distutils do the rest: ``python setup.py install`` The files get installed in the "Lib/site-packages" directory in newer Python versions. The windows version needs a compiled extension and the giveio.sys driver for Windows NT/2k/XP. The extension module can be compiled with Distutils with either MSVC or GCC/mingw32. It is released under a free software license, see LICENSE.txt for more details. Short introduction ================== :: >>> import parallel >>> p = parallel.Parallel() # open LPT1 >>> p.setData(0x55) Examples -------- Please look in the SVN Repository. There is an example directory where you can find a simple terminal and more. http://pyserial.svn.sourceforge.net/viewvc/pyserial/trunk/pyparallel/examples/ API === .. module:: parallel .. class:: Parallel .. method:: __init__(port) Open given parallel port. .. method:: setData(value) Apply the given byte to the data pins of the parallel port. .. method:: setDataStrobe(level) Set the "data strobe" line to the given state. .. method:: setAutoFeed(level) Set "auto feed" line to given state. .. method:: setInitOut(level) Set "initialize" line to given state. .. method: setSelect(level) Set "select" line to given state. .. method:getInError() Set "Error" line to given state. .. method:: getInSelected() Read level of "select" line. .. method:: getInPaperOut() Read level of "paper out" line. .. method:: getInAcknowledge() Read level of "Acknowledge" line. .. method: getInBusy() Read level of "busy" line. .. module:: parallel.parallelutil .. class:: BitaccessMeta This mix-in class adds a few properties that allow easier bit access to the data lines. (D0 .. D7) e.g. p.D0 refers to the first bit of the data lines. .. class:: VirtualParallelPort This class provides a virtual parallel port implementation, useful for tests and simulations without real hardware. Notes ===== Linux ----- 1. The :manpage:`lp(4)` module must be unloaded, ``rmmod lp``. ``lp`` claims exclusive access to the port and other programs won't be able to use it. 2. The :manpage:`ppdev(4)` module needs to be loaded, ``modprobe ppdev``. When ``udev`` is in use, (default with 2.6 kernels) this will create a ``/dev/parport0``. 3. The user needs to have write permissions to ``/dev/parport0``. Many distributions have an ``lp`` group that owns the device; the simplest is to add the user account to this group. Simply changing permissions on the device is not the best strategy as they will be reverted to their defaults next time the driver is loaded. Windows ------- The giveio driver must be installed as the module needs direct access to the hardware. This also means that USB parallel port adapters won't be supported. Misc ==== References ---------- * Python: http://www.python.org/ * Jython: http://www.jython.org/ * Java@IBM: http://www-106.ibm.com/developerworks/java/jdk/ (JavaComm links are on the download page for the respective platform JDK) * Java@SUN: http://java.sun.com/products/ ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/pyserial.rst ================================================ ========== pySerial ========== Overview ======== This module encapsulates the access for the serial port. It provides backends for Python running on Windows, Linux, BSD (possibly any POSIX compliant system), Jython and IronPython (.NET and Mono). The module named "serial" automatically selects the appropriate backend. It is released under a free software license, see LICENSE_ for more details. Copyright (C) 2001-2010 Chris Liechti Other pages (online) - `project page on SourceForge`_ - `SVN repository`_ - `Download Page`_ with releases - This page, when viewed online is at http://pyserial.sf.net. .. _LICENSE: appendix.html#license .. _`project page on SourceForge`: http://sourceforge.net/projects/pyserial/ .. _`SVN repository`: http://sourceforge.net/svn/?group_id=46487 .. _`Download Page`: http://sourceforge.net/project/showfiles.php?group_id=46487 Features ======== - Same class based interface on all supported platforms. - Access to the port settings through Python properties. - Support for different byte sizes, stop bits, parity and flow control with RTS/CTS and/or Xon/Xoff. - Working with or without receive timeout. - File like API with "read" and "write" ("readline" etc. also supported). - The files in this package are 100% pure Python. - The port is set up for binary transmission. No NULL byte stripping, CR-LF translation etc. (which are many times enabled for POSIX.) This makes this module universally useful. - Compatible with :mod:`io` library (Python 2.6+) - RFC 2217 client (experimental), server provided in the examples. Requirements ============ - Python 2.3 or newer, including Python 3.x - ctypes extensions on Windows (is in standard library since Python 2.5+) - "Java Communications" (JavaComm) or compatible extension for Java/Jython Installation ============ pyserial -------- This installs a package that can be used from Python (``import serial``). To install the module for all users on the system, administrator rights (root) is required.. From source (tar.gz or checkout) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Download the archive from http://pypi.python.org/pypi/pyserial. Unpack the archive, enter the ``pyserial-x.y`` directory and run:: python setup.py install For Python 3.x:: python3 setup.py install From PyPI ~~~~~~~~~ Alternatively it can be installed from PyPI, either manually downloading the files and installing as described above or using:: pip pyserial or:: easy_install -U pyserial Packages ~~~~~~~~ There are also packaged versions for some Linux distributions and Windows: Debian/Ubuntu A package is available under the name "python-serial". Note that some distributions package an older version of pySerial. Windows There is also a Windows installer for end users. It is located in the PyPi_. Developers may be interested to get the source archive, because it contains examples and the readme. .. _PyPi: http://pypi.python.org/pypi/pyserial References ========== * Python: http://www.python.org/ * Jython: http://www.jython.org/ * Java@IBM: http://www-106.ibm.com/developerworks/java/jdk/ (JavaComm links are on the download page for the respective platform JDK) * Java@SUN: http://java.sun.com/products/ * IronPython: http://www.codeplex.com/IronPython * setuptools: http://peak.telecommunity.com/DevCenter/setuptools Older Versions ============== Older versions are still available on the `Download Page`_. pySerial 1.21 is compatible with Python 2.0 on Windows, Linux and several un*x like systems, MacOSX and Jython. On windows releases older than 2.5 will depend on pywin32_ (previously known as win32all) .. _`Download Page`: http://sourceforge.net/project/showfiles.php?group_id=46487 .. _pywin32: http://pypi.python.org/pypi/pywin32 ================================================ FILE: ICARUS-LX150/MiningSoftware/pyserial-2.6/documentation/pyserial_api.rst ================================================ ============== pySerial API ============== .. module:: serial Classes ======= Native ports ------------ .. class:: Serial .. method:: __init__(port=None, baudrate=9600, bytesize=EIGHTBITS, parity=PARITY_NONE, stopbits=STOPBITS_ONE, timeout=None, xonxoff=False, rtscts=False, writeTimeout=None, dsrdtr=False, interCharTimeout=None) :param port: Device name or port number number or :const:`None`. :param baudrate: Baud rate such as 9600 or 115200 etc. :param bytesize: Number of data bits. Possible values: :const:`FIVEBITS`, :const:`SIXBITS`, :const:`SEVENBITS`, :const:`EIGHTBITS` :param parity: Enable parity checking. Possible values: :const:`PARITY_NONE`, :const:`PARITY_EVEN`, :const:`PARITY_ODD` :const:`PARITY_MARK`, :const:`PARITY_SPACE` :param stopbits: Number of stop bits. Possible values: :const:`STOPBITS_ONE`, :const:`STOPBITS_ONE_POINT_FIVE`, :const:`STOPBITS_TWO` :param timeout: Set a read timeout value. :param xonxoff: Enable software flow control. :param rtscts: Enable hardware (RTS/CTS) flow control. :param dsrdtr: Enable hardware (DSR/DTR) flow control. :param writeTimeout: Set a write timeout value. :param interCharTimeout: Inter-character timeout, :const:`None` to disable (default). :exception ValueError: Will be raised when parameter are out of range, e.g. baud rate, data bits. :exception SerialException: In case the device can not be found or can not be configured. The port is immediately opened on object creation, when a *port* is given. It is not opened when *port* is :const:`None` and a successive call to :meth:`open` will be needed. Possible values for the parameter *port*: - Number: number of device, numbering starts at zero. - Device name: depending on operating system. e.g. ``/dev/ttyUSB0`` on GNU/Linux or ``COM3`` on Windows. The parameter *baudrate* can be one of the standard values: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200. These are well supported on all platforms. Standard values above 115200 such as: 230400, 460800, 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000 also work on many platforms. Non-standard values are also supported on some platforms (GNU/Linux, MAC OSX >= Tiger, Windows). Though, even on these platforms some serial ports may reject non-standard values. Possible values for the parameter *timeout*: - ``timeout = None``: wait forever - ``timeout = 0``: non-blocking mode (return immediately on read) - ``timeout = x``: set timeout to ``x`` seconds (float allowed) Writes are blocking by default, unless *writeTimeout* is set. For possible values refer to the list for *timeout* above. Note that enabling both flow control methods (*xonxoff* and *rtscts*) together may not be supported. It is common to use one of the methods at once, not both. *dsrdtr* is not supported by all platforms (silently ignored). Setting it to ``None`` has the effect that its state follows *rtscts*. Also consider using the function :func:`serial_for_url` instead of creating Serial instances directly. .. versionchanged:: 2.5 *dsrdtr* now defaults to ``False`` (instead of *None*) .. method:: open() Open port. .. method:: close() Close port immediately. .. method:: __del__() Destructor, close port when serial port instance is freed. The following methods may raise :exc:`ValueError` when applied to a closed port. .. method:: read(size=1) :param size: Number of bytes to read. :return: Bytes read from the port. Read *size* bytes from the serial port. If a timeout is set it may return less characters as requested. With no timeout it will block until the requested number of bytes is read. .. versionchanged:: 2.5 Returns an instance of :class:`bytes` when available (Python 2.6 and newer) and :class:`str` otherwise. .. method:: write(data) :param data: Data to send. :return: Number of bytes written. :exception SerialTimeoutException: In case a write timeout is configured for the port and the time is exceeded. Write the string *data* to the port. .. versionchanged:: 2.5 Accepts instances of :class:`bytes` and :class:`bytearray` when available (Python 2.6 and newer) and :class:`str` otherwise. .. versionchanged:: 2.5 Write returned ``None`` in previous versions. .. method:: inWaiting() Return the number of chars in the receive buffer. .. method:: flush() Flush of file like objects. In this case, wait until all data is written. .. method:: flushInput() Flush input buffer, discarding all it's contents. .. method:: flushOutput() Clear output buffer, aborting the current output and discarding all that is in the buffer. .. method:: sendBreak(duration=0.25) :param duration: Time (float) to activate the BREAK condition. Send break condition. Timed, returns to idle state after given duration. .. method:: setBreak(level=True) :param level: when true activate BREAK condition, else disable. Set break: Controls TXD. When active, no transmitting is possible. .. method:: setRTS(level=True) :param level: Set control line to logic level. Set RTS line to specified logic level. .. method:: setDTR(level=True) :param level: Set control line to logic level. Set DTR line to specified logic level. .. method:: getCTS() :return: Current state (boolean) Return the state of the CTS line. .. method:: getDSR() :return: Current state (boolean) Return the state of the DSR line. .. method:: getRI() :return: Current state (boolean) Return the state of the RI line. .. method:: getCD() :return: Current state (boolean) Return the state of the CD line Read-only attributes: .. attribute:: name Device name. This is always the device name even if the port was opened by a number. (Read Only). .. versionadded:: 2.5 .. attribute:: portstr :deprecated: use :attr:`name` instead New values can be assigned to the following attributes (properties), the port will be reconfigured, even if it's opened at that time: .. attribute:: port Read or write port. When the port is already open, it will be closed and reopened with the new setting. .. attribute:: baudrate Read or write current baud rate setting. .. attribute:: bytesize Read or write current data byte size setting. .. attribute:: parity Read or write current parity setting. .. attribute:: stopbits Read or write current stop bit width setting. .. attribute:: timeout Read or write current read timeout setting. .. attribute:: writeTimeout Read or write current write timeout setting. .. attribute:: xonxoff Read or write current software flow control rate setting. .. attribute:: rtscts Read or write current hardware flow control setting. .. attribute:: dsrdtr Read or write current hardware flow control setting. .. attribute:: interCharTimeout Read or write current inter character timeout setting. The following constants are also provided: .. attribute:: BAUDRATES A list of valid baud rates. The list may be incomplete such that higher baud rates may be supported by the device and that values in between the standard baud rates are supported. (Read Only). .. attribute:: BYTESIZES A list of valid byte sizes for the device (Read Only). .. attribute:: PARITIES A list of valid parities for the device (Read Only). .. attribute:: STOPBITS A list of valid stop bit widths for the device (Read Only). The following methods are for compatibility with the :mod:`io` library. .. method:: readable() :return: True .. versionadded:: 2.5 .. method:: writable() :return: True .. versionadded:: 2.5 .. method:: seekable() :return: False .. versionadded:: 2.5 .. method:: readinto(b) :param b: bytearray or array instance :return: Number of byte read Read up to len(b) bytes into :class:`bytearray` *b* and return the number of bytes read. .. versionadded:: 2.5 The port settings can be read and written as dictionary. .. method:: getSettingsDict() :return: a dictionary with current port settings. Get a dictionary with port settings. This is useful to backup the current settings so that a later point in time they can be restored using :meth:`applySettingsDict`. Note that control lines (RTS/DTR) are part of the settings. .. versionadded:: 2.5 .. method:: applySettingsDict(d) :param d: a dictionary with port settings. Applies a dictionary that was created by :meth:`getSettingsDict`. Only changes are applied and when a key is missing it means that the setting stays unchanged. Note that control lines (RTS/DTR) are not changed. .. versionadded:: 2.5 Platform specific methods. .. warning:: Programs using the following methods are not portable to other platforms! .. method:: nonblocking() :platform: Unix Configure the device for nonblocking operation. This can be useful if the port is used with :mod:`select`. .. method:: fileno() :platform: Unix :return: File descriptor. Return file descriptor number for the port that is opened by this object. It is useful when serial ports are used with :mod:`select`. .. method:: setXON(level=True) :platform: Windows :param level: Set flow control state. Set software flow control state. .. note:: For systems that provide the :py:mod:`io` library (Python 2.6 and newer), the class :class:`Serial` will derive from :py:class:`io.RawIOBase`. For all others from :class:`FileLike`. Implementation detail: some attributes and functions are provided by the class :class:`SerialBase` and some by the platform specific class and others by the base class mentioned above. .. class:: FileLike An abstract file like class. It is used as base class for :class:`Serial` when no :py:mod:`io` module is available. This class implements :meth:`readline` and :meth:`readlines` based on :meth:`read` and :meth:`writelines` based on :meth:`write`. Note that when the serial port was opened with no timeout, that :meth:`readline` blocks until it sees a newline (or the specified size is reached) and that :meth:`readlines` would never return and therefore refuses to work (it raises an exception in this case)! .. method:: writelines(sequence) Write a list of strings to the port. The following three methods are overridden in :class:`Serial`. .. method:: flush() Flush of file like objects. It's a no-op in this class, may be overridden. .. method:: read() Raises NotImplementedError, needs to be overridden by subclass. .. method:: write(data) Raises NotImplementedError, needs to be overridden by subclass. The following functions are implemented for compatibility with other file-like objects, however serial ports are not seekable. .. method:: seek(pos, whence=0) :exception IOError: always, as method is not supported on serial port .. versionadded:: 2.5 .. method:: tell() :exception IOError: always, as method is not supported on serial port .. versionadded:: 2.5 .. method:: truncate(self, n=None) :exception IOError: always, as method is not supported on serial port .. versionadded:: 2.5 .. method:: isatty() :exception IOError: always, as method is not supported on serial port .. versionadded:: 2.5 To be able to use the file like object as iterator for e.g. ``for line in Serial(0): ...`` usage: .. method:: next() Return the next line by calling :meth:`readline`. .. method:: __iter__() Returns self. Other high level access functions. .. method:: readline(size=None, eol='\\n') :param size: Max number of bytes to read, ``None`` -> no limit. :param eol: The end of line character. Read a line which is terminated with end-of-line (*eol*) character (``\n`` by default) or until timeout. .. method:: readlines(sizehint=None, eol='\\n') :param sizehint: Ignored parameter. :param eol: The end of line character. Read a list of lines, until timeout. *sizehint* is ignored and only present for API compatibility with built-in File objects. Note that this function only returns on a timeout. .. method:: xreadlines(sizehint=None) Read lines, implemented as generator. Unlike *readlines* (that only returns on a timeout) is this function yielding lines as they are received. .. deprecated:: 2.5 Use ``for line in Serial(...): ...`` instead. This method is not available in Python 2.6 and newer where the :mod:`io` library is available and pySerial bases on it. .. versionchanged:: 2.5 Implement as generator. :rfc:`2217` Network ports ------------------------- .. warning:: This implementation is currently in an experimental state. Use at your own risk. .. class:: rfc2217.Serial This implements a :rfc:`2217` compatible client. Port names are URLs_ in the form: ``rfc2217://:[/