First let me say that AndroidThings is AMAZING! I like everything about the concept of getting Android into IOT. I am trying to bring AndroidThings to my company for use in production lines. Onto the question!
I have been trying to use Bluetooth low energy for communication with devices. I have gotten the Bluetooth working sometimes. That is I enable the Bluetooth adapter and it very quickly starts and I get scan results thereafter. Now say I do this another time, I check the adapter enable state, I try to enable and it just sits there. One way that seemed to work was to call BluetoothAdapter.disable() no matter what (maybe clearing something?) then performing a BluetoothAdapter.enable().
It seems like when using AndroidThings enabling the bluetooth hardware on the Pi is very 'finicky'. Also I have noticed that it may take up to 1 minutes to enable the Bluetooth.
Things to know:
I have tested this on multiple PIs.
I am using DP7 (though i saw this on DP6 also)
The main problem I am seeing is the enabling of the
bluetooth hardware (BluetoothAdapter)
Yes I have all of the required permissions:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Yes I have power cycled the PI after I have put the app
on it.
I have implemented a retry mechanism for enabling the adapter and it still sometimes does not work.
I have followed the bluetooth tutorial on the AndroidThings page and I still get inconsistent results.
Has anyone else seen this issue or related issues?
I think this issue is solved in the new updated version of Android Things (1.0.1,updated June 2018)
Resolved Issues:
Raspberry Pi 3 devices with UART hardware connected fail to boot up.
Bluetooth is disabled on the Raspberry Pi 3 due to an invalid hardware configuration. This hardware configuration is created by the starter kit settings in the Android Things Console.
Related
while working on a project I came across an issue that esp32 restarts whenever BLE enabled. I don't know why this happen. And also its not happening on all device, the issue raised randomly on tw0 devices which I'm making.
I've built the custom_gattsvc_app and updated it into my movesense sensor through DFU in AndroidSampleApp. Now I am not anymore able to connect to the sensor. The sensor can be found by AndroidSampleApp as well as NRF Connect, but connecting does not work.
The sensor itself blinks in short intervals, perhaps it is in reset loop? I don't have a programming jig, so I can't even update it anymore (Cannot connect -> cannot update). I am using version 1.9.1. I've tested other example apps, such as hello_world_app and ble_std_services, and they have worked just fine.
Is there a known problem here?
Building done with following commands:
cmake -G Ninja -DMOVESENSE_CORE_LIBRARY=../MovesenseCoreLib/ -DCMAKE_TOOLCHAIN_FILE=../MovesenseCoreLib/toolchain/gcc-nrf52.cmake ../samples/custom_gattsvc_app
ninja dfupkg
The device might be crashing and trying to restart continuously. If you are not blinking the led and have turned off the BLE advertising in your code.
You should be able to recover by taking out the battery, short the two contacts with your finger(dip your finger in water if you have dry skin) and insert the battery, release the contacts immediately when the led starts to flash.
Your sensor should no be in DFU mode(led constantly on) and ready to update firmware. You can use the "nRF Toolbox" app(from the producer of the Bluetooth chip used in the Movesense device) to upload a new build of your code/example.
Custom GATT Example seems to be working with version 1.8.1, so I will continue using that. Perhaps the problem is related to this: https://bitbucket.org/suunto/movesense-device-lib/issues/70/version-190-and-191-and-send_ble_nus_data
I'm really having trouble connecting to my ESP8266. I was working with this setup for long time now and I didn't have to flash my boards. Now after having to use a different wifi i needed to flash the board. After doing the following
Updating to the newest ConfigurableFirmata
Using FirmataBuilder to download fitting firmata
Uploading the Firmata to the ESP8266
I can't connect via Johnny-Five anymore (getting the usual timeout error). I couldn't narrow down what it exaclty is (and I have been trying all day) but these are things that I have noticed (Using ConfigurableFirmata directly as well as using firmatabuilder and StandardWifiFirmata, all with the same behaviour)
an open Hotspot gets created even though I'm in Client Mode
when scanning for ports I do find the Module connected to my Wifi (Serial Monitor in Debug tells me the same too) but no open port is found, even though it's specified in the firmata.
I just can't narrow down the reason. I hope you guys can.
OK,
this was a simple user mistake. But since I lost a whole day searching for the error and I think others might too, I'll share my mistake here.
As I pointed out I created the Firmata as Client (thinking its a client to my Hotspot). But you will have to create it as a server (as you want to connect to the board)
It's as simple as that. If you are on http://firmatabuilder.com/ make sure you choose TCP Server if you want to connect to your board.
First of all, I won't go into details, cause there are a lot of them, and I dont want to write (a too long) essay. There is TL;DR section at the end, because I have a specific question, but maybe some additional info can help.
I have a device that is made of a GRU (glass room unit) and espressif (esp8266).
GRU and esp8266 communicate via serial, with GRU as master. GRU is programmed with an internal tool, and I can monitor everything on it, including the info it gets from esp8266.
There is a test/development device, that has espressif on top of the GRU, so I can easily take it off, reprogram/reconfigure it, and put it on.
Espressif is inside of a GRU, and downloading stuff to flash is a real pain. There is whole process including a OS switch (from Win7 to Linux and back). Console output on espressif cannot be done, or at least not in the time frame I have.
For esp8266 I use non-os SDK V2.0.0_16_08_10.
Espressif can be configured with downloading a configuration to flash, or via UDP (over a network if connected, over its AP if its not connected).
Algorithm for Wifi:
1. Try to connect to a network from configuration
2. If it succeeds, raise a flag for that
3. If it fails, enter dual (STATION+AP) mode and raise a flag for that
The reason espressif is not always in dual mode is that it affects multi-cast operations.
Configuration over network is done by a Java aplication I wrote.
Scenario 1
I've configured a wifi router, configured all (x19) of the devices (espressif in devices that is) to connect to its network. When I turned them on, they would connect one by one. The ones that didn't entered dual mode and could be configured via the app.
All well.
Scenario 2
I've wanted to test the system in real world, so I reconfigured them to connect to the our firms network. Additionally when I was already going thru the whole process I've downloaded latest firmare to flash.
I expected that they would connect or enter dual mode and create their own APs. But they did not.
I tested then the code and configuration on espressif whose console output I could monitor, and everything worked.
I tested then the code and configuration on the test device, and it worked again.
I've then redownloaded the code and configuration to one device, and it didn't work.
TL;DR
I have two devices, espressif on a GRU and espressif inside of a GRU. Both connected to one network. Esp on a GRU work for another, Esp inside of a GRU doesn't work for that other network.
They have identical code and configuration, so it shouldn't be a software issue.
Does having espressif inside of a device jams its signal enough that it can't go trough? Device is not big (5x5x2cm).
UPDATE 1:
While I was writing, the espressif inside of a GRU managed to connect to network. I then restarted it so I can check that it can do it again, and it can't connect again.
It took me about 10 minutes to write the whole question.
There are two things that seem to have caused the problem.
When I removed gpio_init(), network stuff became faster, much much faster. Everything on it, connecting to AP, creating AP etc...
I've changed my config and wifi code, so that it now stores the ap and station config to flash via API.
I only check if its internal config is the same as mine from flash. If it isn't, it saves it. Now, I only control the current opmode.
I am working on a project that requires me to use TI's MSP430F5529 launch pad, CC3100 Booster Pack and CC3100XX Emulator.
The project I would like to do is have the MSP430 log sensor data and to transmit it to a PC wirelessly(Without Internet). I am a beginner in using MCU,s but I can handle the datalogging part. I do not know how to get started with the communication part.
Can someone please direct me to where I could get some good reference material to get this project off the ground and if possible better insight on what I need to do to get started.
Thank you all in advance.