Git Product home page Git Product logo

micropython-rfsocket's Introduction

micropython-rfsocket

Micropython implementation of popular 433MHz based RF Sockets (i.e. Anslut/Proove/Nexa) using cheapo FS1000A transmitter.

Installation

  1. Get upip for your python3 installation pip install micropython-upip
  2. Create "lib" directory on your micropython SDcard/Filesystem
  3. Install micropython-rfsocket there like this python -m upip install -p /media/[your-login]/45DE-XXXX/lib micropython-rfsocket
  4. Use in main.py like this: from rfsocket import RFSocket

Range

As far as I can tell FS100A transmitter connected to 3V3 seems to be at least twice as strong as the remote sold with the sockets. Stock remote is spotty at best. FS1000A was able to reliably toggle the socket trough multiple walls.

Basic usage

#!/usr/bin/env python3

import pyb
from rfsocket import RFSocket

p = pyb.Pin('X1', pyb.Pin.OUT_PP)
r = RFSocket(p)

sw = pyb.Switch()
on_led = pyb.LED(2)
off_led = pyb.LED(1)

toggle = True
while True:
    if sw():
        if toggle:
            r.group_on()
            on_led.on()
            off_led.off()
        else:
            r.group_off()
            on_led.off()
            off_led.on()
        toggle = not toggle
        pyb.delay(300)

micropython-rfsocket's People

Contributors

wuub avatar

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.