Giter VIP home page Giter VIP logo

l76micropygps's Introduction

L76micropyGPS

A pytrack L76 class that feeds a micropyGPS object POC. Based on the excellent micropyGPS, that is in turn based on the most excellent tinyGPS++ C++ Ardunio class.

The idea is to take advantage of microPython threading to setup a GPS/GNS system that in the background is constantly updating its data based on the NMEA data is receives, without having to constantly call it to update itself. It does this by having a thread that constantly reads the NMEA sentences from the devices and parses them into GPS/GNS variables so that they can be read by python code.

This allows you to fire up the GPS/GNS pytrack L76 module, go do other things like check other sensors, or setup a WIFI/HTTP[S]/LTE/LoRaWAN connection, then go back and see if you have GPS/GNS data worth using yet.

Intro

Usage

  1. Checkout the repo
  2. Flash your device
  3. Read the main.py for examples. boot.py does very little bar start a timer for testing and the UART to print them out.

Own usage

Use the main.py code as an example. The print statements can be removed as they are there for memory / displaying to console.

NOTES

Presently the pycoproc code assumes an i2c ID of 0 here; https://github.com/pycom/pycom-libraries/blob/master/lib/pycoproc/pycoproc.py#L78 If you use another i2c device give it an ID above 0! thing.i2c = I2C(C1, foo, bar)

Thanks to tttadam on the pycom forums for spotting; https://forum.pycom.io/topic/3870/pytrack-gps-library/10

Todo

  • Add something to stop thread

l76micropygps's People

Contributors

gregcope avatar

Stargazers

Tschak avatar  avatar Daniel O'Sullivan avatar Gordo Lowrey avatar  avatar Valerio Vaccaro avatar

Watchers

James Cloos avatar  avatar  avatar

l76micropygps's Issues

while instead of sleep

Instead of sleeping thread consider something like;

while ticks_ms() - startTime <= 1000:
        if uart.any():
            data = uart.read()
            for s in data:
                my_gps.update(chr(s))
startTime = ticks_ms()
while ticks_ms() - startTime <= 250:
    # get some NMEA data
    someNmeaData = str(self.i2c.readfrom(GPS_I2CADDR, 128))
    # Pass NMEA data to micropyGPS object
    for x in someNmeaData:
        self.my_gps.update(str(x))
    startTime = ticks_ms()

Idea from inmcm/micropyGPS#11

Is this going to be better than time.sleep(0.25)?

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.