GithubHelp home page GithubHelp logo

rtk's Introduction

anyio V2.0 Dev

A GPIO Python module, that works on many platforms.

Based on anyio by David Whale @whaleygeek, Improved by Ryan Walmsley @Ryanteck

The anyio package aims to mimic the basic functionality of the RPi.GPIO Python module that is used on the Raspberry Pi computer. 'Mimic' is used in the loosest sense of the word, because all it does is to implement 5 functions of the same name as the RPi.GPIO module. This allows you to write simple GPIO programs in Python, that work on Raspberry Pi, PC, Mac and Linux computers.

This package consists of two parts - a Python module that runs on a PC, Mac or Linux machine (well, anything that can run Python and pyserial), and some firmware that is programmed to a microcontroller.

The two are linked together by a serial port controlled by the pyserial library. Calls to the anyio.GPIO methods on the host computer will cause reads or writes to the GPIO pins on the microcontroller platform.

Supported Boards Are: Arduino Pro Micro

In this way, it is possible to write a hardware control program on any platform, that can easily be ported between different platforms (including the Raspberry Pi). Just change the "import RPi.GPIO as GPIO" to "import anyio.GPIO as GPIO" and change your pin numbers, and you'll be working in no time!

The serial link between the two parts runs at varying speeds depending o the microcontroller, and each command is only a few characters, so the system performs reasonably well unless you are repeatedly polling or changing lots of GPIO's at the same time.

The arduino pro micro runs at 115200 Baud and the at a faster baud rate.

Board Options

Currently the is being funded on kickstarter over at

You can also buy an arduino pro mico pre-programmed ready to go from: http://skpang.co.uk/catalog/pro-micro-33v8mhz-with-headers-and-anyio-firmware-p-1327.html

All you need to do is plug it in, download this module by choosing the "Download as Zip" button, unzip the file and run the test programs, and you'll be working in no time!

You can also program your own pro micro and flash the firmware located at anyio/arduino/firmware/gpio/gpio.ino to get going.

USE OF PYSERIAL

This module uses pyserial to communicate with the Arduino Pro Micro.

anyio modifies the Python PACKAGEPATH for you when it runs, to make sure that it uses this embedded pyserial rather than one that might or might not be installed on your system. This means that if you don't have pyserial installed on your system, you should still be able to just run this out of the box and it should work.

If you already have pyserial installed and want to use your installed version for any reason, you can change the anyio/arduino/GPIO.py USE_EMBEDDED_PYSERIAL = False

FUTURE WORK

This package contains a console based (text mode) simulator that can be used to test your programs on before you connect to real hardware, and this supports both inputs and outputs. This console package works, but is not completely documented yet. You can try it with this: import anyio.console.GPIO as GPIO

The GPIO interface itself could be anything, not just an Arduino. There is a very simple protocol between the python module and the target GPIO hardware, that is written in a way to allow future extension to support other hardware peripherals such as I2C, SPI, UART, PWM, Analog, OneWire and other protocols and features aimed at near real time control and sensing.

There are placeholders in the design for a tkinter GUI simulator that I am planning to write soon, and also a network aware version, that allows GPIO controls to be sent remotely over a network connection to a GPIO server running on any arbitrary host computer (e.g. a Raspberry Pi).

NOTES ABOUT COPYRIGHTED MATERIAL

The source code in the anyio package is (c) 2014 David Whale.

There is an embedded version of pyserial inside the anyio package, and this is provided in it's entirely complete form, with it's original licence, which allows for it to be embedded inside other packages with out any special install.

There is an embedded version of the ProMicro.inf file, which came from the SparkFun github repository. It is included here for convenience, but the latest copy can always be retrieved from here:

https://github.com/sparkfun/SF32u4_boards/blob/master/driver/ProMicro.inf

David Whale

@whaleygeek

June 2014

rtk's People

Contributors

ryanteck avatar whaleygeek avatar lurch avatar

Stargazers

Jason Duke avatar  avatar Sercuto avatar  avatar  avatar Mike Gedzius avatar Jeremy Davis avatar Andrew Stalick avatar  avatar regymm avatar Aidan Dodds avatar Carl J. Nobile avatar Kevin Karhan avatar MCHobby avatar Patrick Roncagliolo avatar Евгений Шполинский avatar Don Jackson avatar Michal Lasak avatar Oyono avatar  avatar JMcn avatar Rob Eastham avatar Benjamin Henrion avatar datab0t avatar Dominic  avatar Giampaolo Mancini avatar Meir Michanie avatar GarageTech101 avatar  avatar Mike Renne avatar David Glaude avatar

Watchers

James Cloos avatar  avatar Kean Maizels avatar  avatar David Glaude avatar

rtk's Issues

Python 3 Inputs

Inputs need to be fixed in python 3 as identified by the jenkins build.

RTk Licence (and AnyIO Licence)?

Dear Ryan,

I understand you are using anyio as a base for your code.

While this as the benefit to exist, it has a very strange software licence https://github.com/whaleygeek/anyio/blob/master/LICENSE that might be very restrictive and far from compatible with other licence:

  1. For educational or non commercial purposes.
  2. You agree to not restrict my rights in the use of this Software in any way.

Do you have a formal agreement with the original copyright owner?

What does that mean that the software needed for using the RTk and what does that mean for any software that use the library?

What about the firmware running in the board, what is the licence for that one.

Could you clarify the licence status of your project?

Regards.

Add analogue API

The MCU has a built in ADC that can be used on most pins.

While not strictly RPi.GPIO it may be nice to enable the use of these as a selling point of being used with a Pi.

GPIO 26 and 27 need fixing.

GPIO 26 and 27 aren't currently working so a modification needs to be made to the software on both the python and firmware side.

Licence question

I just noticed that LICENSE says:
"Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to use the
Software for educational or non commercial purposes."

Does the Kickstarter campaign not count as commercial purposes? ;)
Does this mean we can't use the RTK.GPIO board for commercial purposes?

Some clarification would be great...

GPIO 0 & 1 Are not wired up

@lurch Pointed out that the odd add-on may use GPIO 0 & 1 pins which are located on the HAT EEPROM Pins.

Currently these are not wired up and the original plan was for them to not be.

The MCU may have one or two pins free. The question is weather they should be used as GPIO or not.

Cause MacOS panic when plug to MacBook Pro via USB

System: macOS Sierra v10.12.3
MacBook Pro (Retina, Mid 2012)
Intel Core i7 2.7 G
16GB 1600MHz DDR3

When I plug the Rtk.GPIO into my MacBook Pro the screen blacks out and after a while it shows the system is getting problem and needs to be restarted.

Serial bug

Serial library needs re- bundling with it instead of using host lib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.