androidthings / contrib-drivers Goto Github PK
View Code? Open in Web Editor NEWOpen source peripheral drivers
License: Apache License 2.0
Open source peripheral drivers
License: Apache License 2.0
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!!
Hello! please could you add support for these LCD displays?
Or... there is any way for installing the official driver? (http://www.spotpear.com/download/diver24-5/LCD-show-150602.tar.gz)
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.
What is the status of the UART / GPS driver buffer overflow bug?
See Stack Overflow: uart-gps-driver-sample-buffer-overflow
Is a new version of the GPS driver planned?
Currently it's hardcoded to 128x64
.
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.Direction.REVERSED
flag for overloaded Apa102
constructor allows use of leds in reverse, left-to-right order, using the same indexes, which can be convenient for certain use cases.
Suggestion to implement the function pulseIn() in GPIO.
Reference: https://www.arduino.cc/en/Reference/pulseIn
Thank you
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?
I am getting the opposite of what this stats supposed to do-> LogicState.PRESSED_WHEN_HIGH and LogicState.PRESSED_WHEN_LOW
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
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.
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()
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)
I then ran some other test with different texts. Here are the results.
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 :)
Hello,
For a project I buy this display https://www.adafruit.com/product/2315 does it will work out of the box with android things ? If not what should I do to make it work ?
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 {
...
}
Hi today i included library inti AndroidThings projcet using AndroidStudio.
Below classes are missing from library
AlphanumericDisplay, Speaker,
Servo,Button,
ButtonInputDriver,Apa102,
Bmx280SensorDriver,Bmx280
Hi,
as requested in the contributing I'm opening this issue to propose the addition of a new driver I wrote for the SH1106 OLED display.
The driver is based on the already available SSD1306 driver and the code can be found here: https://github.com/leinardi/androidthings-kuman-sm9/tree/master/sh1106
Please let me know if you are interested in a pull request.
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (24.2.0) and test app (25.4.0) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
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.
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;
}
}
}
}
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?
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.
Button A works fine, but buttons B and C are not working, maybe they are mapped out to the wrong pin?
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?
What about the IR sensor ?
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
Hi, Is it possible to use voicehat driver with Pico developer kit?
Bmx280 class define 0x77 for I2C address, but bmx280 can config two I2C address, 0x76 and 0x77.
Done in #11
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.
Done in #47 .
Hello,
I'm working on HD44780 based LCD support in User-space drivers layer. I wish to share after completion.
Hi, I know that currently you are not accepting external contributions for new drivers but, in case you will open contribution again, I would like to make a PR for the LSM9DS1, the 3D accelerometer, 3D gyroscope, 3D magnetometer and temperature sensor used also in the Sense Hat.
Meanwhile I published the driver on JCenter, more info here: https://github.com/leinardi/androidthings-drivers/tree/master/driver-lsm9ds1
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。
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!
Hi,
I have this driver https://github.com/intel-iot-devkit/upm/tree/master/src/smartdrive running ok in upm sensors drivers. (I tested this with android studio, gradle, jcenter and I managed to move two engines through i2c of the smartdrive - driver.
How the manufacture of intel edison died I need transport this to androidthings drivers.
What are the steps I should take and where to get the tutorials I need?
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
Please add DHT22 temperature sensor in this driver.
It would be nice to have guidance on if drivers should all support register() or if it is optional, and if so, when it should/should not be supported.
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
The latest commit from the RainbowHat driver say something about openBuzzer()
inside the README.md
.
Unfortunately isn't there any openBuzzer()
method inside the RainbowHat
class but a openPiezo()
What should we do now?
Change the README
or method? 🤔
It is used on the sample code, but it is not present on the code.
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
It should point to: https://github.com/androidthings/sample-button/tree/master
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
Length test is before the check to see if the '.' can be added to the previous character.
(Also, Font file can contain '.' which makes logic a little simpler)
Changes at Jatra@2161e2c
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.