Coder Social home page Coder Social logo

contrib-drivers's People

Contributors

aabedraba avatar abrauchli avatar adkl avatar alvarowolfx avatar blundell avatar darconeous avatar davemckelvie avatar daverim avatar david-fournier-smartnsoft avatar devunwired avatar dx724 avatar ed7coyne avatar fleker avatar gadgetoid avatar geeksunny avatar ipereziriarte avatar irataxy avatar jdkoren avatar kokoro-team avatar lgleasain avatar mangini avatar nilhcem avatar prashanthswami avatar proppy avatar samhansen avatar seventhmoon avatar swittman avatar teijeong avatar tomaszrykala avatar trippedout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contrib-drivers's Issues

USB diver access on raspberry pi 3

Hello Team,

Successfully flash iot_rpi3.img image in raspberrypi 3. Now i want to access USB device.But i didn't know that how can access usb device over Android Things OS in raspberryPi 3.
Please Help me as soon as possible!!

GPS Location Speed always null

I am trying to get the speed from the Location object that I get from my LocationListener, the object never has speed.

private LocationListener mLocationListener = new LocationListener() {

        @Override
        public void onLocationChanged(Location location) {
            if(location.hasSpeed()) {
                 Log.d(TAG, "We got speed!!!");
            }
        }

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {
        }

        @Override
        public void onProviderEnabled(String provider) {
        }

        @Override
        public void onProviderDisabled(String provider) {
        }
    };

My Log never get hit although the lat long are correct.

I put some breakpoints in NmeaGpsDriver#onGpsSpeedUpdate and in GpsDriver#reportLocation and I see the speed having the correct value there.

I tried to log while having the device moving at 30mph, no speed at all from the LocationListener.

How to support sim card

If I don't have WiFi, I still want to use the Internet, i can use sim card 。 just like phone,do you have any ideas 。3q

Apa102 not behaving as expected

I'm not sure if this is a bug or not, but I'm seeing the following behavior when using the Apa102 LED/pixel strip:

I'm trying to turn the pixels/LEDs on when pressing one of the buttons and off after releasing:

    private void doRainbow(boolean pressed) {
        Log.d(TAG, "rainbow pressed: " + pressed);
        ledstrip.setBrightness(1);
        try {
            int[] rainbow = new int[NUM_LEDS_IN_STRIP];
            if (pressed) {
                for (int i = 0; i < rainbow.length; i++) {
                    rainbow[i] = Color.HSVToColor(255, new float[]{i * 360.f / rainbow.length, 1.0f, 1.0f});
                }
            } else {
                for (int i = 0; i < rainbow.length; i++) {
                    rainbow[i] = Color.HSVToColor(0, new float[]{0, 0, 0});
                }
            }
            Log.d(TAG, "rainbow being written: " + rainbow[0] + " " + rainbow[1] + " " + rainbow[2] + " " + rainbow[3] + " " + rainbow[4] + " " + rainbow[5] + " " +rainbow[6]);
            ledstrip.write(rainbow);
//            ledstrip.write(rainbow); <--- if I write 2x, this all works as expected
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

This doesn't seem to work. It'll end up reversing what I want to have happen (will be on when not pressed even though the log indicates I just wrote [0,0,0,0,0,0,0] to the ledstrip).

If I write 2x, it works as expected. Am I misusing this, or is it a bug?

Approval to contribute?

Hello, guys.

I have written a driver for the MAX31865 RTD-to-Digital converter. It is limited at this point in that you have to ask the device to make a measurement for you, but it works. I am currently adding code in order to take full advantage of the device's capabilities, including repeated automatic measurements at this point.

I would like to contribute to this project and add that driver here.

I followed the instructions here (https://github.com/androidthings/contrib-drivers/blob/master/CONTRIBUTING.md) and submitted the individual CLA, but have yet to hear anything back.

Is there anything else I need to do before I can start contributing to the project?

Thanks.

-Mario

Add support for BME280 Humidity readings

I'm thinking of taking a stab at this, but wanted to open an issue so that we are not duplicating efforts. This will be added to the BMX280, and add support for humidity along with error messages if a user tries to use an un-supported function on a sensor, IE: trying to read humidity on a BMP-280 which does not support it. I'd also like to bubble up the device ID as part of the driver so that someone can determine which sensor is hooked up programatically. It looks like it's already in the driver but just needs to be exposed.

Issue with VoiceHat: Constructor does not set mAudioFormat

The constructor of VoiceHat does not assign mAudioFormat to audioFormat.

This will result in a NullPointerException in com.google.android.things.audio.AudioConfiguration.encodingFromAudioFormat when you either call AudioInputUserDriver() or registerAudioOutputDriver()

HT16K33 - display() and clear() not working correctly

I am trying the ht16k33 driver on a raspberry pi3 running preview 3 and the version 0.3 of the driver. My display is the Adafruit 1.2" 7-segment LED HT16K33 Backpack.

When sending the command clear(), the last digit on the display still light up some segments (cf picture)
clear

I then ran some other test with different texts. Here are the results.

xoxo
"XOXO"

abcd
"abcd"

Digits from "0000" to "9999"
0000
1111
2222
3333
4444
5555
6666
7777
8888
9999

Support for Adafruit's DC & Stepper Motor Hat

Hey all, I've started adding support for Adafruit's DC & Stepper Motor Hat on Android Things. Code and demo is available here: https://github.com/zugaldia/adafruit-motor-hat.

This is my first Android Things driver, so I'd appreciate any 👀 on common errors and best practices. For now, it's pretty much a line-by-line port of the original Python library (using com.google.android.things.pio.I2cDevice instead).

Feel free to close this ticket, I just wanted to let you know this thing existed :)

Speaker does not have play(tone, duration) method

The readme for PWM Speaker describes an overloaded play() method that takes a tone and a duration as arguments. The driver however, supplies only a method that allows the tone.

readme source:
https://github.com/androidthings/contrib-drivers/tree/master/pwmspeaker

extract:

// Make it play:

try {
    mSpeaker.play(440 /* tone */, 3000L /* duration */);
} catch (IOException e) {
    // error setting speaker
}

The only currently existing method:

    public void play(double frequency) throws IOException, IllegalStateException {
...
    }

AlphanumericDisplay class missing

Hi today i included library inti AndroidThings projcet using AndroidStudio.
Below classes are missing from library

AlphanumericDisplay, Speaker,
Servo,Button,
ButtonInputDriver,Apa102,
Bmx280SensorDriver,Bmx280

BMX280 Pressure only readings do not work

When taking readings from a BMP280 sensor it only updates readings for pressure if you are also monitoring the temperature. If you try to only monitor the pressure no reading is ever returned.

Speaker only works once

Hello @mangini,

I am using the last version of the speaker (0.3), it works very well when I interact with others hardware components, but, when I put inside a firebase callback, the method "stop" works only once.

Do you know why?

package com.example.androidthings.doorbell;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.google.android.things.contrib.driver.pwmspeaker.Speaker;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

import java.io.IOException;

public class DoorbellActivity extends Activity {

    private static final String TAG = DoorbellActivity.class.getSimpleName();
    private static final String ALARM = "alarm";
    private static final int FREQ = 7000;

    private Speaker mSpeaker;
    private DatabaseReference alarmRef;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "Doorbell Activity created.");

        try {
            mSpeaker = new Speaker(BoardDefaults.getPwmPin());
            mSpeaker.stop();

            alarmRef = FirebaseDatabase.getInstance().getReference().child(ALARM);
            alarmRef.addValueEventListener(alarmListener);
        } catch (IOException e) {
            Log.e(TAG, e.toString());
        }
    }

    private final ValueEventListener alarmListener = new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            Log.i(TAG, "alarmListener");
            Boolean value = (Boolean) dataSnapshot.getValue();
            try {
                if (value) {
                    mSpeaker.play(FREQ);
                } else {
                    mSpeaker.stop();
                }
            } catch (IOException e) {
                Log.e(TAG, e.toString());
            }
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {
            Log.e(TAG, "onCancelled: " + databaseError);
        }
    };

    @Override
    protected void onDestroy() {
        super.onDestroy();

        if (mSpeaker != null) {
            try {
                mSpeaker.stop();
                mSpeaker.close();
            } catch (IOException e) {
                Log.e(TAG, "Error closing speaker", e);
            } finally {
                mSpeaker = null;
            }
        }
    }
}

Support for backlight display control

Please add support for backlight control on Raspberry Pi 3.
My setup is 0.4-devpreview and official 7 inch display.
At the moment backlight is at maximum and there is no way of setting any value or control whatsoever. Common intents like System.Setting are not supported.

On Raspbian I used these to turn on

echo 0 > /sys/class/backlight/rpi_backlight/bl_power

and to turn it off:

echo 1 > /sys/class/backlight/rpi_backlight/bl_power

And brightness can be adjusted using:

echo n > /sys/class/backlight/rpi_backlight/brightness

where n is some value between 0 and 255.

These are not in Android Things or am I not seeing some other way of display backlight control on official display?

Bluetooth support on RPi3

Is there any plans to support bluetooth for Things devices like RPi3? I think BLE support is essential part of making IoT solutions.

There is RTAndroid project which has BLE support. Probably it would be easy to use part of their codebase to make Things BLE ready.

Apa102 LED Can not light

I got the AndroidThings developer kit in 2017 Google I/O's IOT Codelabs, and I want to retry the Weatherstation. But I can't light the Rainbow LED. Here is the url from codelabs, and my code is the same as it:

// Initialize LED strip
        try {
            mLedstrip = new Apa102(BoardDefaults.getSpiBus(), Apa102.Mode.BGR);
            mLedstrip.setBrightness(LEDSTRIP_BRIGHTNESS);
            int[] colors = new int[7];
            Arrays.fill(colors, Color.RED);
            mLedstrip.write(colors);

            Log.d(TAG, "Initialized SPI LED strip");
        } catch (IOException e) {
            throw new RuntimeException("Error initializing LED strip", e);
        }

Sometimes the LED will light but I can't control it. Can you help me to resolve it?

APA102 on Intel Edison: Unknown I/O name SPI2

I'm writing my second Android app using AndroidThings... first being a blink demo. So admittedly; I'm likely out of my element.

When I run my application; I'm getting the following error on the following lines:

            Log.d(TAG, "Initializing LED strip");
            mApa102 = new Apa102(apa102BusName, LED_MODE);

where
private static final String apa102BusName = "SPI2";

LogCat reports:

11-26 07:36:55.008 19031-19031/com.pinball_mods.zitt.edisontest D/HomeActivity: Initializing LED strip
11-26 07:36:55.019 19031-19031/com.pinball_mods.zitt.edisontest I/HomeActivity: Unable to configure SPI2 for APA102 led strip
                                                                                com.google.android.things.pio.PioException: android.os.ServiceSpecificException: Unknown I/O name SPI2
...

Do I have a broken Edison build chain? What am I missing

Driver for ar1100 touch panel

Hello, I need to use lcd with touch panel in my project, touch is controlled by ar1100. Android things not have driver for this touch, what I need to use this panel? How I can configure android? Lcd connected via hdmi work good.

How to support sim card

If I don't have WiFi, I still want to use the Internet, i can use sim card 。 just like phone,do you have any ideas 。i think its very import function.if it is simple for developers。i think more developers will use android things like android。

Contributing new drivers

Congratulations to the Android Things announcement, and thanks for providing this awesome repository!

I am exploring the Android Things platform with my Raspberry Pi 3 and gaining experience in developing drivers various I/O peripherals (so far, I am working on drivers for TI's INA219 current sensor and the environmental sensors on the Raspberry Pi Sense HAT). Will this repository accept drivers from individual developers, or should we host them on our own? In the long run, are there any plans for Google to offer a centralized repository (community-contributed or otherwise) for drivers of common peripherals?

Thanks and keep up the good work!

Add duration parameter to Speaker.play(tone) method

The readme for PWM Speaker used to describe an overloaded play() method that takes a tone and a duration as arguments. The driver however, supplies only a method that allows the tone.

readme source:
https://github.com/androidthings/contrib-drivers/tree/master/pwmspeaker

extract:

// Make it play:

try {
    mSpeaker.play(440 /* tone */, 3000L /* duration */);
} catch (IOException e) {
    // error setting speaker
}

The only currently existing method:

    public void play(double frequency) throws IOException, IllegalStateException {
...
    }

For the time being the documentation has removed description of the duration parameter, but it has been requested for implementation by @mangini

Implement BLE methods

I can't find if android things have BLE enabled for RPI3.

Somebody Know if is it enabled?

Suggestion to implement the function for control BLE easily

Thank you

How to support sim card

If I don't have WiFi, I still want to use the Internet, i can use sim card 。 just like phone,do you have any ideas 。3q

HMC5883L Driver

Hello,
I have a library written about 2 years ago. It's in my profile HMC5883L. Now I add it on my local repo and forked repo for AndroidThings. I want to merge it. If it is ok, I will create pull request.

Thank you.
Good work.

Please add support for PiFace Digital 2

I would really love to use my PiFace Digital 2 with Android Things on my Raspberry Pi 3.
Unfortunately, my knowledge is not advanced enough for me to be able to write my own driver.
I think that more people would benefit from this.
Thank you

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.